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