blob: 18bdb96eb1943cb0c0dc6fa79be6ff9918640e73 [file] [log] [blame]
---
# python module unit test
- job-template:
id: 'python-unit-test'
name: 'verify_{project}_unit-test'
description: |
Created by {id} job-template from ci-management/jjb/xos-unit.yaml
triggers:
- cord-infra-gerrit-trigger-patchset:
gerrit-server-name: '{gerrit-server-name}'
project-regexp: '^{project}$'
branch-regexp: '{branch-regexp}'
dependency-jobs: '{dependency-jobs}'
file-include-regexp: '{all-files-regexp}'
properties:
- cord-infra-properties:
build-days-to-keep: '{build-days-to-keep}'
artifact-num-to-keep: '{artifact-num-to-keep}'
wrappers:
- lf-infra-wrappers:
build-timeout: 20
jenkins-ssh-credential: '{jenkins-ssh-credential}'
scm:
- lf-infra-gerrit-scm:
git-url: '$GIT_URL/$GERRIT_PROJECT'
refspec: '$GERRIT_REFSPEC'
branch: '$GERRIT_BRANCH'
submodule-recursive: 'false'
choosing-strategy: gerrit
jenkins-ssh-credential: '{jenkins-ssh-credential}'
node: '{build-node}'
project-type: freestyle
concurrent: true
builders:
- shell: |
#!/usr/bin/env bash
set -eux -o pipefail
if [ -f 'tox.ini' ]; then
echo "tox.ini found, running tox for Python2/3 unit tests"
tox
else
echo "tox.ini not found, running nose2 unit tests"
if [ -f 'requirements.txt' ]; then
echo "requirements.txt found, installing locally with pip"
pip install -r requirements.txt
fi
echo "Performing nose2 tests"
nose2 --verbose --coverage-report xml --coverage-report term --junit-xml
fi
publishers:
- junit:
results: "**/*junit.xml,**/*results.xml,**/*report.xml"
- cobertura:
report-file: "**/*coverage.xml"
targets:
- files:
healthy: 80
unhealthy: 0
failing: 0
- method:
healthy: 50
unhealthy: 0
failing: 0