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