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