Merge lp:~canonical-platform-qa/qa-jenkins-jobs/add-unity8-qemu-jobs into lp:qa-jenkins-jobs

Proposed by Richard Huddie
Status: Merged
Approved by: Max Brustkern
Approved revision: 212
Merged at revision: 205
Proposed branch: lp:~canonical-platform-qa/qa-jenkins-jobs/add-unity8-qemu-jobs
Merge into: lp:qa-jenkins-jobs
Diff against target: 346 lines (+262/-7)
8 files modified
jobs/ubuntu-system-tests/applaunch-jobs.yaml (+110/-0)
jobs/ubuntu-system-tests/jobs.yaml (+4/-4)
jobs/ubuntu-system-tests/report-results-to-grafana-builder.sh (+1/-1)
jobs/ubuntu-system-tests/report-results-to-practitest-builder.sh (+1/-1)
jobs/ubuntu-system-tests/subunit-to-junit.sh (+1/-1)
jobs/ubuntu-system-tests/ubuntu-system-tests-config-builder.sh (+78/-0)
jobs/ubuntu-system-tests/ubuntu-system-tests-image-builder.sh (+36/-0)
jobs/ubuntu-system-tests/ubuntu-system-tests-run-tests-builder.sh (+31/-0)
To merge this branch: bzr merge lp:~canonical-platform-qa/qa-jenkins-jobs/add-unity8-qemu-jobs
Reviewer Review Type Date Requested Status
Max Brustkern (community) Approve
Santiago Baldassin (community) Approve
platform-qa-bot continuous-integration Approve
Review via email: mp+315981@code.launchpad.net

Commit message

Add jenkins jobs for ubuntu-system-tests app launch tests which run on qemu.

Description of the change

This adds jobs for building either a snap or deb based unity8 image from an iso file which is stored locally on venonat. Once the image builder job completes it triggers the app launch test jobs.

The test jobs use an overlay image on the original base image, so its quick and easy to re-run tests without having the re-build the image each time.

Jobs are built for xenial and zesty versions.

Note that these jobs require following branch to land in ubuntu-system-tests trunk: https://code.launchpad.net/~canonical-platform-qa/ubuntu-system-tests/detect-app-launch-tests/+merge/314993

To post a comment you must log in.
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

This looks good. Let's get this landed so we can actually run them on venoat

review: Approve
Revision history for this message
Richard Huddie (rhuddie) wrote :

> This looks good. Let's get this landed so we can actually run them on venoat

Agree we need to get this landed. I'm just making some final updates to the corresponding ubuntu-system-tests branch which also needs to land to enable this. Once that is done we can land this one and deploy the jobs.

210. By Richard Huddie

Add lab requirements back.

211. By Richard Huddie

Use trunk version.

Revision history for this message
Max Brustkern (nuclearbob) wrote :

One small diff question, but nothing that should block the landing.

212. By Richard Huddie

Remove un-neccessary junit builder.

Revision history for this message
Richard Huddie (rhuddie) wrote :

Thanks for review. I've removed the junit builder as there are no subunit results for this job.

Revision history for this message
Max Brustkern (nuclearbob) wrote :

Ship it!

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/applaunch-jobs.yaml'
2--- jobs/ubuntu-system-tests/applaunch-jobs.yaml 1970-01-01 00:00:00 +0000
3+++ jobs/ubuntu-system-tests/applaunch-jobs.yaml 2017-02-03 15:23:24 +0000
4@@ -0,0 +1,110 @@
5+# vim: sw=4 ts=4 et
6+
7+# QA Jenkins Jobs
8+# Copyright 2017 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: ubuntu-system-tests-app-launch
24+ automation_status:
25+ - stable
26+ release:
27+ - xenial
28+ - zesty
29+ package:
30+ - snap
31+ - deb
32+ target:
33+ - qemu:
34+ device_node: iso-testing||venonat-upgrade
35+ jobs:
36+ - 'ust_build_image_{release}_{target}_{package}'
37+ - 'ust_test_launch_apps_{release}_{target}_{package}'
38+
39+- job-template: &UST_APP_LAUNCH_JOB_TEMPLATE
40+ name: 'ust_app_launch_job_template'
41+ concurrent: true
42+ node: '{device_node}'
43+ parameters:
44+ - ubuntu-system-tests-app-launch-parameters:
45+ release: '{release}'
46+ package: '{package}'
47+ target: '{target}'
48+
49+- job-template:
50+ <<: *UST_APP_LAUNCH_JOB_TEMPLATE
51+ name: 'ust_build_image_{release}_{target}_{package}'
52+ description: 'Build image for target.'
53+ builders:
54+ - clear-artifacts
55+ - ubuntu-system-tests-config-builder
56+ - ubuntu-system-tests-image-builder
57+ publishers:
58+ - trigger:
59+ project: 'ust_test_launch_apps_{release}_{target}_{package}'
60+ threshold: 'SUCCESS'
61+ - archive:
62+ artifacts: 'results/**/*'
63+ allow-empty: 'true'
64+
65+- job-template:
66+ <<: *UST_APP_LAUNCH_JOB_TEMPLATE
67+ name: 'ust_test_launch_apps_{release}_{target}_{package}'
68+ description: 'Run app launch tests against image.'
69+ builders:
70+ - clear-artifacts
71+ - ubuntu-system-tests-config-builder
72+ - ubuntu-system-tests-run-tests-builder
73+ - subunit-to-junit-results-builder
74+ publishers:
75+ - archive:
76+ artifacts: 'results/**/*'
77+ allow-empty: 'true'
78+ - junit:
79+ results: 'results/test-results.xml'
80+ test-stability: 'true'
81+
82+- parameter:
83+ name: ubuntu-system-tests-app-launch-parameters
84+ parameters:
85+ - string:
86+ name: RELEASE
87+ default: '{release}'
88+ description: Release version tested.
89+ - string:
90+ name: PACKAGE
91+ default: '{package}'
92+ description: Package type for unity8 session, either deb or snap.
93+ - string:
94+ name: TARGET
95+ default: '{target}'
96+ description: Name of target, either qemu or adb.
97+
98+- builder:
99+ name: ubuntu-system-tests-config-builder
100+ builders:
101+ - shell:
102+ !include-raw: 'ubuntu-system-tests-config-builder.sh'
103+
104+- builder:
105+ name: ubuntu-system-tests-image-builder
106+ builders:
107+ - shell:
108+ !include-raw: 'ubuntu-system-tests-image-builder.sh'
109+
110+- builder:
111+ name: ubuntu-system-tests-run-tests-builder
112+ builders:
113+ - shell:
114+ !include-raw: 'ubuntu-system-tests-run-tests-builder.sh'
115
116=== modified file 'jobs/ubuntu-system-tests/jobs.yaml'
117--- jobs/ubuntu-system-tests/jobs.yaml 2016-09-27 18:10:05 +0000
118+++ jobs/ubuntu-system-tests/jobs.yaml 2017-02-03 15:23:24 +0000
119@@ -90,7 +90,7 @@
120 artifacts: 'results/**/*'
121 allow-empty: 'true'
122 - junit:
123- results: 'results/artifacts/test-results.xml'
124+ results: 'results/test-results.xml'
125
126 - job-template:
127 <<: *UST_DEFAULT_JOB_TEMPLATE
128@@ -136,7 +136,7 @@
129 artifacts: 'results/**/*'
130 allow-empty: 'true'
131 - junit:
132- results: 'results/artifacts/test-results.xml'
133+ results: 'results/test-results.xml'
134 - trigger-parameterized-builds:
135 - project: ust_report-results-to-practitest
136 predefined-parameters: |
137@@ -172,7 +172,7 @@
138 artifacts: 'results/**/*'
139 allow-empty: 'true'
140 - junit:
141- results: 'results/artifacts/test-results.xml'
142+ results: 'results/test-results.xml'
143
144 - parameter:
145 name: ubuntu-system-tests-parameters
146@@ -270,7 +270,7 @@
147 builders:
148 - copyartifact:
149 project: "${{UPSTREAM_JOB_NAME}}"
150- filter: "results/artifacts/test-results.subunit"
151+ filter: "results/test-results.subunit"
152 which-build: upstream-build
153 - shell:
154 !include-raw: 'report-results-to-practitest-builder.sh'
155
156=== modified file 'jobs/ubuntu-system-tests/report-results-to-grafana-builder.sh'
157--- jobs/ubuntu-system-tests/report-results-to-grafana-builder.sh 2016-10-12 16:43:54 +0000
158+++ jobs/ubuntu-system-tests/report-results-to-grafana-builder.sh 2017-02-03 15:23:24 +0000
159@@ -19,4 +19,4 @@
160
161 echo "Push to grafana"
162 export OUTPUTDIR="$WORKSPACE/results"
163-python3 qakit/qakit/prodenv/tests/sync_test_results.py -p $OUTPUTDIR/artifacts/test-results.pyunit -d {device} -c $CHANNEL -b $REVISION -s {setid}
164+python3 qakit/qakit/prodenv/tests/sync_test_results.py -p $OUTPUTDIR/test-results.pyunit -d {device} -c $CHANNEL -b $REVISION -s {setid}
165
166=== modified file 'jobs/ubuntu-system-tests/report-results-to-practitest-builder.sh'
167--- jobs/ubuntu-system-tests/report-results-to-practitest-builder.sh 2016-05-26 22:22:08 +0000
168+++ jobs/ubuntu-system-tests/report-results-to-practitest-builder.sh 2017-02-03 15:23:24 +0000
169@@ -9,4 +9,4 @@
170 bzr branch $QA_JENKINS_JOBS_BRANCH qa-jenkins-jobs
171
172 # "1SS" is the name of the lab
173-./qa-jenkins-jobs/scripts/ubuntu-system-tests/report-results-to-practitest.sh $WORKSPACE/results/artifacts/test-results.subunit $TEST_LEVEL 1SS
174+./qa-jenkins-jobs/scripts/ubuntu-system-tests/report-results-to-practitest.sh $WORKSPACE/results/test-results.subunit $TEST_LEVEL 1SS
175
176=== modified file 'jobs/ubuntu-system-tests/subunit-to-junit.sh'
177--- jobs/ubuntu-system-tests/subunit-to-junit.sh 2016-08-18 23:58:31 +0000
178+++ jobs/ubuntu-system-tests/subunit-to-junit.sh 2017-02-03 15:23:24 +0000
179@@ -7,6 +7,6 @@
180
181 # sometimes get unicode-encoding errors; -o option apparently broken in this env :/
182 export PYTHONIOENCODING=utf-8
183-subunit2junitxml $WORKSPACE/results/artifacts/test-results.subunit > $WORKSPACE/results/artifacts/test-results.xml || true
184+subunit2junitxml $WORKSPACE/results/test-results.subunit > $WORKSPACE/results/test-results.xml || true
185
186 deactivate # our virtualenv
187
188=== added file 'jobs/ubuntu-system-tests/ubuntu-system-tests-config-builder.sh'
189--- jobs/ubuntu-system-tests/ubuntu-system-tests-config-builder.sh 1970-01-01 00:00:00 +0000
190+++ jobs/ubuntu-system-tests/ubuntu-system-tests-config-builder.sh 2017-02-03 15:23:24 +0000
191@@ -0,0 +1,78 @@
192+#!/bin/bash
193+set -x
194+
195+export QA_JENKINS_JOBS_BRANCH=lp:qa-jenkins-jobs
196+export UBUNTU_SYSTEM_TESTS_CONFIG_BRANCH="lp:ubuntu-system-tests-config"
197+export CONFIG_PATH=${WORKSPACE}/ubuntu-system-tests.conf
198+export CACHE_PATH=${WORKSPACE}/.ust-cache
199+export OUTPUTDIR=$WORKSPACE/results
200+
201+# TODO: Use this once we can access the config project
202+#rm -rf qa-jenkins-jobs
203+#bzr branch $QA_JENKINS_JOBS_BRANCH qa-jenkins-jobs
204+#./qa-jenkins-jobs/scripts/ubuntu-system-tests/write-ust-config.sh
205+# TODO: Remove this once we can access the config project
206+rm $CONFIG_PATH
207+cat >> $CONFIG_PATH <<EOF
208+[default]
209+tests_to_run = FIXME
210+ssh_ip = FIXME
211+ssh_user = FIXME
212+bluetooth_device_name = FIXME
213+device_username = ubuntu
214+device_password = ubuntu
215+device_ip = localhost
216+device_phone_number = FIXME
217+device_security = Passcode
218+max_unity8_retry_delay = 30000
219+sim_0_pin = FIXME
220+sim_1_pin = FIXME
221+telephony_service_number1 = FIXME
222+telephony_service_number2 = FIXME
223+ssh_passphrase = FIXME
224+ssh_private_key = FIXME
225+device_phone_number2 = FIXME
226+touch_visualization = false
227+_twilio_account_sid = FIXME
228+_twilio_auth_token = FIXME
229+_practitest_project_id = FIXME
230+_practitest_api_token = FIXME
231+wifi_password = FIXME
232+wifi_ssid = FIXME
233+app_startup_cold_runs = 0
234+app_startup_hot_runs = 0
235+pictures_scalability_runs = 0
236+videos_scalability_runs = 0
237+music_scalability_runs = 0
238+password_outlook = FIXME
239+password_yahoo = FIXME
240+password_imap = FIXME
241+encryption_imap = FIXME
242+hostname_imap = FIXME
243+port_number_imap = FIXME
244+username_imap = FIXME
245+email_outlook = FIXME
246+email_yahoo = FIXME
247+email_smtp = FIXME
248+encryption_smtp = FIXME
249+hostname_smtp = FIXME
250+name_smtp = FIXME
251+password_smtp = FIXME
252+port_number_smtp = FIXME
253+username_smtp = FIXME
254+country_sim = FIXME
255+qemu_auto_iso_download = false
256+qemu_iso_arch = amd64
257+qemu_iso_url = http://cdimage.ubuntu.com/daily-live/current
258+cache_data_path = $CACHE_PATH
259+qemu_cpu_count = 2
260+qemu_ram_alloc = 2G
261+qemu_disk_size = 15G
262+qemu_headless = true
263+qemu_max_cache_file_count = 0
264+device_serial = 1234567890
265+output_dir = $OUTPUTDIR
266+target_type = $TARGET
267+package_type = $PACKAGE
268+EOF
269+cat $CONFIG_PATH
270
271=== added file 'jobs/ubuntu-system-tests/ubuntu-system-tests-image-builder.sh'
272--- jobs/ubuntu-system-tests/ubuntu-system-tests-image-builder.sh 1970-01-01 00:00:00 +0000
273+++ jobs/ubuntu-system-tests/ubuntu-system-tests-image-builder.sh 2017-02-03 15:23:24 +0000
274@@ -0,0 +1,36 @@
275+#!/bin/bash
276+set -x
277+
278+export UBUNTU_SYSTEM_TESTS_BRANCH=lp:ubuntu-system-tests
279+export QA_JENKINS_JOBS_BRANCH=lp:qa-jenkins-jobs
280+export ISO_PATH=/var/cache/utah/iso/$RELEASE-desktop-amd64.iso
281+export SHARED_IMG_PATH=/var/cache/ust/img/$RELEASE-unity8-$PACKAGE.img
282+export OUTPUTDIR=$WORKSPACE/results
283+export CACHE_PATH=$WORKSPACE/.ust-cache
284+export IMG_PATH=$CACHE_PATH/disk.img
285+export CONFIG_PATH=$WORKSPACE/ubuntu-system-tests.conf
286+export https_proxy=https://squid.internal:3128/
287+
288+rm -rf $OUTPUTDIR
289+mkdir $OUTPUTDIR
290+
291+# let's work in a virtualenv
292+rm -rf ve3
293+virtualenv --system-site-packages --python=python3 ve3
294+. ve3/bin/activate
295+
296+rm -rf ubuntu-system-tests
297+bzr branch $UBUNTU_SYSTEM_TESTS_BRANCH ubuntu-system-tests
298+cd ubuntu-system-tests
299+python3 setup.py develop
300+
301+# build the image
302+python3 -m ubuntu_system_tests.run build-qemu --iso $ISO_PATH --headless --silent --config $CONFIG_PATH --img $IMG_PATH
303+
304+# run setup on the image to install unity8-session as either deb or snap
305+python3 -m ubuntu_system_tests.run setup --headless --silent --config $CONFIG_PATH --img $IMG_PATH
306+
307+# copy the resulting image file to shared location for use by tests
308+sudo cp $IMG_PATH $SHARED_IMG_PATH
309+
310+deactivate # our virtualenv
311
312=== added file 'jobs/ubuntu-system-tests/ubuntu-system-tests-run-tests-builder.sh'
313--- jobs/ubuntu-system-tests/ubuntu-system-tests-run-tests-builder.sh 1970-01-01 00:00:00 +0000
314+++ jobs/ubuntu-system-tests/ubuntu-system-tests-run-tests-builder.sh 2017-02-03 15:23:24 +0000
315@@ -0,0 +1,31 @@
316+#!/bin/bash
317+set -x
318+
319+export UBUNTU_SYSTEM_TESTS_BRANCH=lp:ubuntu-system-tests
320+export SHARED_IMG_PATH=/var/cache/ust/img/$RELEASE-unity8-$PACKAGE.img
321+export OUTPUTDIR=$WORKSPACE/results
322+export CONFIG_PATH=$WORKSPACE/ubuntu-system-tests.conf
323+export https_proxy=https://squid.internal:3128/
324+
325+rm -rf $OUTPUTDIR
326+mkdir $OUTPUTDIR
327+
328+# let's work in a virtualenv
329+rm -rf ve3
330+virtualenv --system-site-packages --python=python3 ve3
331+. ve3/bin/activate
332+
333+rm -rf ubuntu-system-tests
334+bzr branch $UBUNTU_SYSTEM_TESTS_BRANCH ubuntu-system-tests
335+cd ubuntu-system-tests
336+python3 setup.py develop
337+
338+# Run tests on the image.
339+# For qemu this will use a temporary overlay image by default,
340+# so we can use the shared image directly as base.
341+python3 -m ubuntu_system_tests.run run --headless --silent --config $CONFIG_PATH --img $SHARED_IMG_PATH ubuntu_system_tests.tests.test_launch_apps.LaunchAppOnceTestCase
342+
343+# Run next set of tests, appending results to previous results
344+python3 -m ubuntu_system_tests.run run --headless --silent --config $CONFIG_PATH --img $SHARED_IMG_PATH --append-results ubuntu_system_tests.tests.test_launch_apps.LaunchAppTwiceTestCase
345+
346+deactivate # our virtualenv

Subscribers

People subscribed via source and target branches