bugfix: pass functest parameters to builders
[releng.git] / jjb / doctor / doctor.yml
1 ---
2 - project:
3     name: doctor
4
5     project: '{name}'
6
7     stream:
8       - master:
9           branch: '{stream}'
10           gs-pathname: ''
11           docker-tag: 'latest'
12           disabled: false
13       - euphrates:
14           branch: 'stable/{stream}'
15           gs-pathname: '/{stream}'
16           docker-tag: 'stable'
17           disabled: false
18
19     installer:
20       - apex:
21           slave-label: 'doctor-apex-verify'
22       - fuel:
23           slave-label: 'doctor-fuel-verify'
24     # - joid:
25     #     slave-label: 'ool-virtual3'
26     #     pod: 'ool-virtual3'
27
28     phase:
29       - 'build-x86_64':
30           slave-label: 'doctor-{installer}-verify'
31       - 'build-aarch64':
32           slave-label: 'doctor-{installer}-{phase}-verify'
33
34     inspector:
35       - 'sample'
36       - 'congress'
37
38     task:
39       - verify:
40           auto-trigger-name: 'doctor-verify'
41
42     exclude:
43       - installer: 'apex'
44         phase: 'build-aarch64'
45
46     jobs:
47       - 'doctor-verify-{stream}'
48       - 'doctor-verify-unit-test-{stream}'
49       - 'doctor-{task}-{inspector}-{stream}'
50       - 'doctor-{task}-{installer}-{inspector}-{phase}-{stream}'
51
52 - job-template:
53     name: 'doctor-verify-{stream}'
54
55     disabled: '{obj:disabled}'
56
57     project-type: 'multijob'
58
59     parameters:
60       - project-parameter:
61           project: '{project}'
62           branch: '{branch}'
63       - 'opnfv-build-ubuntu-defaults'
64
65     scm:
66       - git-scm-gerrit
67
68     triggers:
69       - gerrit:
70           server-name: 'gerrit.opnfv.org'
71           trigger-on:
72             - patchset-created-event:
73                 exclude-drafts: 'false'
74                 exclude-trivial-rebase: 'false'
75                 exclude-no-code-change: 'false'
76             - draft-published-event
77             - comment-added-contains-event:
78                 comment-contains-value: 'recheck'
79             - comment-added-contains-event:
80                 comment-contains-value: 'reverify'
81           projects:
82             - project-compare-type: 'ANT'
83               project-pattern: '{project}'
84               branches:
85                 - branch-compare-type: 'ANT'
86                   branch-pattern: '**/{branch}'
87               file-paths:
88                 - compare-type: ANT
89                   pattern: 'doctor_tests/**'
90
91     builders:
92       - shell: |
93          #!/bin/bash
94          # we do nothing here as the main stuff will be done
95          # in phase jobs
96          echo "Triggering phase jobs!"
97       - multijob:
98           name: 'doctor-build-and-unittest'
99           execution-type: PARALLEL
100           projects:
101             - name: 'doctor-verify-unit-test-{stream}'
102               current-parameters: false
103               predefined-parameters: |
104                 GERRIT_BRANCH=$GERRIT_BRANCH
105                 GERRIT_REFSPEC=$GERRIT_REFSPEC
106                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
107                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
108               git-revision: true
109               node-parameters: false
110               kill-phase-on: FAILURE
111               abort-all-job: false
112
113 - job-template:
114     name: 'doctor-verify-unit-test-{stream}'
115     disabled: '{obj:disabled}'
116     wrappers:
117       - ssh-agent-wrapper
118       - build-timeout:
119           timeout: 60
120     parameters:
121       - project-parameter:
122           project: '{project}'
123           branch: '{branch}'
124       - 'opnfv-build-ubuntu-defaults'
125     scm:
126       - git-scm-gerrit
127     builders:
128       - 'doctor-verify-unit-test-builders-macro'
129     publishers:
130       - 'doctor-verify-unit-test-publishers-macro'
131
132 - job-template:
133     name: 'doctor-{task}-{inspector}-{stream}'
134
135     disabled: '{obj:disabled}'
136
137     project-type: 'multijob'
138
139     scm:
140       - git-scm-gerrit
141
142     triggers:
143       - '{auto-trigger-name}':
144           project: '{project}'
145           branch: '{branch}'
146           files: 'doctor_tests/**'
147
148     builders:
149       - shell: |
150          #!/bin/bash
151          # we do nothing here as the main stuff will be done
152          # in phase jobs
153          echo "Triggering phase jobs!"
154       - multijob:
155           name: 'doctor-verify-apex-inspector'
156           execution-type: PARALLEL
157           projects:
158             - name: 'doctor-{task}-apex-{inspector}-build-x86_64-{stream}'
159               current-parameters: false
160               predefined-parameters: |
161                 GERRIT_BRANCH=$GERRIT_BRANCH
162                 GERRIT_REFSPEC=$GERRIT_REFSPEC
163                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
164                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
165               git-revision: true
166               node-parameters: false
167               kill-phase-on: FAILURE
168               abort-all-job: false
169       - multijob:
170           name: 'doctor-verify-fuel-inspector'
171           execution-type: PARALLEL
172           projects:
173             - name: 'doctor-{task}-fuel-{inspector}-build-x86_64-{stream}'
174               current-parameters: false
175               predefined-parameters: |
176                 GERRIT_BRANCH=$GERRIT_BRANCH
177                 GERRIT_REFSPEC=$GERRIT_REFSPEC
178                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
179                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
180               git-revision: true
181               node-parameters: false
182               kill-phase-on: FAILURE
183               abort-all-job: false
184       - multijob:
185           name: 'doctor-verify-fuel-inspector'
186           execution-type: PARALLEL
187           projects:
188             - name: 'doctor-{task}-fuel-{inspector}-build-aarch64-{stream}'
189               current-parameters: false
190               predefined-parameters: |
191                 GERRIT_BRANCH=$GERRIT_BRANCH
192                 GERRIT_REFSPEC=$GERRIT_REFSPEC
193                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
194                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
195               git-revision: true
196               node-parameters: false
197               kill-phase-on: FAILURE
198               abort-all-job: false
199
200 - job-template:
201     name: 'doctor-{task}-{installer}-{inspector}-{phase}-{stream}'
202     disabled: '{obj:disabled}'
203     node: '{slave-label}'
204     wrappers:
205       - ssh-agent-wrapper
206       - build-timeout:
207           timeout: 30
208     parameters:
209       - project-parameter:
210           project: '{project}'
211           branch: '{branch}'
212       - '{installer}-defaults'
213       - '{slave-label}-defaults'
214       - 'doctor-parameter'
215       - 'doctor-functest-parameter'
216     scm:
217       - git-scm-gerrit
218     builders:
219       - 'doctor-verify-installer-inspector-builders-macro'
220     publishers:
221       - 'doctor-verify-publishers-macro'
222
223
224 # -------------------------------
225 # parameter macros
226 # -------------------------------
227 - parameter:
228     name: 'doctor-parameter'
229     parameters:
230       - string:
231           name: OS_CREDS
232           default: /home/jenkins/openstack.creds
233           description: 'OpenStack credentials'
234       - string:
235           name: DOCKER_TAG
236           default: '{docker-tag}'
237           description: 'Tag to pull docker image'
238       - string:
239           name: CLEAN_DOCKER_IMAGES
240           default: 'false'
241           description: 'Remove downloaded docker images (opnfv/functest:*)'
242       - string:
243           name: DEPLOY_SCENARIO
244           default: 'os-nosdn-nofeature-ha'
245           description: 'Scenario to deploy and test'
246
247 - parameter:
248     name: 'doctor-functest-parameter'
249     parameters:
250       # functest-suite-parameter
251       - string:
252           name: FUNCTEST_MODE
253           default: 'testcase'
254       - string:
255           name: FUNCTEST_SUITE_NAME
256           default: 'doctor-notification'
257       - string:
258           name: TESTCASE_OPTIONS
259           # yamllint disable rule:line-length
260           default: '-e INSPECTOR_TYPE={inspector} -v $WORKSPACE:/home/opnfv/repos/doctor'
261           # yamllint enable rule:line-length
262           description: 'Addtional parameters specific to test case(s)'
263       # functest-parameter
264       - string:
265           name: GS_PATHNAME
266           default: '{gs-pathname}'
267           # yamllint disable rule:line-length
268           description: "Version directory where the opnfv documents will be stored in gs repository"
269           # yamllint enable rule:line-length
270       - string:
271           name: FUNCTEST_REPO_DIR
272           default: "/home/opnfv/repos/functest"
273           description: "Directory where the Functest repository is cloned"
274       - string:
275           name: PUSH_RESULTS_TO_DB
276           default: "true"
277           description: "Push the results of all the tests to the resultDB"
278       - string:
279           name: CI_DEBUG
280           default: 'true'
281           description: "Show debug output information"
282 # -------------------------------
283 # builder macros
284 # -------------------------------
285
286 - builder:
287     name: 'doctor-verify-unit-test-builders-macro'
288     builders:
289       - shell: "tox -e pep8"
290
291 - builder:
292     name: 'doctor-verify-installer-inspector-builders-macro'
293     builders:
294       - 'clean-workspace-log'
295       # yamllint disable rule:line-length
296       - shell: |
297           # NOTE: Create symbolic link, so that we can archive file outside
298           #       of $WORKSPACE .
299           # NOTE: We are printing all logs under 'tests/' during test run,
300           #       so this symbolic link should not be in 'tests/'. Otherwise,
301           #       we'll have the same log twice in jenkins console log.
302           ln -sfn $HOME/opnfv/functest/results/{stream} functest_results
303           # NOTE: Get functest script in $WORKSPACE. This functest script is
304           #       needed to perform VM image download in set-functest-env.sh
305           #       from E release cycle.
306           mkdir -p functest/ci
307           wget https://git.opnfv.org/functest/plain/functest/ci/download_images.sh -O functest/ci/download_images.sh
308       - 'functest-suite-builder'
309       - shell: |
310           functest_log="$HOME/opnfv/functest/results/{stream}/$FUNCTEST_SUITE_NAME.log"
311           # NOTE: checking the test result, as the previous job could return
312           #       0 regardless the result of doctor test scenario.
313           grep -e 'doctor test successfully' $functest_log || exit 1
314       # yamllint enable rule:line-length
315
316 # -------------------------------
317 # publisher macros
318 # -------------------------------
319 - publisher:
320     name: 'doctor-verify-publishers-macro'
321     publishers:
322       - archive:
323           artifacts: 'doctor_tests/*.log'
324       - archive:
325           artifacts: 'functest_results/$FUNCTEST_SUITE_NAME.log'
326       - email-jenkins-admins-on-failure
327
328 - publisher:
329     name: 'doctor-verify-unit-test-publishers-macro'
330     publishers:
331       - email-jenkins-admins-on-failure
332       - archive:
333           artifacts: '.tox/'
334
335
336 #####################################
337 # trigger macros
338 #####################################
339 - trigger:
340     name: 'doctor-verify'
341     triggers:
342       - gerrit:
343           server-name: 'gerrit.opnfv.org'
344           trigger-on:
345             - patchset-created-event:
346                 exclude-drafts: 'false'
347                 exclude-trivial-rebase: 'false'
348                 exclude-no-code-change: 'false'
349             - draft-published-event
350             - comment-added-contains-event:
351                 comment-contains-value: 'recheck'
352             - comment-added-contains-event:
353                 comment-contains-value: 'reverify'
354           projects:
355             - project-compare-type: 'ANT'
356               project-pattern: '{project}'
357               branches:
358                 - branch-compare-type: 'ANT'
359                   branch-pattern: '**/{branch}'
360               file-paths:
361                 - compare-type: ANT
362                   pattern: '{files}'
363           skip-vote:
364             successful: true
365             failed: true
366             unstable: true
367             notbuilt: true