bugfix: run doctor tests parallelly
[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-{inspector}-{stream}'
40       - 'doctor-verify-{installer}-{inspector}-{arch}-{stream}'
41
42 - job-template:
43     name: 'doctor-verify-{inspector}-{stream}'
44     disabled: '{obj:disabled}'
45     project-type: 'multijob'
46     parameters:
47       - project-parameter:
48           project: '{project}'
49           branch: '{branch}'
50       - 'doctor-slave-parameter'
51     scm:
52       - git-scm-gerrit
53     triggers:
54       - 'doctor-verify':
55           project: '{project}'
56           branch: '{branch}'
57           files: 'doctor_tests/**'
58
59     builders:
60       - shell: |
61          #!/bin/bash
62          # we do nothing here as the main stuff will be done
63          # in phase jobs
64          echo "Triggering phase jobs!"
65       - multijob:
66           name: 'doctor-verify'
67           execution-type: PARALLEL
68           projects:
69             - name: 'doctor-verify-apex-{inspector}-x86_64-{stream}'
70               predefined-parameters: |
71                 PROJECT=$PROJECT
72                 GERRIT_BRANCH=$GERRIT_BRANCH
73                 GERRIT_REFSPEC=$GERRIT_REFSPEC
74                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
75                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
76               kill-phase-on: FAILURE
77               git-revision: true
78             - name: 'doctor-verify-fuel-{inspector}-x86_64-{stream}'
79               predefined-parameters: |
80                 PROJECT=$PROJECT
81                 GERRIT_BRANCH=$GERRIT_BRANCH
82                 GERRIT_REFSPEC=$GERRIT_REFSPEC
83                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
84                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
85               kill-phase-on: FAILURE
86               git-revision: true
87             - name: 'doctor-verify-fuel-{inspector}-aarch64-{stream}'
88               predefined-parameters: |
89                 GERRIT_BRANCH=$GERRIT_BRANCH
90                 GERRIT_REFSPEC=$GERRIT_REFSPEC
91                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
92                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
93               kill-phase-on: FAILURE
94               git-revision: true
95             - name: 'doctor-verify-daisy-{inspector}-x86_64-{stream}'
96               predefined-parameters: |
97                 PROJECT=$PROJECT
98                 GERRIT_BRANCH=$GERRIT_BRANCH
99                 GERRIT_REFSPEC=$GERRIT_REFSPEC
100                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
101                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
102               kill-phase-on: FAILURE
103               git-revision: true
104
105 - job-template:
106     name: 'doctor-verify-{installer}-{inspector}-{arch}-{stream}'
107     disabled: '{obj:disabled}'
108     node: 'doctor-{installer}-{arch}'
109     wrappers:
110       - ssh-agent-wrapper
111       - build-timeout:
112           timeout: 30
113     parameters:
114       - project-parameter:
115           project: '{project}'
116           branch: '{branch}'
117       - '{installer}-defaults'
118       - 'doctor-slave-parameter'
119       - 'doctor-parameter'
120       - 'doctor-functest-parameter'
121     scm:
122       - git-scm-gerrit
123     builders:
124       - 'doctor-verify-installer-inspector-builders-macro'
125     publishers:
126       - 'doctor-verify-publishers-macro'
127
128
129 # -------------------------------
130 # parameter macros
131 # -------------------------------
132 - parameter:
133     name: 'doctor-parameter'
134     parameters:
135       - string:
136           name: OS_CREDS
137           default: /home/jenkins/openstack.creds
138           description: 'OpenStack credentials'
139       - string:
140           name: DOCKER_TAG
141           default: '{docker-tag}'
142           description: 'Tag to pull docker image'
143       - string:
144           name: CLEAN_DOCKER_IMAGES
145           default: 'false'
146           description: 'Remove downloaded docker images (opnfv/functest:*)'
147       - string:
148           name: DEPLOY_SCENARIO
149           default: 'os-nosdn-nofeature-ha'
150           description: 'Scenario to deploy and test'
151
152 - parameter:
153     name: 'doctor-functest-parameter'
154     parameters:
155       # functest-suite-parameter
156       - string:
157           name: FUNCTEST_MODE
158           default: 'testcase'
159       - string:
160           name: FUNCTEST_SUITE_NAME
161           default: 'doctor-notification'
162       - string:
163           name: TESTCASE_OPTIONS
164           # yamllint disable rule:line-length
165           default: '-e INSPECTOR_TYPE={inspector} -v $WORKSPACE:/home/opnfv/repos/doctor'
166           # yamllint enable rule:line-length
167           description: 'Addtional parameters specific to test case(s)'
168       # functest-parameter
169       - string:
170           name: GS_PATHNAME
171           default: '{gs-pathname}'
172           # yamllint disable rule:line-length
173           description: "Version directory where the opnfv documents will be stored in gs repository"
174           # yamllint enable rule:line-length
175       - string:
176           name: FUNCTEST_REPO_DIR
177           default: "/home/opnfv/repos/functest"
178           description: "Directory where the Functest repository is cloned"
179       - string:
180           name: PUSH_RESULTS_TO_DB
181           default: "true"
182           description: "Push the results of all the tests to the resultDB"
183       - string:
184           name: CI_DEBUG
185           default: 'true'
186           description: "Show debug output information"
187 # -------------------------------
188 # builder macros
189 # -------------------------------
190
191 - builder:
192     name: 'doctor-verify-installer-inspector-builders-macro'
193     builders:
194       - 'clean-workspace-log'
195       # yamllint disable rule:line-length
196       - shell: |
197           # NOTE: Create symbolic link, so that we can archive file outside
198           #       of $WORKSPACE .
199           # NOTE: We are printing all logs under 'tests/' during test run,
200           #       so this symbolic link should not be in 'tests/'. Otherwise,
201           #       we'll have the same log twice in jenkins console log.
202           ln -sfn $HOME/opnfv/functest/results/{stream} functest_results
203           # NOTE: Get functest script in $WORKSPACE. This functest script is
204           #       needed to perform VM image download in set-functest-env.sh
205           #       from E release cycle.
206           mkdir -p functest/ci
207           wget https://git.opnfv.org/functest/plain/functest/ci/download_images.sh -O functest/ci/download_images.sh
208       - 'functest-suite-builder'
209       - shell: |
210           functest_log="$HOME/opnfv/functest/results/{stream}/$FUNCTEST_SUITE_NAME.log"
211           # NOTE: checking the test result, as the previous job could return
212           #       0 regardless the result of doctor test scenario.
213           grep -e 'doctor test successfully' $functest_log || exit 1
214       # yamllint enable rule:line-length
215
216 # -------------------------------
217 # publisher macros
218 # -------------------------------
219 - publisher:
220     name: 'doctor-verify-publishers-macro'
221     publishers:
222       - archive:
223           artifacts: 'doctor_tests/*.log'
224       - archive:
225           artifacts: 'functest_results/$FUNCTEST_SUITE_NAME.log'
226       - email-jenkins-admins-on-failure
227
228
229 #####################################
230 # trigger macros
231 #####################################
232 - trigger:
233     name: 'doctor-verify'
234     triggers:
235       - gerrit:
236           server-name: 'gerrit.opnfv.org'
237           trigger-on:
238             - patchset-created-event:
239                 exclude-drafts: 'false'
240                 exclude-trivial-rebase: 'false'
241                 exclude-no-code-change: 'false'
242             - draft-published-event
243             - comment-added-contains-event:
244                 comment-contains-value: 'recheck'
245             - comment-added-contains-event:
246                 comment-contains-value: 'reverify'
247           projects:
248             - project-compare-type: 'ANT'
249               project-pattern: '{project}'
250               branches:
251                 - branch-compare-type: 'ANT'
252                   branch-pattern: '**/{branch}'
253               file-paths:
254                 - compare-type: ANT
255                   pattern: '{files}'
256           skip-vote:
257             successful: true
258             failed: true
259             unstable: true
260             notbuilt: true