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