Merge "Add dependencies to Ubuntu Builders"
[releng.git] / jjb / doctor / doctor.yaml
1 ---
2 - project:
3     name: doctor
4
5     project: '{name}'
6     project-name: '{name}'
7     project-pattern: '{project}'
8
9     rtd-build-url: 'https://readthedocs.org/api/v2/webhook/opnfv-doctor/47214/'
10     rtd-token: '13264f62c1a044e39e9aed22a0dc1853d5a0b196'
11
12     stream:
13       - master:
14           branch: '{stream}'
15           gs-pathname: ''
16           disabled: false
17       - fraser: &fraser
18           branch: 'stable/{stream}'
19           gs-pathname: '/{stream}'
20           disabled: false
21
22     installer:
23       - 'apex'
24       - 'fuel'
25       - 'daisy'
26
27     arch:
28       - 'x86_64'
29       - 'aarch64'
30
31     inspector:
32       - 'sample'
33       - 'congress'
34
35     exclude:
36       - installer: 'apex'
37         arch: 'aarch64'
38       - installer: 'daisy'
39         arch: 'aarch64'
40       # disabling the following tests due to limitation of PoD owners
41       # these would beenabled again once the PoDs are ready
42       - installer: 'fuel'
43         arch: 'x86_64'
44
45     jobs:
46       - 'doctor-verify-{stream}'
47       - 'doctor-verify-fault_management-{installer}-{inspector}-{arch}-{stream}'
48       - 'doctor-verify-maintenance-{installer}-{inspector}-{arch}-{stream}'
49       - 'doctor-verify-all-{installer}-{inspector}-{arch}-{stream}'
50       - '{project-name}-rtd-jobs'
51
52 - job-template:
53     name: 'doctor-verify-{stream}'
54     disabled: '{obj:disabled}'
55     project-type: 'multijob'
56     parameters:
57       - project-parameter:
58           project: '{project}'
59           branch: '{branch}'
60       - 'doctor-slave-parameter'
61     scm:
62       - git-scm-gerrit
63     triggers:
64       - 'doctor-verify':
65           project: '{project}'
66           branch: '{branch}'
67           files: 'doctor_tests/**'
68
69     builders:
70       - shell: |
71          #!/bin/bash
72          # we do nothing here as the main stuff will be done
73          # in phase jobs
74          echo "Triggering phase jobs!"
75       - multijob:
76           name: 'doctor-verify-sample'
77           execution-type: PARALLEL
78           projects:
79             - name: 'doctor-verify-fault_management-apex-sample-x86_64-{stream}'
80               predefined-parameters: |
81                 PROJECT=$PROJECT
82                 GERRIT_BRANCH=$GERRIT_BRANCH
83                 GERRIT_REFSPEC=$GERRIT_REFSPEC
84                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
85                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
86               kill-phase-on: FAILURE
87               git-revision: true
88             - name: 'doctor-verify-fault_management-daisy-sample-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               git-revision: true
97             - name: 'doctor-verify-maintenance-apex-sample-x86_64-{stream}'
98               predefined-parameters: |
99                 PROJECT=$PROJECT
100                 GERRIT_BRANCH=$GERRIT_BRANCH
101                 GERRIT_REFSPEC=$GERRIT_REFSPEC
102                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
103                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
104               kill-phase-on: FAILURE
105               git-revision: true
106       - multijob:
107           name: 'doctor-verify-congress'
108           execution-type: PARALLEL
109           projects:
110             - name: 'doctor-verify-fault_management-apex-congress-x86_64-{stream}'
111               predefined-parameters: |
112                 PROJECT=$PROJECT
113                 GERRIT_BRANCH=$GERRIT_BRANCH
114                 GERRIT_REFSPEC=$GERRIT_REFSPEC
115                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
116                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
117               kill-phase-on: FAILURE
118               git-revision: true
119       - multijob:
120           name: 'doctor-verify-sample-all'
121           execution-type: PARALLEL
122           # This would be for running all test cases with sample inspector
123       - multijob:
124           name: 'doctor-verify-congress-all'
125           execution-type: PARALLEL
126           # This would be for running all test cases with congress inspector
127
128 - job-template:
129     name: 'doctor-verify-fault_management-{installer}-{inspector}-{arch}-{stream}'
130     disabled: '{obj:disabled}'
131     node: 'doctor-{installer}-{arch}'
132     wrappers:
133       - ssh-agent-wrapper
134       - build-timeout:
135           timeout: 30
136     parameters:
137       - project-parameter:
138           project: '{project}'
139           branch: '{branch}'
140       - '{installer}-defaults'
141       - 'doctor-slave-parameter'
142       - 'doctor-parameter':
143           inspector: '{inspector}'
144           test_case: 'fault_management'
145     scm:
146       - git-scm-gerrit
147     builders:
148       - 'doctor-verify-installer-inspector-builders-macro'
149     publishers:
150       - 'doctor-verify-publishers-macro'
151
152 - job-template:
153     name: 'doctor-verify-maintenance-{installer}-{inspector}-{arch}-{stream}'
154     disabled: '{obj:disabled}'
155     node: 'nokia-pod1'
156     wrappers:
157       - ssh-agent-wrapper
158       - build-timeout:
159           timeout: 40
160     parameters:
161       - project-parameter:
162           project: '{project}'
163           branch: '{branch}'
164       - '{installer}-defaults'
165       - 'doctor-slave-parameter'
166       - 'doctor-parameter':
167           inspector: '{inspector}'
168           test_case: 'maintenance'
169     scm:
170       - git-scm-gerrit
171     builders:
172       - 'doctor-verify-installer-inspector-builders-macro'
173     publishers:
174       - 'doctor-verify-publishers-macro'
175
176 - job-template:
177     name: 'doctor-verify-all-{installer}-{inspector}-{arch}-{stream}'
178     disabled: '{obj:disabled}'
179     node: 'nokia-pod1'
180     wrappers:
181       - ssh-agent-wrapper
182       - build-timeout:
183           timeout: 50
184     parameters:
185       - project-parameter:
186           project: '{project}'
187           branch: '{branch}'
188       - '{installer}-defaults'
189       - 'doctor-slave-parameter'
190       - 'doctor-parameter':
191           inspector: '{inspector}'
192           test_case: 'all'
193     scm:
194       - git-scm-gerrit
195     builders:
196       - 'doctor-verify-installer-inspector-builders-macro'
197     publishers:
198       - 'doctor-verify-publishers-macro'
199
200
201 # -------------------------------
202 # parameter macros
203 # -------------------------------
204 - parameter:
205     name: 'doctor-parameter'
206     parameters:
207       - string:
208           name: INSPECTOR_TYPE
209           default: '{inspector}'
210           description: 'inspector component'
211       - string:
212           name: TEST_CASE
213           default: '{test_case}'
214           description: 'test case: all, fault_management or maintenance'
215
216
217 # -------------------------------
218 # builder macros
219 # -------------------------------
220
221 - builder:
222     name: 'doctor-verify-installer-inspector-builders-macro'
223     builders:
224       # yamllint disable rule:indentation
225       - shell:
226           !include-raw:
227               - ./doctor-env-presetup.sh
228               - ../../utils/fetch_os_creds.sh
229       - shell: |
230           # prepare the env for test
231           source $HOME/opnfv-openrc.sh
232           if [ -f $HOME/os_cacert ]; then
233               export OS_CACERT=$HOME/os_cacert
234           fi
235           source $HOME/opnfv-installer.sh
236
237           # run tox to trigger the test
238           # As Jenkins user, it has no permission to send ICMP package
239           sudo -E tox -e py34
240
241
242 # -------------------------------
243 # publisher macros
244 # -------------------------------
245 - publisher:
246     name: 'doctor-verify-publishers-macro'
247     publishers:
248       - archive:
249           artifacts: 'doctor_tests/*.log'
250       - email-jenkins-admins-on-failure
251       - workspace-cleanup
252
253 #####################################
254 # trigger macros
255 #####################################
256 - trigger:
257     name: 'doctor-verify'
258     triggers:
259       - gerrit:
260           server-name: 'gerrit.opnfv.org'
261           trigger-on:
262             - patchset-created-event:
263                 exclude-drafts: 'false'
264                 exclude-trivial-rebase: 'false'
265                 exclude-no-code-change: 'false'
266             - draft-published-event
267             - comment-added-contains-event:
268                 comment-contains-value: 'recheck'
269             - comment-added-contains-event:
270                 comment-contains-value: 'reverify'
271           projects:
272             - project-compare-type: 'ANT'
273               project-pattern: '{project}'
274               branches:
275                 - branch-compare-type: 'ANT'
276                   branch-pattern: '**/{branch}'
277               file-paths:
278                 - compare-type: ANT
279                   pattern: '{files}'
280           skip-vote:
281             successful: true
282             failed: true
283             unstable: true
284             notbuilt: true