Merge "Remove ericsson-build3 from Jenkins"
[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       - kali:
15           branch: stable/kali
16           slave: lf-virtual1
17       - jerma:
18           branch: stable/jerma
19           slave: lf-virtual1
20       - iruya:
21           branch: stable/iruya
22           slave: lf-virtual1
23       - hunter:
24           branch: stable/hunter
25           slave: lf-virtual1
26       - arm64-latest:
27           branch: master
28           slave: lf-virtual1
29       - arm64-kali:
30           branch: stable/kali
31           slave: lf-virtual1
32       - arm64-jerma:
33           branch: stable/jerma
34           slave: lf-virtual1
35       - arm64-iruya:
36           branch: stable/iruya
37           slave: lf-virtual1
38       - arm64-hunter:
39           branch: stable/hunter
40           slave: lf-virtual1
41
42 - parameter:
43     name: xtesting-slave
44     parameters:
45       - label:
46           name: slave
47           default: '{slave}'
48
49 - parameter:
50     name: xtesting-build_tag
51     parameters:
52       - random-string:
53           name: build_tag
54
55 - parameter:
56     name: xtesting-branch
57     parameters:
58       - string:
59           name: branch
60           default: '{branch}'
61
62 - parameter:
63     name: xtesting-DEBUG
64     parameters:
65       - string:
66           name: DEBUG
67           default: 'true'
68
69 - xtesting-containers: &xtesting-containers
70     name: 'xtesting-containers'
71     repo: '{repo}'
72     port: '{port}'
73     container: '{container}'
74     tag: '{tag}'
75
76 - xtesting-run-containers: &xtesting-run-containers
77     name: 'xtesting-run-containers'
78     <<: *xtesting-containers
79     test: '{test}'
80     privileged: '{privileged}'
81     network: '{network}'
82
83 - builder:
84     name: xtesting-pull-containers
85     builders:
86       - shell: |
87           set +x
88           if [ "{repo}" = "_" ]; then
89             image={container}:{tag}
90           elif [ "{port}" = "None" ]; then
91             image={repo}/{container}:{tag}
92           else
93             image={repo}:{port}/{container}:{tag}
94           fi
95           sudo docker pull $image
96
97 - builder:
98     name: xtesting-run-containers
99     builders:
100       - shell: |
101           set +x
102           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/* || true
103           if [ "{repo}" = "_" ]; then
104             image={container}:{tag}
105           elif [ "{port}" = "None" ]; then
106             image={repo}/{container}:{tag}
107           else
108             image={repo}:{port}/{container}:{tag}
109           fi
110           sudo docker run --rm \
111             --privileged={privileged} \
112             --network={network} \
113             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
114             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
115             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
116             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
117             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
118             -e NODE_NAME=$slave \
119             -e BUILD_TAG=$BUILD_TAG \
120             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
121             -e DEBUG=$DEBUG \
122             -v /home/opnfv/xtesting/.boto:/root/.boto \
123             $image run_tests -t {test} -p -r
124
125 - builder:
126     name: xtesting-remove-images
127     builders:
128       - shell: |
129           set +x
130           if [ "{repo}" = "_" ]; then
131             image={container}:{tag}
132           elif [ "{port}" = "None" ]; then
133             image={repo}/{container}:{tag}
134           else
135             image={repo}:{port}/{container}:{tag}
136           fi
137           sudo docker rmi $image || true
138
139 - xtesting-build-containers: &xtesting-build-containers
140     name: 'xtesting-build-containers'
141     <<: *xtesting-containers
142     ref_arg: '{ref_arg}'
143     path: '{path}'
144
145 - builder:
146     name: xtesting-build-containers
147     builders:
148       - shell: |
149           set +x
150           if [ "{repo}" = "_" ]; then
151             image={container}:{tag}
152           elif [ "{port}" = "None" ]; then
153             image={repo}/{container}:{tag}
154           else
155             image={repo}:{port}/{container}:{tag}
156           fi
157           if [ "{ref_arg}" = "None" ]; then
158             build_arg=""
159           else
160             build_arg="--build-arg {ref_arg}={ref}"
161           fi
162           cd {path}
163           sudo docker build $build_arg \
164             --pull=false --no-cache --force-rm=true \
165             -t $image .
166
167 - scm:
168     name: xtesting-scm
169     scm:
170       - git:
171           url: https://gerrit.opnfv.org/gerrit/functest-xtesting
172           refspec: '+refs/changes/*:refs/changes/*'
173           branches:
174             - '{ref}'
175
176 - job-template:
177     name: 'xtesting-{repo}-{container}-{tag}-pull'
178     parameters:
179       - xtesting-slave:
180           slave: '{slave}'
181     builders:
182       - xtesting-pull-containers:
183           <<: *xtesting-containers
184
185 - project:
186     name: 'xtesting-opnfv-xtesting-pull'
187     <<: *xtesting-params
188     container: 'xtesting'
189     jobs:
190       - 'xtesting-{repo}-{container}-{tag}-pull'
191
192 - project:
193     name: 'xtesting-opnfv-xtesting-mts-pull'
194     <<: *xtesting-params
195     container: 'xtesting-mts'
196     exclude:
197       - tag: hunter
198       - tag: iruya
199       - tag: jerma
200       - tag: kali
201       - tag: arm64-hunter
202       - tag: arm64-iruya
203       - tag: arm64-jerma
204       - tag: arm64-kali
205     jobs:
206       - 'xtesting-{repo}-{container}-{tag}-pull'
207
208 - job-template:
209     name: 'xtesting-{repo}-{container}-{tag}-rmi'
210     parameters:
211       - xtesting-slave:
212           slave: '{slave}'
213     builders:
214       - xtesting-remove-images:
215           <<: *xtesting-containers
216
217 - project:
218     name: 'xtesting-opnfv-xtesting-rmi'
219     <<: *xtesting-params
220     container: 'xtesting'
221     jobs:
222       - 'xtesting-{repo}-{container}-{tag}-rmi'
223
224 - project:
225     name: 'xtesting-opnfv-xtesting-mts-rmi'
226     <<: *xtesting-params
227     container: 'xtesting-mts'
228     exclude:
229       - tag: hunter
230       - tag: iruya
231       - tag: jerma
232       - tag: kali
233       - tag: arm64-hunter
234       - tag: arm64-iruya
235       - tag: arm64-jerma
236       - tag: arm64-kali
237     jobs:
238       - 'xtesting-{repo}-{container}-{tag}-rmi'
239
240 - job-template:
241     name: 'xtesting-{repo}-{container}-{tag}-{test}-run'
242     parameters:
243       - xtesting-slave:
244           slave: '{slave}'
245       - xtesting-build_tag:
246           build_tag: ''
247       - xtesting-DEBUG:
248           DEBUG: 'true'
249     builders:
250       - xtesting-run-containers:
251           <<: *xtesting-run-containers
252
253 - project:
254     name: 'xtesting-opnfv-xtesting'
255     <<: *xtesting-params
256     container: 'xtesting'
257     test:
258       - first
259       - second
260       - third
261       - fourth
262       - fifth
263       - sixth
264     exclude:
265       - tag: hunter
266         test: sixth
267       - tag: iruya
268         test: sixth
269       - tag: arm64-hunter
270         test: sixth
271       - tag: arm64-iruya
272         test: sixth
273     privileged: 'false'
274     network: bridge
275     jobs:
276       - 'xtesting-{repo}-{container}-{tag}-{test}-run'
277
278 - project:
279     name: 'xtesting-opnfv-xtesting-mts'
280     <<: *xtesting-params
281     container: 'xtesting-mts'
282     test:
283       - seventh
284     exclude:
285       - tag: hunter
286         test: seventh
287       - tag: iruya
288         test: seventh
289       - tag: jerma
290         test: seventh
291       - tag: kali
292         test: seventh
293       - tag: arm64-hunter
294         test: seventh
295       - tag: arm64-iruya
296         test: seventh
297       - tag: arm64-jerma
298         test: seventh
299       - tag: arm64-kali
300         test: seventh
301     privileged: 'false'
302     network: bridge
303     jobs:
304       - 'xtesting-{repo}-{container}-{tag}-{test}-run'
305
306 - builder:
307     name: xtesting-zip
308     builders:
309       - shell: |
310           set +x
311           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/* || true
312           if [ "{repo}" = "_" ]; then
313             image={container}:{tag}
314           elif [ "{port}" = "None" ]; then
315             image={repo}/{container}:{tag}
316           else
317             image={repo}:{port}/{container}:{tag}
318           fi
319           sudo docker run --rm \
320             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
321             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
322             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
323             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
324             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
325             -e BUILD_TAG=$BUILD_TAG \
326             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
327             -e DEBUG=$DEBUG \
328             -v /home/opnfv/xtesting/.boto:/root/.boto \
329             $image zip_campaign
330
331 - job-template:
332     name: 'xtesting-{tag}-zip'
333     parameters:
334       - xtesting-slave:
335           slave: '{slave}'
336       - xtesting-build_tag:
337           build_tag: ''
338       - xtesting-DEBUG:
339           DEBUG: 'true'
340     builders:
341       - xtesting-zip:
342           <<: *xtesting-containers
343
344 - project:
345     name: 'xtesting-{tag}-zip'
346     <<: *xtesting-params
347     container: 'xtesting'
348     jobs:
349       - 'xtesting-{tag}-zip'
350
351 - job-template:
352     name: 'xtesting-{tag}-daily'
353     project-type: multijob
354     triggers:
355       - timed: '@daily'
356     parameters:
357       - xtesting-slave:
358           slave: '{slave}'
359       - xtesting-build_tag:
360           build_tag: ''
361       - xtesting-DEBUG:
362           DEBUG: 'true'
363     properties:
364       - build-blocker:
365           use-build-blocker: true
366           blocking-level: 'NODE'
367           blocking-jobs:
368             - '^xtesting-{tag}-(daily|check|gate)$'
369     builders:
370       - multijob:
371           name: remove former images
372           projects:
373             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
374               <<: *xtesting-jobs
375             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
376               <<: *xtesting-jobs
377       - multijob:
378           name: pull containers
379           projects:
380             - name: 'xtesting-opnfv-xtesting-{tag}-pull'
381               <<: *xtesting-jobs
382             - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
383               <<: *xtesting-jobs
384       - multijob:
385           name: opnfv/xtesting:{tag}
386           projects:
387             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
388               <<: *xtesting-jobs
389             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
390               <<: *xtesting-jobs
391             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
392               <<: *xtesting-jobs
393             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
394               <<: *xtesting-jobs
395             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
396               <<: *xtesting-jobs
397             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
398               <<: *xtesting-jobs
399       - multijob:
400           name: opnfv/xtesting-mts:{tag}
401           projects:
402             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
403               <<: *xtesting-jobs
404       - multijob:
405           name: dump all campaign data
406           projects:
407             - name: 'xtesting-{tag}-zip'
408               <<: *xtesting-jobs
409
410 - job-template:
411     name: 'xtesting-{repo}-{container}-{tag}-gate'
412     parameters:
413       - xtesting-slave:
414           slave: '{slave}'
415     scm:
416       - xtesting-scm:
417           ref: $GERRIT_REFSPEC
418     builders:
419       - xtesting-build-containers:
420           <<: *xtesting-build-containers
421           ref: $GERRIT_REFSPEC
422
423 - job-template:
424     name: 'xtesting-{repo}-{container}-{tag}-check'
425     parameters:
426       - xtesting-slave:
427           slave: '{slave}'
428       - xtesting-branch:
429           branch: '{branch}'
430     scm:
431       - xtesting-scm:
432           ref: $branch
433     builders:
434       - xtesting-build-containers:
435           <<: *xtesting-build-containers
436           ref: $branch
437
438 - project:
439     name: 'xtesting-_-alpine-3.12-rmi'
440     repo: _
441     port:
442     container: alpine
443     tag: '3.12'
444     slave: master
445     jobs:
446       - 'xtesting-{repo}-{container}-{tag}-rmi'
447
448 - project:
449     name: 'xtesting-_-alpine-3.12-pull'
450     repo: _
451     port:
452     container: alpine
453     tag: '3.12'
454     slave: master
455     exclude:
456       - tag: arm64-hunter
457       - tag: arm64-iruya
458       - tag: arm64-jerma
459       - tag: arm64-kali
460       - tag: arm64-latest
461     jobs:
462       - 'xtesting-{repo}-{container}-{tag}-pull'
463
464 - project:
465     name: xtesting-opnfv-xtesting-{tag}-build
466     <<: *xtesting-params
467     container: xtesting
468     ref_arg: BRANCH
469     path: docker/core
470     exclude:
471       - tag: arm64-hunter
472       - tag: arm64-iruya
473       - tag: arm64-jerma
474       - tag: arm64-kali
475       - tag: arm64-latest
476     jobs:
477       - 'xtesting-{repo}-{container}-{tag}-gate'
478       - 'xtesting-{repo}-{container}-{tag}-check'
479
480 - project:
481     name: xtesting-opnfv-xtesting-mts-{tag}-build
482     <<: *xtesting-params
483     container: xtesting-mts
484     ref_arg: BRANCH
485     path: docker/mts
486     exclude:
487       - tag: arm64-hunter
488       - tag: arm64-iruya
489       - tag: arm64-jerma
490       - tag: arm64-kali
491       - tag: arm64-latest
492     jobs:
493       - 'xtesting-{repo}-{container}-{tag}-gate'
494       - 'xtesting-{repo}-{container}-{tag}-check'
495
496 - job-template:
497     name: 'xtesting-{tag}-check'
498     project-type: multijob
499     parameters:
500       - xtesting-slave:
501           slave: '{slave}'
502       - xtesting-build_tag:
503           build_tag: ''
504       - xtesting-branch:
505           branch: '{branch}'
506       - xtesting-DEBUG:
507           DEBUG: 'true'
508     properties:
509       - build-blocker:
510           use-build-blocker: true
511           blocking-level: 'NODE'
512           blocking-jobs:
513             - '^xtesting-{tag}-(daily|check|gate)$'
514     builders:
515       - multijob:
516           name: remove former images
517           projects:
518             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
519               <<: *xtesting-jobs
520             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
521               <<: *xtesting-jobs
522       - multijob:
523           name: remove dependencies
524           projects:
525             - name: 'xtesting-_-alpine-3.12-rmi'
526               <<: *xtesting-jobs
527       - multijob:
528           name: pull dependencies
529           projects:
530             - name: 'xtesting-_-alpine-3.12-pull'
531               <<: *xtesting-jobs
532       - multijob:
533           name: opnfv/xtesting
534           projects:
535             - name: 'xtesting-opnfv-xtesting-{tag}-check'
536               <<: *xtesting-jobs
537       - multijob:
538           name: opnfv/xtesting-mts
539           projects:
540             - name: 'xtesting-opnfv-xtesting-mts-{tag}-check'
541               <<: *xtesting-jobs
542       - multijob:
543           name: opnfv/xtesting:{tag}
544           projects:
545             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
546               <<: *xtesting-jobs
547             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
548               <<: *xtesting-jobs
549             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
550               <<: *xtesting-jobs
551             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
552               <<: *xtesting-jobs
553             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
554               <<: *xtesting-jobs
555             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
556               <<: *xtesting-jobs
557       - multijob:
558           name: opnfv/xtesting-mts:{tag}
559           projects:
560             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
561               <<: *xtesting-jobs
562
563 - trigger:
564     name: xtesting-patchset-created
565     triggers:
566       - gerrit:
567           server-name: 'gerrit.opnfv.org'
568           trigger-on:
569             - patchset-created-event
570             - comment-added-contains-event:
571                 comment-contains-value: 'recheck'
572             - comment-added-contains-event:
573                 comment-contains-value: 'reverify'
574           projects:
575             - project-compare-type: 'ANT'
576               project-pattern: 'functest-xtesting'
577               branches:
578                 - branch-compare-type: 'ANT'
579                   branch-pattern: '**/{branch}'
580           skip-vote:
581             successful: false
582             failed: false
583             unstable: false
584             notbuilt: false
585
586 - job-template:
587     name: 'xtesting-{tag}-gate'
588     project-type: multijob
589     triggers:
590       - xtesting-patchset-created:
591           branch: '{branch}'
592     parameters:
593       - xtesting-slave:
594           slave: '{slave}'
595       - xtesting-build_tag:
596           build_tag: ''
597       - xtesting-DEBUG:
598           DEBUG: 'true'
599     properties:
600       - build-blocker:
601           use-build-blocker: true
602           blocking-level: 'NODE'
603           blocking-jobs:
604             - '^xtesting-{tag}-(daily|check|gate)$'
605     builders:
606       - multijob:
607           name: remove former images
608           projects:
609             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
610               <<: *xtesting-jobs
611             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
612               <<: *xtesting-jobs
613       - multijob:
614           name: remove dependencies
615           projects:
616             - name: 'xtesting-_-alpine-3.12-rmi'
617               <<: *xtesting-jobs
618       - multijob:
619           name: pull dependencies
620           projects:
621             - name: 'xtesting-_-alpine-3.12-pull'
622               <<: *xtesting-jobs
623       - multijob:
624           name: opnfv/xtesting
625           projects:
626             - name: 'xtesting-opnfv-xtesting-{tag}-gate'
627               <<: *xtesting-jobs
628       - multijob:
629           name: opnfv/xtesting-mts
630           projects:
631             - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
632               <<: *xtesting-jobs
633       - multijob:
634           name: opnfv/xtesting:{tag}
635           projects:
636             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
637               <<: *xtesting-jobs
638             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
639               <<: *xtesting-jobs
640             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
641               <<: *xtesting-jobs
642             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
643               <<: *xtesting-jobs
644             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
645               <<: *xtesting-jobs
646             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
647               <<: *xtesting-jobs
648       - multijob:
649           name: opnfv/xtesting-mts:{tag}
650           projects:
651             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
652               <<: *xtesting-jobs
653
654 - project:
655     name: 'xtesting'
656     <<: *xtesting-params
657     jobs:
658       - 'xtesting-{tag}-daily'
659
660 - project:
661     name: 'xtesting-gate'
662     <<: *xtesting-params
663     exclude:
664       - tag: arm64-hunter
665       - tag: arm64-iruya
666       - tag: arm64-jerma
667       - tag: arm64-kali
668       - tag: arm64-latest
669     jobs:
670       - 'xtesting-{tag}-check'
671       - 'xtesting-{tag}-gate'
672
673 - view:
674     name: xtesting
675     view-type: list
676     columns:
677       - status
678       - weather
679       - job
680       - last-success
681       - last-failure
682       - last-duration
683     regex: ^xtesting-(arm.*-|amd64-)*[a-z]+-daily$
684
685 - view:
686     name: xtesting-gate
687     view-type: list
688     columns:
689       - status
690       - weather
691       - job
692       - last-success
693       - last-failure
694       - last-duration
695     regex: ^xtesting-(arm.*-|amd64-)*[a-z]+-gate$