---
apiVersion: batch/v1
kind: Job
metadata:
  name: test-runner-job-orc8r
spec:
  template:
    metadata:
      labels:
        app: test-runner
        type: integration-tests
      name: test-runner-pod
    spec:
      restartPolicy: Never
      containers:
        - image: test_runner_image
          name: test-runner-orc8
          imagePullPolicy: IfNotPresent
          command: ["python"]
          args: ["-m", "pytest", "-vvv", "-s", "-m", "orc8r", "--junit-xml=/backend/test_runner/test-results/test_report.xml", "tests"]
          volumeMounts:
            - name: test-results
              mountPath: /backend/test_runner/test-results
            - name: certificates
              mountPath: /backend/test_runner/certs
              readOnly: true
      volumes:
        - name: test-results
          hostPath:
            path: /tmp/integration-tests-results
            type: DirectoryOrCreate
        - name: certificates
          projected:
            sources:
              - secret:
                  name: orc8r-secrets-certs
  backoffLimit: 10
