blob: f81d71404b50e32fb1a69811610322f56388c801 [file] [log] [blame]
Zack Williamscee76d22019-04-29 13:08:20 -07001---
2# Makefile based unit test
3
4- job-template:
5 id: 'make-unit-test'
6 name: 'verify_{project}_unit-test{name-extension}'
7
8 description: |
9 Created by {id} job-template from ci-management/jjb/make-unit.yaml<br/>
10 Runs make with the following unit tests targets - '{unit-test-targets}'
11
12 triggers:
13 - cord-infra-gerrit-trigger-patchset:
14 gerrit-server-name: '{gerrit-server-name}'
15 project-regexp: '^{project}$'
16 branch-regexp: '{branch-regexp}'
17 dependency-jobs: '{dependency-jobs}'
18 file-include-regexp: '{all-files-regexp}'
19
20 properties:
21 - cord-infra-properties:
22 build-days-to-keep: '{build-days-to-keep}'
23 artifact-num-to-keep: '{artifact-num-to-keep}'
24
25 wrappers:
26 - lf-infra-wrappers:
27 build-timeout: '{build-timeout}'
28 jenkins-ssh-credential: '{jenkins-ssh-credential}'
29
30 scm:
31 - cord-infra-gerrit-scm:
32 git-url: '$GIT_URL/$GERRIT_PROJECT'
33 refspec: '$GERRIT_REFSPEC'
34 branch: '$GERRIT_BRANCH'
35 submodule-recursive: 'false'
36 choosing-strategy: gerrit
37 jenkins-ssh-credential: '{jenkins-ssh-credential}'
38 basedir: '{project}'
39
40 node: '{build-node}'
41 project-type: freestyle
42 concurrent: true
43
44 builders:
45 - inject:
46 properties-content: |
47 DEST_GOPATH={dest-gopath}
48 UNIT_TEST_TARGETS={unit-test-targets}
49 UNIT_TEST_KEEP_GOING={unit-test-keep-going}
Andy Bavier028398c2019-09-30 17:44:19 -070050 GOPROXY=https://proxy.golang.org
Eric Ballfdfc3ec2024-10-31 12:44:47 -070051 TEST_PROJECT={project}
Zack Williamscee76d22019-04-29 13:08:20 -070052 - shell: !include-raw-escape: shell/make-unit.sh
53
54 publishers:
55 - junit:
56 results: "**/*results.xml,**/*report.xml"
57 allow-empty-results: '{junit-allow-empty-results}'
Zack Williams0d196572021-04-12 08:42:24 -070058# NOTE: circa 2020-04-11, the Jenkins xUnit plugin version 3.x.x changed the
59# config XML to not be JJB compatible, replacing the previous XML <types> tag
60# with a <tools> tag.
61#
62# Temporarily switch to using raw XML to configure xUnit.
63#
64# The following xunit and XML should be equivalent, except that the variable
65# `xunit-skip-if-no-test-files` is assumed to always be true.
66#
67# - xunit:
68# types:
69# - gtest:
70# pattern: "**/*xunit.xml"
71# deleteoutput: false
72# skip-if-no-test-files: '{xunit-skip-if-no-test-files}'
73#
74 - raw:
75 xml: |
76 <xunit plugin="xunit">
77 <tools>
78 <GoogleTestType>
79 <pattern>**/*xunit.xml</pattern>
80 <failIfNotNew>true</failIfNotNew>
81 <deleteOutputFiles>false</deleteOutputFiles>
82 <skipNoTestFiles>True</skipNoTestFiles>
83 <stopProcessingIfError>true</stopProcessingIfError>
84 </GoogleTestType>
85 </tools>
86 <thresholds/>
87 <thresholdMode>1</thresholdMode>
88 <extraConfiguration>
89 <testTimeMargin>3000</testTimeMargin>
90 </extraConfiguration>
91 </xunit>
Zack Williamscee76d22019-04-29 13:08:20 -070092 - cobertura:
93 report-file: "**/*coverage.xml"
94 targets:
95 - files:
96 healthy: 80
97 unhealthy: 0
98 failing: 0
99 - method:
100 healthy: 50
101 unhealthy: 0
102 failing: 0
Joey Armstrongaf679da2023-01-31 14:22:41 -0500103
104# [EOF]