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