Merge "VNFM with ETSI FEAT03 changes"
[releng.git] / jjb / functest / xtesting.yaml
1 ---
2 - xtesting-jobs: &xtesting-jobs
3     name: 'xtesting-jobs'
4     current-parameters: true
5
6 - xtesting-params: &xtesting-params
7     name: 'xtesting-params'
8     repo: 'opnfv'
9     port:
10     tag:
11       - latest:
12           branch: master
13           slave: lf-virtual1
14       - jerma:
15           branch: stable/jerma
16           slave: lf-virtual1
17       - iruya:
18           branch: stable/iruya
19           slave: lf-virtual1
20       - hunter:
21           branch: stable/hunter
22           slave: lf-virtual1
23
24 - parameter:
25     name: xtesting-slave
26     parameters:
27       - label:
28           name: slave
29           default: '{slave}'
30
31 - parameter:
32     name: xtesting-build_tag
33     parameters:
34       - random-string:
35           name: build_tag
36
37 - parameter:
38     name: xtesting-branch
39     parameters:
40       - string:
41           name: branch
42           default: '{branch}'
43
44 - parameter:
45     name: xtesting-DEBUG
46     parameters:
47       - string:
48           name: DEBUG
49           default: 'true'
50
51 - xtesting-containers: &xtesting-containers
52     name: 'xtesting-containers'
53     repo: '{repo}'
54     port: '{port}'
55     container: '{container}'
56     tag: '{tag}'
57
58 - xtesting-run-containers: &xtesting-run-containers
59     name: 'xtesting-run-containers'
60     <<: *xtesting-containers
61     test: '{test}'
62
63 - builder:
64     name: xtesting-pull-containers
65     builders:
66       - shell: |
67           set +x
68           if [ "{repo}" = "_" ]; then
69             image={container}:{tag}
70           elif [ "{port}" = "None" ]; then
71             image={repo}/{container}:{tag}
72           else
73             image={repo}:{port}/{container}:{tag}
74           fi
75           sudo docker pull $image
76
77 - builder:
78     name: xtesting-run-containers
79     builders:
80       - shell: |
81           set +x
82           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/* || true
83           if [ "{repo}" = "_" ]; then
84             image={container}:{tag}
85           elif [ "{port}" = "None" ]; then
86             image={repo}/{container}:{tag}
87           else
88             image={repo}:{port}/{container}:{tag}
89           fi
90           sudo docker run --rm \
91             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
92             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
93             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
94             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
95             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
96             -e NODE_NAME=$slave \
97             -e BUILD_TAG=$BUILD_TAG \
98             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
99             -e DEBUG=$DEBUG \
100             -v /home/opnfv/xtesting/.boto:/root/.boto \
101             $image run_tests -t {test} -p -r
102
103 - builder:
104     name: xtesting-remove-images
105     builders:
106       - shell: |
107           set +x
108           if [ "{repo}" = "_" ]; then
109             image={container}:{tag}
110           elif [ "{port}" = "None" ]; then
111             image={repo}/{container}:{tag}
112           else
113             image={repo}:{port}/{container}:{tag}
114           fi
115           sudo docker rmi $image || true
116
117 - xtesting-build-containers: &xtesting-build-containers
118     name: 'xtesting-build-containers'
119     <<: *xtesting-containers
120     ref_arg: '{ref_arg}'
121     path: '{path}'
122
123 - builder:
124     name: xtesting-build-containers
125     builders:
126       - shell: |
127           set +x
128           if [ "{repo}" = "_" ]; then
129             image={container}:{tag}
130           elif [ "{port}" = "None" ]; then
131             image={repo}/{container}:{tag}
132           else
133             image={repo}:{port}/{container}:{tag}
134           fi
135           if [ "{ref_arg}" = "None" ]; then
136             build_arg=""
137           else
138             build_arg="--build-arg {ref_arg}={ref}"
139           fi
140           cd {path}
141           sudo docker build $build_arg \
142             --pull=false --no-cache --force-rm=true \
143             -t $image .
144
145 - scm:
146     name: xtesting-scm
147     scm:
148       - git:
149           url: https://gerrit.opnfv.org/gerrit/functest-xtesting
150           refspec: '+refs/changes/*:refs/changes/*'
151           branches:
152             - '{ref}'
153
154 - job-template:
155     name: 'xtesting-{repo}-{container}-{tag}-pull'
156     parameters:
157       - xtesting-slave:
158           slave: '{slave}'
159     builders:
160       - xtesting-pull-containers:
161           <<: *xtesting-containers
162
163 - project:
164     name: 'xtesting-opnfv-xtesting-pull'
165     <<: *xtesting-params
166     container: 'xtesting'
167     jobs:
168       - 'xtesting-{repo}-{container}-{tag}-pull'
169
170 - job-template:
171     name: 'xtesting-{repo}-{container}-{tag}-rmi'
172     parameters:
173       - xtesting-slave:
174           slave: '{slave}'
175     builders:
176       - xtesting-remove-images:
177           <<: *xtesting-containers
178
179 - project:
180     name: 'xtesting-opnfv-xtesting-rmi'
181     <<: *xtesting-params
182     container: 'xtesting'
183     jobs:
184       - 'xtesting-{repo}-{container}-{tag}-rmi'
185
186 - job-template:
187     name: 'xtesting-{repo}-{container}-{tag}-{test}-run'
188     parameters:
189       - xtesting-slave:
190           slave: '{slave}'
191       - xtesting-build_tag:
192           build_tag: ''
193       - xtesting-DEBUG:
194           DEBUG: 'true'
195     builders:
196       - xtesting-run-containers:
197           <<: *xtesting-run-containers
198
199 - project:
200     name: 'xtesting-opnfv-xtesting'
201     <<: *xtesting-params
202     container: 'xtesting'
203     test:
204       - first
205       - second
206       - third
207       - fourth
208       - fifth
209       - sixth
210     exclude:
211       - tag: hunter
212         test: sixth
213       - tag: iruya
214         test: sixth
215     jobs:
216       - 'xtesting-{repo}-{container}-{tag}-{test}-run'
217
218
219 - builder:
220     name: xtesting-zip
221     builders:
222       - shell: |
223           set +x
224           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/* || true
225           if [ "{repo}" = "_" ]; then
226             image={container}:{tag}
227           elif [ "{port}" = "None" ]; then
228             image={repo}/{container}:{tag}
229           else
230             image={repo}:{port}/{container}:{tag}
231           fi
232           sudo docker run --rm \
233             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
234             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
235             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
236             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
237             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
238             -e BUILD_TAG=$BUILD_TAG \
239             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
240             -e DEBUG=$DEBUG \
241             -v /home/opnfv/xtesting/.boto:/root/.boto \
242             $image zip_campaign
243
244 - job-template:
245     name: 'xtesting-{tag}-zip'
246     parameters:
247       - xtesting-slave:
248           slave: '{slave}'
249       - xtesting-build_tag:
250           build_tag: ''
251       - xtesting-DEBUG:
252           DEBUG: 'true'
253     builders:
254       - xtesting-zip:
255           <<: *xtesting-containers
256
257 - project:
258     name: 'xtesting-{tag}-zip'
259     <<: *xtesting-params
260     container: 'xtesting'
261     jobs:
262       - 'xtesting-{tag}-zip'
263
264 - job-template:
265     name: 'xtesting-{tag}-daily'
266     project-type: multijob
267     triggers:
268       - timed: '@daily'
269     parameters:
270       - xtesting-slave:
271           slave: '{slave}'
272       - xtesting-build_tag:
273           build_tag: ''
274       - xtesting-DEBUG:
275           DEBUG: 'true'
276     properties:
277       - build-blocker:
278           use-build-blocker: true
279           blocking-level: 'NODE'
280           blocking-jobs:
281             - '^xtesting-{tag}-(daily|check|gate)$'
282     builders:
283       - multijob:
284           name: remove former images
285           projects:
286             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
287               <<: *xtesting-jobs
288       - multijob:
289           name: pull containers
290           projects:
291             - name: 'xtesting-opnfv-xtesting-{tag}-pull'
292               <<: *xtesting-jobs
293       - multijob:
294           name: opnfv/xtesting:{tag}
295           projects:
296             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
297               <<: *xtesting-jobs
298             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
299               <<: *xtesting-jobs
300             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
301               <<: *xtesting-jobs
302             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
303               <<: *xtesting-jobs
304             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
305               <<: *xtesting-jobs
306             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
307               <<: *xtesting-jobs
308       - multijob:
309           name: dump all campaign data
310           projects:
311             - name: 'xtesting-{tag}-zip'
312               <<: *xtesting-jobs
313
314 - job-template:
315     name: 'xtesting-{repo}-{container}-{tag}-gate'
316     parameters:
317       - xtesting-slave:
318           slave: '{slave}'
319     scm:
320       - xtesting-scm:
321           ref: $GERRIT_REFSPEC
322     builders:
323       - xtesting-build-containers:
324           <<: *xtesting-build-containers
325           ref: $GERRIT_REFSPEC
326
327 - job-template:
328     name: 'xtesting-{repo}-{container}-{tag}-check'
329     parameters:
330       - xtesting-slave:
331           slave: '{slave}'
332       - xtesting-branch:
333           branch: '{branch}'
334     scm:
335       - xtesting-scm:
336           ref: $branch
337     builders:
338       - xtesting-build-containers:
339           <<: *xtesting-build-containers
340           ref: $branch
341
342 - project:
343     name: 'xtesting-_-alpine-3.11-rmi'
344     repo: _
345     port:
346     container: alpine
347     tag: '3.11'
348     slave: master
349     jobs:
350       - 'xtesting-{repo}-{container}-{tag}-rmi'
351
352 - project:
353     name: 'xtesting-_-alpine-3.11-pull'
354     repo: _
355     port:
356     container: alpine
357     tag: '3.11'
358     slave: master
359     jobs:
360       - 'xtesting-{repo}-{container}-{tag}-pull'
361
362 - project:
363     name: xtesting-opnfv-xtesting-{tag}-build
364     <<: *xtesting-params
365     container: xtesting
366     ref_arg: BRANCH
367     path: docker
368     jobs:
369       - 'xtesting-{repo}-{container}-{tag}-gate'
370       - 'xtesting-{repo}-{container}-{tag}-check'
371
372 - job-template:
373     name: 'xtesting-{tag}-check'
374     project-type: multijob
375     parameters:
376       - xtesting-slave:
377           slave: '{slave}'
378       - xtesting-build_tag:
379           build_tag: ''
380       - xtesting-branch:
381           branch: '{branch}'
382       - xtesting-DEBUG:
383           DEBUG: 'true'
384     properties:
385       - build-blocker:
386           use-build-blocker: true
387           blocking-level: 'NODE'
388           blocking-jobs:
389             - '^xtesting-{tag}-(daily|check|gate)$'
390     builders:
391       - multijob:
392           name: remove former images
393           projects:
394             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
395               <<: *xtesting-jobs
396       - multijob:
397           name: remove dependencies
398           projects:
399             - name: 'xtesting-_-alpine-3.11-rmi'
400               <<: *xtesting-jobs
401       - multijob:
402           name: pull dependencies
403           projects:
404             - name: 'xtesting-_-alpine-3.11-pull'
405               <<: *xtesting-jobs
406       - multijob:
407           name: opnfv/xtesting
408           projects:
409             - name: 'xtesting-opnfv-xtesting-{tag}-check'
410               <<: *xtesting-jobs
411       - multijob:
412           name: opnfv/xtesting:{tag}
413           projects:
414             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
415               <<: *xtesting-jobs
416             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
417               <<: *xtesting-jobs
418             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
419               <<: *xtesting-jobs
420             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
421               <<: *xtesting-jobs
422             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
423               <<: *xtesting-jobs
424             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
425               <<: *xtesting-jobs
426
427 - trigger:
428     name: xtesting-patchset-created
429     triggers:
430       - gerrit:
431           server-name: 'gerrit.opnfv.org'
432           trigger-on:
433             - patchset-created-event
434             - comment-added-contains-event:
435                 comment-contains-value: 'recheck'
436             - comment-added-contains-event:
437                 comment-contains-value: 'reverify'
438           projects:
439             - project-compare-type: 'ANT'
440               project-pattern: 'functest-xtesting'
441               branches:
442                 - branch-compare-type: 'ANT'
443                   branch-pattern: '**/{branch}'
444           skip-vote:
445             successful: false
446             failed: false
447             unstable: false
448             notbuilt: false
449
450 - job-template:
451     name: 'xtesting-{tag}-gate'
452     project-type: multijob
453     triggers:
454       - xtesting-patchset-created:
455           branch: '{branch}'
456     parameters:
457       - xtesting-slave:
458           slave: '{slave}'
459       - xtesting-build_tag:
460           build_tag: ''
461       - xtesting-DEBUG:
462           DEBUG: 'true'
463     properties:
464       - build-blocker:
465           use-build-blocker: true
466           blocking-level: 'NODE'
467           blocking-jobs:
468             - '^xtesting-{tag}-(daily|check|gate)$'
469     builders:
470       - multijob:
471           name: remove former images
472           projects:
473             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
474               <<: *xtesting-jobs
475       - multijob:
476           name: remove dependencies
477           projects:
478             - name: 'xtesting-_-alpine-3.11-rmi'
479               <<: *xtesting-jobs
480       - multijob:
481           name: pull dependencies
482           projects:
483             - name: 'xtesting-_-alpine-3.11-pull'
484               <<: *xtesting-jobs
485       - multijob:
486           name: opnfv/xtesting
487           projects:
488             - name: 'xtesting-opnfv-xtesting-{tag}-gate'
489               <<: *xtesting-jobs
490       - multijob:
491           name: opnfv/xtesting:{tag}
492           projects:
493             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
494               <<: *xtesting-jobs
495             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
496               <<: *xtesting-jobs
497             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
498               <<: *xtesting-jobs
499             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
500               <<: *xtesting-jobs
501             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
502               <<: *xtesting-jobs
503             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
504               <<: *xtesting-jobs
505
506 - project:
507     name: 'xtesting'
508     <<: *xtesting-params
509     jobs:
510       - 'xtesting-{tag}-daily'
511       - 'xtesting-{tag}-check'
512       - 'xtesting-{tag}-gate'
513
514 - view:
515     name: xtesting
516     view-type: list
517     columns:
518       - status
519       - weather
520       - job
521       - last-success
522       - last-failure
523       - last-duration
524     regex: ^xtesting-[a-z]+-(daily|check|gate)$