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