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