Automate result management in CI
[releng.git] / jjb / functest / functest.yml
1 ###################################
2 # job configuration for functest
3 ###################################
4 - project:
5     name: functest
6
7     pod:
8         - 'opnfv-jump-1'
9         - 'opnfv-jump-2'
10     jobs:
11         - 'functest-{pod}'
12         - 'set-functest-env-{pod}'
13         - 'clean-functest-env-{pod}'
14         - 'functest-openstack-bench-test-{pod}'
15         - 'functest-openstack-tempest-smoke-test-{pod}'
16         - 'functest-odl-test-{pod}'
17         - 'functest-vims-test-{pod}'
18         - 'functest-vping-test-{pod}'
19         - 'functest-daily-master'
20         - 'functest-merge'
21         - 'functest-verify-{stream}'
22
23     # stream:    branch with - in place of / (eg. stable-arno)
24     # branch:    branch (eg. stable/arno)
25     stream:
26         - master:
27             branch: 'master'
28         - stable-arno:
29             branch: 'stable/arno'
30
31     project: 'functest'
32     somevar: 'foo'
33 ################################
34 # job template
35 ################################
36 - job-template:
37     name: set-functest-env-{pod}
38
39     project-type: freestyle
40
41     node: '{pod}'
42
43     logrotate:
44         daysToKeep: 30
45         numToKeep: 10
46         artifactDaysToKeep: -1
47         artifactNumToKeep: -1
48
49     builders:
50         - shell: |
51             #!/bin/bash
52             set +e
53
54             echo "Functest: prepare Functest environment"
55             mkdir -p $HOME/functest/
56             source $HOME/functest/opnfv-openrc.sh
57
58             # WORKSPACE is the root of the functest repo
59             # go into WORKSPACE where the functest repo is cloned
60             cd $WORKSPACE
61
62             # prepare
63             echo "Functest: prepare Functest environment"
64             python $WORKSPACE/testcases/config_functest.py --debug $WORKSPACE/ start
65             
66 - job-template:
67     name: clean-functest-env-{pod}
68
69     project-type: freestyle
70
71     node: '{pod}'
72
73     logrotate:
74         daysToKeep: 30
75         numToKeep: 10
76         artifactDaysToKeep: -1
77         artifactNumToKeep: -1
78
79     builders:
80         - shell: |
81             #!/bin/bash
82             set +e
83
84             # collect results
85             echo "Functest: copy results and clean Functest environment"
86             mkdir -p $HOME/functest/results
87
88             # save ODL results
89             cp -Rf $WORSPACE/testcases/Controllers/ODL/CI/logs $HOME/functest/results/ODL
90
91             # save tempest.conf for further troubleshooting
92             cp $HOME/.rally/tempest/for-deployment-*/tempest.conf $HOME/functest/results
93
94             # cleanup
95             python $WORKSPACE/testcases/config_functest.py --debug --force $WORKSPACE/ clean
96
97 - job-template:
98     name: functest-openstack-bench-test-{pod}
99
100     project-type: freestyle
101
102     node: '{pod}'
103
104     logrotate:
105         daysToKeep: 30
106         numToKeep: 10
107         artifactDaysToKeep: -1
108         artifactNumToKeep: -1
109
110     builders:
111         - shell: |
112             #!/bin/bash
113             set +e
114
115             echo "Functest: run Functest Rally Bench suites"
116             python $WORKSPACE/testcases/VIM/OpenStack/CI/libraries/run_rally.py --debug $WORKSPACE/ all
117
118 - job-template:
119     name: functest-openstack-tempest-smoke-test-{pod}
120
121     project-type: freestyle
122
123     node: '{pod}'
124
125     logrotate:
126         daysToKeep: 30
127         numToKeep: 10
128         artifactDaysToKeep: -1
129         artifactNumToKeep: -1
130
131     builders:
132         - shell: |
133             #!/bin/bash
134             set +e
135
136             # tempest
137             echo "Functest: run Tempest suite"
138             rally verify start smoke
139             rally verify list
140
141 - job-template:
142     name: functest-odl-test-{pod}
143
144     project-type: freestyle
145
146     node: '{pod}'
147
148     logrotate:
149         daysToKeep: 30
150         numToKeep: 10
151         artifactDaysToKeep: -1
152         artifactNumToKeep: -1
153
154     builders:
155         - shell: |
156             #!/bin/bash
157             set +e
158
159             echo "Functest: run ODL suite"
160             $WORKSPACE/testcases/Controllers/ODL/CI/start_tests.sh
161
162 - job-template:
163     name: functest-vims-test-{pod}
164
165     project-type: freestyle
166
167     node: '{pod}'
168
169     logrotate:
170         daysToKeep: 30
171         numToKeep: 10
172         artifactDaysToKeep: -1
173         artifactNumToKeep: -1
174
175     builders:
176         - shell: |
177             echo "put your CI scenario here"
178
179
180 - job-template:
181     name: functest-vping-test-{pod}
182
183     project-type: freestyle
184
185     node: '{pod}'
186
187     logrotate:
188         daysToKeep: 30
189         numToKeep: 10
190         artifactDaysToKeep: -1
191         artifactNumToKeep: -1
192
193     builders:
194         - shell: |
195             #!/bin/bash
196             set +e
197
198             # vPing
199             echo "Functest: run vPing"
200             python $WORKSPACE/testcases/vPing/CI/libraries/vPing.py --debug $WORKSPACE/
201
202 - job-template:
203     name: functest-{pod}
204
205     project-type: freestyle
206
207     node: '{pod}'
208
209     parameters:
210         - project-parameter:
211             project: '{project}'
212
213     scm:
214         - git-scm:
215             credentials-id: '{ssh-credentials}'
216             refspec: ''
217             branch: master
218
219     logrotate:
220         daysToKeep: 30
221         numToKeep: 10
222         artifactDaysToKeep: -1
223         artifactNumToKeep: -1
224
225     builders:
226         - 'functest-all'
227
228 - job-template:
229     name: 'functest-daily-master'
230
231     node: master
232
233     # Job template for daily builders
234     #
235     # Required Variables:
236     #     stream:    branch with - in place of / (eg. stable)
237     #     branch:    branch (eg. stable)
238
239     project-type: freestyle
240     varsetabove: '{somevar}'
241
242     logrotate:
243         daysToKeep: '{build-days-to-keep}'
244         numToKeep: '{build-num-to-keep}'
245         artifactDaysToKeep: '{build-artifact-days-to-keep}'
246         artifactNumToKeep: '{build-artifact-num-to-keep}'
247
248     parameters:
249         - project-parameter:
250             project: '{project}'
251
252     scm:
253         - git-scm:
254             credentials-id: '{ssh-credentials}'
255             refspec: ''
256             branch: master
257
258     wrappers:
259         - ssh-agent-credentials:
260             user: '{ssh-credentials}'
261
262     triggers:
263         - timed: 'H H * * *'
264
265     prebuilders:
266         - test-macro
267
268     builders:
269         - shell:
270             !include-raw docu-build.sh
271
272     postbuilders:
273         - test-macro
274
275 - job-template:
276     name: 'functest-verify-{stream}'
277
278     node: master
279
280     project-type: freestyle
281
282     logrotate:
283         daysToKeep: 30
284         numToKeep: 10
285         artifactDaysToKeep: -1
286         artifactNumToKeep: -1
287
288     parameters:
289         - project-parameter:
290             project: '{project}'
291         - gerrit-parameter:
292             branch: '{branch}'
293     scm:
294         - gerrit-trigger-scm:
295             credentials-id: '{ssh-credentials}'
296             refspec: '$GERRIT_REFSPEC'
297             choosing-strategy: 'gerrit'
298
299     wrappers:
300         - ssh-agent-credentials:
301             user: '{ssh-credentials}'
302
303     triggers:
304         - gerrit:
305             trigger-on:
306                 - patchset-created-event:
307                     exclude-drafts: 'false'
308                     exclude-trivial-rebase: 'false'
309                     exclude-no-code-change: 'false'
310                 - draft-published-event
311                 - comment-added-contains-event:
312                     comment-contains-value: 'recheck'
313                 - comment-added-contains-event:
314                     comment-contains-value: 'reverify'
315             projects:
316               - project-compare-type: 'ANT'
317                 project-pattern: 'functest'
318                 branches:
319                   - branch-compare-type: 'ANT'
320                     branch-pattern: '**/{branch}'
321
322     builders:
323         - shell:
324             !include-raw docu-build.sh
325
326 - job-template:
327     name: 'functest-merge'
328
329     node: master
330
331     # builder-merge job to run JJB update
332     #
333     # This job's purpose is to update all the JJB
334
335     project-type: freestyle
336
337     logrotate:
338         daysToKeep: 30
339         numToKeep: 40
340         artifactDaysToKeep: -1
341         artifactNumToKeep: 5
342
343     parameters:
344         - project-parameter:
345             project: '{project}'
346         - gerrit-parameter:
347             branch: 'master'
348
349     scm:
350         - gerrit-trigger-scm:
351             credentials-id: '{ssh-credentials}'
352             refspec: ''
353             choosing-strategy: 'default'
354
355     wrappers:
356         - ssh-agent-credentials:
357             user: '{ssh-credentials}'
358
359     triggers:
360         - gerrit:
361             trigger-on:
362                 - change-merged-event
363                 - comment-added-contains-event:
364                     comment-contains-value: 'remerge'
365             projects:
366               - project-compare-type: 'ANT'
367                 project-pattern: 'functest'
368                 branches:
369                     - branch-compare-type: 'ANT'
370                       branch-pattern: '**/master'
371
372     builders:
373         - shell:
374             !include-raw docu-build.sh
375
376 # macros
377 - builder:
378     name: functest-all
379     builders:
380         - shell: |
381             #!/bin/bash
382             set +e
383
384             echo "Functest: prepare Functest environment"
385             mkdir -p $HOME/functest/
386             source $HOME/functest/opnfv-openrc.sh
387
388             # WORKSPACE is the root of the functest repo
389             # go into WORKSPACE where the functest repo is cloned
390             cd $WORKSPACE
391
392             # prepare
393             echo "Functest: prepare Functest environment"
394             python $WORKSPACE/testcases/config_functest.py --debug $WORKSPACE/ start
395
396             # vPing
397             echo "Functest: run vPing"
398             python $WORKSPACE/testcases/vPing/CI/libraries/vPing.py --debug $WORKSPACE/
399
400             # ODL
401             echo "Functest: run ODL suite"
402             $WORKSPACE/testcases/Controllers/ODL/CI/start_tests.sh
403
404             # rally
405             echo "Functest: run Functest Rally Bench suites"
406             python $WORKSPACE/testcases/VIM/OpenStack/CI/libraries/run_rally.py --debug $WORKSPACE/ all
407
408             # tempest
409             echo "Functest: run Tempest suite"
410             rally verify start smoke
411             rally verify list
412
413             # collect results
414             echo "Functest: copy results and clean Functest environment"
415             mkdir -p $HOME/functest/results
416
417             # save ODL results
418             cp -Rf $WORSPACE/testcases/Controllers/ODL/CI/logs $HOME/functest/results/ODL
419
420             # save tempest.conf for further troubleshooting
421             cp $HOME/.rally/tempest/for-deployment-*/tempest.conf $HOME/functest/results
422             
423             # push results to artifact
424             !include-raw res-build.sh
425
426             # cleanup
427             python $WORKSPACE/testcases/config_functest.py --debug --force $WORKSPACE/ clean