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