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