blob: 4cdad78284819ffff446478c18a65ee6b2abbfa6 [file] [log] [blame]
Zack Williamscc58c672018-10-18 19:51:06 -07001---
2# python module unit test
3
4- job-template:
5 id: 'python-unit-test'
6 name: 'verify_{project}_unit-test'
7
8 description: |
9 Created by {id} job-template from ci-management/jjb/xos-unit.yaml
10
11 triggers:
12 - cord-infra-gerrit-trigger-patchset:
13 gerrit-server-name: '{gerrit-server-name}'
14 project-regexp: '^{project}$'
15 branch-regexp: '{branch-regexp}'
16 dependency-jobs: '{dependency-jobs}'
17 file-include-regexp: '{all-files-regexp}'
18
19 properties:
20 - cord-infra-properties:
21 build-days-to-keep: '{build-days-to-keep}'
22 artifact-num-to-keep: '{artifact-num-to-keep}'
23
24 wrappers:
25 - lf-infra-wrappers:
26 build-timeout: 20
27 jenkins-ssh-credential: '{jenkins-ssh-credential}'
28
29 scm:
30 - lf-infra-gerrit-scm:
31 git-url: '$GIT_URL/$GERRIT_PROJECT'
32 refspec: '$GERRIT_REFSPEC'
33 branch: '$GERRIT_BRANCH'
34 submodule-recursive: 'false'
35 choosing-strategy: gerrit
36 jenkins-ssh-credential: '{jenkins-ssh-credential}'
37
38 node: '{build-node}'
39 project-type: freestyle
40 concurrent: true
41
42 builders:
43 - shell: |
44 #!/usr/bin/env bash
45 set -eux -o pipefail
Zack Williams06590b62018-10-18 22:16:27 -070046
47 if [ -f requirements.txt ]; then
48 echo "requirements.txt found, installing locally with pip"
49 pip install -r requirements.txt
50 fi
51
Zack Williamscc58c672018-10-18 19:51:06 -070052 echo "Performing nose2 tests"
53 nose2 --verbose --coverage-report xml --coverage-report term --junit-xml
54
55 publishers:
56 - junit:
57 results: "**/nose2-junit.xml"
58 - cobertura:
59 report-file: "**/coverage.xml"
60 targets:
61 - files:
62 healthy: 80
63 unhealthy: 0
64 failing: 0
65 - method:
66 healthy: 50
67 unhealthy: 0
68 failing: 0