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