Merge lp:~heber013/qa-jenkins-jobs/adding-job-test-proposed-package into lp:qa-jenkins-jobs

Proposed by Heber Parrucci
Status: Merged
Merged at revision: 311
Proposed branch: lp:~heber013/qa-jenkins-jobs/adding-job-test-proposed-package
Merge into: lp:qa-jenkins-jobs
Diff against target: 258 lines (+242/-1)
2 files modified
jobs/ubuntu-system-tests/package-jobs.yaml (+237/-0)
jobs/ubuntu-system-tests/ubuntu-system-tests-run-tests-builder.sh (+5/-1)
To merge this branch: bzr merge lp:~heber013/qa-jenkins-jobs/adding-job-test-proposed-package
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement Approve
platform-qa-bot continuous-integration Needs Fixing
Review via email: mp+337887@code.launchpad.net

Commit message

Adding jobs to monitor when there is a new version of a package available and run the corresponding tests.

Description of the change

Adding jobs to monitor when there is a new version of a package available and run the corresponding tests.

To post a comment you must log in.
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks. Approved!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'jobs/ubuntu-system-tests/package-jobs.yaml'
2--- jobs/ubuntu-system-tests/package-jobs.yaml 1970-01-01 00:00:00 +0000
3+++ jobs/ubuntu-system-tests/package-jobs.yaml 2018-02-16 18:04:33 +0000
4@@ -0,0 +1,237 @@
5+# vim: sw=4 ts=4 et
6+
7+# QA Jenkins Jobs
8+# Copyright 2018 Canonical Ltd.
9+
10+# This program is free software: you can redistribute it and/or modify it
11+# under the terms of the GNU General Public License version 3, as published
12+# by the Free Software Foundation.
13+
14+# This program is distributed in the hope that it will be useful, but
15+# WITHOUT ANY WARRANTY; without even the implied warranties of
16+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
17+# PURPOSE. See the GNU General Public License for more details.
18+
19+# You should have received a copy of the GNU General Public License along
20+# with this program. If not, see <http://www.gnu.org/licenses/>.
21+
22+- project:
23+ name: trigger-ust-package
24+ flavor:
25+ - ubuntu
26+ model:
27+ - desktop
28+ release:
29+ - bionic
30+ node: iso-testing||venonat-upgrade
31+ arch:
32+ - amd64
33+ - i386
34+ jobs:
35+ - 'trigger-ust-package-{flavor}-{release}-{model}-{arch}'
36+ - 'ust-package-{flavor}-{release}-{model}-{arch}'
37+
38+- job-template:
39+ name: 'trigger-ust-package-{flavor}-{release}-{model}-{arch}'
40+ description: |
41+ Check whether it is necesary to trigger tests for a package
42+ triggers:
43+ - daily
44+ node: iso-testing||venonat-upgrade
45+ parameters:
46+ - ubuntu-system-tests-common-parameters:
47+ release: '{release}'
48+ model: '{model}'
49+ flavor: '{flavor}'
50+ arch: '{arch}'
51+ - string:
52+ name: SHARED_IMG_PATH
53+ default: '/var/cache/ust/img/{release}-{model}-{arch}.img'
54+ description: 'The disk image path.'
55+ - string:
56+ name: UBUNTU_SYSTEM_TESTS_BRANCH
57+ default: lp:ubuntu-system-tests
58+ description: Launchpad branch of ubuntu-system-tests from which to run tests.
59+ - string:
60+ name: TESTS_TO_RUN
61+ default: ubuntu_system_tests.tests.test_gnome_software
62+ description: List of tests to run. Default run all tests.
63+ - string:
64+ name: QAKIT_BRANCH
65+ default: lp:qakit
66+ description: Launchpad branch of qakit project to use.
67+ - string:
68+ name: QAKIT_CONFIG
69+ default:
70+ description: Qakit config path
71+ - string:
72+ name: PACKAGE_NAME
73+ default: gnome-software
74+ description: Package name to check new version and run tests for.
75+ - string:
76+ name: POCKET
77+ default: proposed
78+ description: Pocket name to check new version and run tests for.
79+ builders:
80+ - clear-artifacts
81+ - branch-bzr-project:
82+ project-url: '$QAKIT_BRANCH'
83+ project-name: 'qakit'
84+ - shell: |
85+ #!/bin/bash -ex
86+ cd qakit
87+ python2 -m qakit.ust.launch_tests_for_package --source_name $PACKAGE_NAME -p $POCKET --parameter PACKAGE_VERSION -d -j ust-package-$FLAVOR-$RELEASE-$MODEL-$ARCH -t $TESTS_TO_RUN -b $UBUNTU_SYSTEM_TESTS_BRANCH
88+
89+- job-template:
90+ name: 'ust-package-{flavor}-{release}-{model}-{arch}'
91+ description: 'Run tests against image.'
92+ wrappers:
93+ - timeout:
94+ timeout: 120
95+ fail: true
96+ parameters:
97+ - ubuntu-system-tests-common-parameters:
98+ release: '{release}'
99+ model: '{model}'
100+ flavor: '{flavor}'
101+ arch: '{arch}'
102+ - ubuntu-system-tests-run-parameters:
103+ - string:
104+ name: PACKAGE_NAME
105+ default: gnome-software
106+ description: Package name to install and run tests for.
107+ - string:
108+ name: PACKAGE_VERSION
109+ default:
110+ description: Package version to install and run tests for.
111+ - string:
112+ name: POCKET
113+ default: proposed
114+ description: Pocket name to check new version and run tests for.
115+ - bool:
116+ name: CLEAN_DISK_IMG_AFTER_RUN
117+ default: true
118+ description: whether to delete the disk image at the end.
119+ builders:
120+ - clear-artifacts
121+ - ust-set-common-variables
122+ - ubuntu-system-tests-config-builder
123+ - conditional-step:
124+ condition-kind: shell
125+ condition-command: |
126+ #!/bin/bash
127+ [ -z $SHARED_IMG_PATH ]
128+ steps:
129+ - shell: |
130+ #!/bin/bash
131+ GENERATED_IMG_PATH=/var/cache/ust/img/$(basename $WORKSPACE)-{release}-{model}-{arch}.img
132+ cat > $WORKSPACE/shared-var <<EOF
133+ GENERATED_IMG_PATH=$GENERATED_IMG_PATH
134+ EOF
135+ - inject:
136+ properties-file: $WORKSPACE/shared-var
137+ - trigger-builds:
138+ - project:
139+ - 'ust-build-image-{flavor}-{release}-{model}-{arch}'
140+ block: true
141+ node-parameters: true
142+ predefined-parameters: |
143+ SHARED_IMG_PATH=$GENERATED_IMG_PATH
144+ - ubuntu-system-tests-run-tests-builder
145+ publishers:
146+ - archive:
147+ artifacts: 'results/**/*'
148+ allow-empty: 'true'
149+ - postbuildscript:
150+ builders:
151+ - subunit-to-junit-results-builder
152+ - grafana-info:
153+ device: 'vm'
154+ model: '{model}'
155+ os: '{flavor}'
156+ release: '{release}'
157+ arch: '{arch}'
158+ class: "$PACKAGE_NAME/$POCKET"
159+ conf: ''
160+ - grafana-tests-upload:
161+ results_type: 'pyunit'
162+ results_file: 'results/*.pyunit'
163+ info_file: 'global_info.json'
164+ script-only-if-succeeded: False
165+ script-only-if-failed: False
166+ - junit:
167+ results: 'results/test-results.xml'
168+ test-stability: 'true'
169+
170+- parameter:
171+ name: ubuntu-system-tests-common-parameters
172+ parameters:
173+ - string:
174+ name: FLAVOR
175+ default: '{flavor}'
176+ description: Distribution flavor, default ubuntu.
177+ - string:
178+ name: ARCH
179+ default: '{arch}'
180+ description: Architecture of hardware.
181+ - string:
182+ name: RELEASE
183+ default: '{release}'
184+ description: Release version tested.
185+ - string:
186+ name: MODEL
187+ default: '{model}'
188+ description: Name of model.
189+ - string:
190+ name: CONFIG_SECTION
191+ description: The config section to use
192+ default: default
193+ - string:
194+ name: https_proxy
195+ description: The https proxy to use
196+ default: https://squid.internal:3128
197+
198+- parameter:
199+ name: ubuntu-system-tests-run-parameters
200+ parameters:
201+ - string:
202+ name: UBUNTU_SYSTEM_TESTS_BRANCH
203+ default: lp:ubuntu-system-tests
204+ description: Launchpad branch of ubuntu-system-tests from which to run tests.
205+ - string:
206+ name: TESTS_TO_RUN
207+ default: ubuntu_system_tests.tests
208+ description: List of tests to run. Default run all tests.
209+ - string:
210+ name: SHARED_IMG_PATH
211+ description: The disk image path.
212+
213+- builder:
214+ name: ust-set-common-variables
215+ builders:
216+ - shell:
217+ !include-raw: 'ust-set-common-variables.sh'
218+
219+- builder:
220+ name: ubuntu-system-tests-config-builder
221+ builders:
222+ - shell:
223+ !include-raw: 'ubuntu-system-tests-config-builder.sh'
224+
225+- builder:
226+ name: ubuntu-system-tests-image-builder
227+ builders:
228+ - shell:
229+ !include-raw: 'ubuntu-system-tests-image-builder.sh'
230+
231+- builder:
232+ name: ubuntu-system-tests-run-tests-builder
233+ builders:
234+ - shell:
235+ !include-raw: 'ubuntu-system-tests-run-tests-builder.sh'
236+
237+- builder:
238+ name: subunit-to-junit-results-builder
239+ builders:
240+ - shell:
241+ !include-raw: 'subunit-to-junit.sh'
242
243=== modified file 'jobs/ubuntu-system-tests/ubuntu-system-tests-run-tests-builder.sh'
244--- jobs/ubuntu-system-tests/ubuntu-system-tests-run-tests-builder.sh 2017-08-28 15:09:06 +0000
245+++ jobs/ubuntu-system-tests/ubuntu-system-tests-run-tests-builder.sh 2018-02-16 18:04:33 +0000
246@@ -37,7 +37,11 @@
247 python3 setup.py develop
248
249 # Run setup on the image to install tests dependencies
250-python3 -m ubuntu_system_tests.run setup --headless --silent --config $CONFIG_PATH --img $SHARED_IMG_PATH -e $CONFIG_SECTION
251+parameters="ubuntu_system_tests.run setup --headless --silent --config $CONFIG_PATH --img $SHARED_IMG_PATH -e $CONFIG_SECTION"
252+if [ ! -z ${PACKAGE_NAME+x} ]; then
253+ parameters="$parameters --install-packages $PACKAGE_NAME/$RELEASE-$POCKET"
254+fi
255+python3 -m ${parameters}
256 rs=$?
257 #if something failed in the setup, exit with failure
258 [ $rs != 0 ] && exit $rs

Subscribers

People subscribed via source and target branches

to all changes: