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