Merge lp:~canonical-platform-qa/qa-jenkins-jobs/ubuntu-system-tests-jobs-initial into lp:qa-jenkins-jobs

Proposed by Allan LeSage
Status: Merged
Approved by: Max Brustkern
Approved revision: 135
Merged at revision: 35
Proposed branch: lp:~canonical-platform-qa/qa-jenkins-jobs/ubuntu-system-tests-jobs-initial
Merge into: lp:qa-jenkins-jobs
Diff against target: 253 lines (+210/-3)
5 files modified
scripts/flash-device.sh (+2/-2)
scripts/get-recovery-image.sh (+1/-1)
scripts/ubuntu-system-tests/run-ubuntu-system-tests.sh (+28/-0)
scripts/ubuntu-system-tests/write-config.sh (+4/-0)
ubuntu-system-tests/jobs.yaml (+175/-0)
To merge this branch: bzr merge lp:~canonical-platform-qa/qa-jenkins-jobs/ubuntu-system-tests-jobs-initial
Reviewer Review Type Date Requested Status
Max Brustkern (community) Approve
Christopher Lee (community) Approve
Review via email: mp+288031@code.launchpad.net

Commit message

Initial set of jobs to run ubuntu-system-tests in 1SS Jenkins.

Description of the change

An initial set of jobs to run ubuntu-system-tests in our 1SS Jenkins.

Have been tested thoroughly (manually ;) , i.e. running in Jenkins).

One set of jobs is triggered by new image publication, the 'freestyle' jobs are left for tinkering: it's sometimes helpful to be able to run a failing test alone in a way that won't contribute to the pass/fail history, e.g.

To post a comment you must log in.
126. By Allan LeSage

Merge trunk, resolving conflict.

127. By Allan LeSage

Remove obj: prefixes.

Revision history for this message
Christopher Lee (veebers) wrote :

LGTM, makes sense while reading though it. Well laid out and readable.

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

Having to use a venv and download the image still hurts whatever devops organ I've started to grow within me, but changing that is out of scope here. I'll want to come back later and wave the magic .deb wand over a few things, but for now, I've just got some diff comments.

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

Oh also: I think we should land and deploy this, but the krillin regression job is probably going to break until we run it in chunks. If you've have a better experience with this, I'd be delighted to not have to do that any more, but in brendand's and my experience, periodic reboots are necessary to keep things running smoothly.

128. By Allan LeSage

Max-requested changes: de-bashify, trust shell to interpret line-breaks correctly when passing lines of tests, add description, add license header.

129. By Allan LeSage

Set execution perms on flash-device.sh .

130. By Allan LeSage

Remove unsightly 'x' from case statement, add exit on no input.

131. By Allan LeSage

Redirect output of specify-tests complaint to stderr.

132. By Allan LeSage

Some shuffling of jobs.yaml script and remove default, instead check for null TESTS_TO_RUN.

133. By Allan LeSage

Last of the jobs.yaml shuffling.

134. By Allan LeSage

Set location of recovery image to /recovery.img.

135. By Allan LeSage

Correct single-quotes around recovery image term in flash-device.sh.

Revision history for this message
Allan LeSage (allanlesage) wrote :

Adjusted to your comments Max, ready for another review!

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=== modified file 'scripts/flash-device.sh'
2--- scripts/flash-device.sh 2016-02-10 15:58:04 +0000
3+++ scripts/flash-device.sh 2016-03-07 16:07:31 +0000
4@@ -50,13 +50,13 @@
5 x"krillin")
6 DEFAULT_CHANNEL="ubuntu-touch/rc-proposed/bq-aquaris.en"
7 FASTBOOT=yes
8- RECOVERY='--recovery-image recovery.img'
9+ RECOVERY="--recovery-image ${WORKSPACE}/recovery.img"
10 ;;
11 x"m75" | x"arale")
12 DEVICE=arale
13 DEFAULT_CHANNEL="ubuntu-touch/rc-proposed/meizu.en"
14 FASTBOOT=yes
15- RECOVERY='--recovery-image recovery.img'
16+ RECOVERY="--recovery-image ${WORKSPACE}/recovery.img"
17 ;;
18 *)
19 echo "Unrecognized device: $DEVICE"
20
21=== modified file 'scripts/get-recovery-image.sh'
22--- scripts/get-recovery-image.sh 2016-02-09 20:17:59 +0000
23+++ scripts/get-recovery-image.sh 2016-03-07 16:07:31 +0000
24@@ -18,4 +18,4 @@
25 export DEVICE=$(echo $NODE_NAME | sed 's/\(\w\)-.*/\1/')
26
27 # from plars' lifeboat scripts, deposit the proper recovery image in ./recovery.img
28-wget -O recovery.img http://people.canonical.com/~plars/touch/recovery-$DEVICE.img
29+wget -O ${WORKSPACE}/recovery.img http://people.canonical.com/~plars/touch/recovery-$DEVICE.img
30
31=== added directory 'scripts/ubuntu-system-tests'
32=== added file 'scripts/ubuntu-system-tests/run-ubuntu-system-tests.sh'
33--- scripts/ubuntu-system-tests/run-ubuntu-system-tests.sh 1970-01-01 00:00:00 +0000
34+++ scripts/ubuntu-system-tests/run-ubuntu-system-tests.sh 2016-03-07 16:07:31 +0000
35@@ -0,0 +1,28 @@
36+#!/bin/sh
37+set -x
38+set +e
39+
40+export TESTS="$1"
41+
42+# let's work in a virtualenv
43+virtualenv --python=python3 ve3
44+. ve3/bin/activate
45+
46+# uci-config is broken in trusty ppa
47+rm -rf uci-config
48+bzr branch lp:uci-config
49+CURDIR=`pwd`
50+cd uci-config
51+python3 setup.py install
52+cd $CURDIR
53+
54+rm -rf ubuntu-system-tests
55+bzr branch $UBUNTU_SYSTEM_TESTS_BRANCH ubuntu-system-tests
56+cd ubuntu-system-tests
57+python3 setup.py develop
58+python3 -m ubuntu_system_tests.command_line -n -i -u --config=$CONFIG_PATH "$TESTS"
59+
60+deactivate # our virtualenv
61+
62+# TODO: run this as a post-build step
63+subunit2junitxml $WORKSPACE/results/artifacts/test-results.subunit > $WORKSPACE/results/artifacts/test-results.xml || true
64
65=== added file 'scripts/ubuntu-system-tests/write-config.sh'
66--- scripts/ubuntu-system-tests/write-config.sh 1970-01-01 00:00:00 +0000
67+++ scripts/ubuntu-system-tests/write-config.sh 2016-03-07 16:07:31 +0000
68@@ -0,0 +1,4 @@
69+#!/bin/sh
70+set -x
71+
72+bzr cat ${UBUNTU_SYSTEM_TESTS_CONFIG_BRANCH}/config.ini > "${CONFIG_PATH}"
73
74=== added directory 'ubuntu-system-tests'
75=== added file 'ubuntu-system-tests/jobs.yaml'
76--- ubuntu-system-tests/jobs.yaml 1970-01-01 00:00:00 +0000
77+++ ubuntu-system-tests/jobs.yaml 2016-03-07 16:07:31 +0000
78@@ -0,0 +1,175 @@
79+# vim: sw=4 ts=4 et
80+
81+# QA Jenkins Jobs
82+# Copyright 2016 Canonical Ltd.
83+
84+# This program is free software: you can redistribute it and/or modify it
85+# under the terms of the GNU General Public License version 3, as published
86+# by the Free Software Foundation.
87+
88+# This program is distributed in the hope that it will be useful, but
89+# WITHOUT ANY WARRANTY; without even the implied warranties of
90+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
91+# PURPOSE. See the GNU General Public License for more details.
92+
93+# You should have received a copy of the GNU General Public License along
94+# with this program. If not, see <http://www.gnu.org/licenses/>.
95+
96+- project:
97+ name: ubuntu-system-tests
98+ test_level:
99+ - sanity
100+ - regression
101+ channel:
102+ - 'rc'
103+ - 'rc-proposed'
104+ - 'devel-proposed'
105+ device:
106+ - krillin:
107+ device_channel: 'bq-aquaris.en'
108+ - arale:
109+ device_channel: 'meizu.en'
110+ release:
111+ - vivid
112+ jobs:
113+ - 'ubuntu-system-tests_{release}_{channel}_{device}_{test_level}_triggered'
114+ - 'ubuntu-system-tests_{release}_{channel}_{device}_{test_level}_freestyle'
115+
116+- job-template:
117+ name: 'ubuntu-system-tests_{release}_{channel}_{device}_{test_level}_triggered'
118+ description: "Triggered upon image update."
119+ parameters:
120+ - ubuntu-system-tests-parameters:
121+ test_level: '{test_level}'
122+ channel: '{channel}'
123+ device_channel: '{device_channel}'
124+ node: '{device}'
125+ triggers:
126+ - ubuntu-system-tests-triggers:
127+ channel: '{channel}'
128+ device: '{device}'
129+ device_channel: '{device_channel}'
130+ builders:
131+ - ubuntu-system-tests-builder
132+ publishers:
133+ - archive:
134+ artifacts: 'results/**/*'
135+ allow-empty: 'true'
136+ - junit:
137+ results: 'results/artifacts/test-results.xml'
138+
139+- job-template:
140+ name: 'ubuntu-system-tests_{release}_{channel}_{device}_{test_level}_freestyle'
141+ description: "Provided for experimentation--e.g. re-running of failed tests--in way that won't contribute to the pass/fail record of the canonical job."
142+ parameters:
143+ - ubuntu-system-tests-parameters:
144+ test_level: '{test_level}'
145+ channel: '{channel}'
146+ device_channel: '{device_channel}'
147+ node: '{device}'
148+ builders:
149+ - ubuntu-system-tests-builder
150+ publishers:
151+ - archive:
152+ artifacts: 'results/**/*'
153+ allow-empty: 'true'
154+ - junit:
155+ results: 'results/artifacts/test-results.xml'
156+
157+- parameter:
158+ name: ubuntu-system-tests-parameters
159+ parameters:
160+ - string:
161+ name: UBUNTU_SYSTEM_TESTS_BRANCH
162+ default: lp:ubuntu-system-tests
163+ description: "Launchpad branch of ubuntu-system-tests from which to run tests."
164+ - string:
165+ name: TESTS_TO_RUN
166+ default: '{test_level}'
167+ description: "List of tests to run, use 'sanity' or 'regression' to run those suites."
168+ - string:
169+ name: LIFEBOAT_BRANCH
170+ default: https://git.launchpad.net/~canonical-hw-cert/lifeboat
171+ description: "Launchpad branch (may be git) of the lifeboat device descriptions."
172+ # Begin flash-device params, TODO: !include these as YAML instead
173+ - string:
174+ name: CHANNEL
175+ default: 'ubuntu-touch/{channel}/{device_channel}'
176+ description: "The given alternate channel will be used if specified."
177+ - string:
178+ name: REVISION
179+ default:
180+ description:
181+ - string:
182+ name: WIZARD
183+ default: "yes"
184+ description: "Run the device setup wizard? 'no' disables."
185+ - string:
186+ name: EDGEINTRO
187+ default: "yes"
188+ description: "Run the device edges intro? 'no' disables."
189+ - string:
190+ name: QA_JENKINS_JOBS_BRANCH
191+ default: lp:qa-jenkins-jobs
192+ description: Launchpad branch of qa-jenkins-jobs scripts.
193+
194+- trigger:
195+ name: ubuntu-system-tests-triggers
196+ triggers:
197+ - pollurl:
198+ cron: 'H/15 * * * *'
199+ polling-node: 'jenkins-slave-2'
200+ urls:
201+ - url: 'http://system-image.ubuntu.com/ubuntu-touch/{channel}/{device_channel}/{device}/index.json.asc'
202+ check-content:
203+ - simple: true
204+
205+- builder:
206+ name: ubuntu-system-tests-builder
207+ builders:
208+ - shell: |
209+
210+ # use plars' lifeboat scripts to get our adb serial
211+ rm -rf lifeboat
212+ git clone $LIFEBOAT_BRANCH lifeboat
213+ export ANDROID_SERIAL=$(./lifeboat/get-device-info serial $NODE_NAME)
214+
215+ rm -rf $WORKSPACE/results
216+ mkdir $WORKSPACE/results
217+ export OUTPUTDIR="$WORKSPACE/results"
218+
219+ rm -rf qa-jenkins-jobs
220+ bzr branch $QA_JENKINS_JOBS_BRANCH qa-jenkins-jobs
221+ cd qa-jenkins-jobs
222+
223+ export UBUNTU_SYSTEM_TESTS_CONFIG_BRANCH="lp:ubuntu-system-tests-config"
224+ export CONFIG_PATH=${WORKSPACE}/ubuntu-system-tests.conf
225+ ./scripts/ubuntu-system-tests/write-config.sh
226+ cat >> $CONFIG_PATH <<EOF
227+ device_serial = $ANDROID_SERIAL
228+ output_dir = $OUTPUTDIR
229+ EOF
230+ cat $CONFIG_PATH
231+
232+ case "$TESTS_TO_RUN" in
233+ "regression")
234+ TESTS_TO_RUN=""
235+ ;;
236+ "sanity")
237+ TESTS_TO_RUN=$(bzr cat "$UBUNTU_SYSTEM_TESTS_BRANCH/test_lists/sanity.tests")
238+ ;;
239+ "")
240+ echo "Please specify tests to run!" >&2
241+ exit 1
242+ ;;
243+ esac
244+
245+ ./scripts/get-recovery-image.sh
246+
247+ recover_device_flash_and_run_tests () {
248+ # NOTE pass in a list of tests to run
249+ ./scripts/recover-device.sh
250+ ./scripts/flash-device.sh
251+ ./scripts/ubuntu-system-tests/run-ubuntu-system-tests.sh "$1"
252+ }
253+ recover_device_flash_and_run_tests "$(echo "$TESTS_TO_RUN")"

Subscribers

People subscribed via source and target branches