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