Merge lp:~canonical-platform-qa/qa-jenkins-jobs/report-to-practitest into lp:qa-jenkins-jobs

Proposed by Allan LeSage
Status: Merged
Approved by: Max Brustkern
Approved revision: 48
Merged at revision: 40
Proposed branch: lp:~canonical-platform-qa/qa-jenkins-jobs/report-to-practitest
Merge into: lp:qa-jenkins-jobs
Diff against target: 126 lines (+70/-12)
2 files modified
scripts/ubuntu-system-tests/report-results-to-practitest.sh (+49/-0)
ubuntu-system-tests/jobs.yaml (+21/-12)
To merge this branch: bzr merge lp:~canonical-platform-qa/qa-jenkins-jobs/report-to-practitest
Reviewer Review Type Date Requested Status
Max Brustkern (community) Approve
Review via email: mp+288711@code.launchpad.net

Commit message

Report test results to PractiTest.

Description of the change

Report test results to PractiTest.

To post a comment you must log in.
Revision history for this message
Max Brustkern (nuclearbob) wrote :

I think starting the job names with "ubuntu-system-tests" is better since that matches up with the launchpad project name. The other job name changes I like.

Some diff comments. I think one or two things could be cleaner, and I'll be suggesting some packaging-related changes later.

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

Max thanks for your review, I made the one small change you suggested.

We do have to use the qakit from the specific revision for the moment, I want to return to the qakit-packaging project but we do need to get this committed so that we can start reporting results first.

The ust_* renaming is I'm afraid necessary for the moment b/c qakit barfs inexplicably on long path names, or this is the only explanation I'm able to supply, happy to demonstrate, intend to get to the bottom of.

In short yes this is a WIP thanks for your merciful review.

48. By Allan LeSage

TEST_UPPER_LEVEL only consider leading chars.

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 'scripts/ubuntu-system-tests/report-results-to-practitest.sh'
2--- scripts/ubuntu-system-tests/report-results-to-practitest.sh 1970-01-01 00:00:00 +0000
3+++ scripts/ubuntu-system-tests/report-results-to-practitest.sh 2016-03-11 20:58:06 +0000
4@@ -0,0 +1,49 @@
5+#!/bin/bash
6+
7+set -x
8+set -e
9+
10+export SUBUNIT_RESULTS_PATH=$1
11+export TEST_LEVEL=$2
12+export LABEL=$3
13+
14+rm -rf qakit
15+bzr branch lp:qakit -r30
16+cd qakit
17+
18+virtualenv --python=python3 ve3
19+. ve3/bin/activate
20+python3 setup.py develop
21+
22+bzr cat "$UBUNTU_SYSTEM_TESTS_CONFIG_BRANCH/practitest/config.ini" > config.ini
23+
24+upload_system_practitest () {
25+ adb -s $ANDROID_SERIAL shell system-image-cli -i | tr '\r' ' ' > VERSION_INFO
26+ export IMAGE=$(grep "version version" VERSION_INFO | sed 's/^version version: //;s/ $//')
27+ export DEVICE=$(grep "device name" VERSION_INFO | sed 's/^device name: \(.\)/\u\1/;s/ $//')
28+ export RELEASE_NUMBER=$(adb shell lsb_release -rs | tr -d '\r')
29+ export RELEASE_NAME=$(adb shell lsb_release -cs | tr -d '\r')
30+ TEST_LEVEL_LOWER=$1
31+ TEST_LEVEL_UPPER=$(echo $1 | sed 's/^\(.\)/\u\1/')
32+ SUFFIX=$2
33+ SUBUNIT_FILE=$3
34+
35+ if [ $1 = "sanity" ] ; then
36+ export MANUAL="--manual=${TEST_LEVEL_UPPER}/${DEVICE}"
37+ else
38+ export MANUAL=""
39+ fi
40+
41+ subunit-practitest-export $SUBUNIT_FILE create "${TEST_LEVEL_LOWER}-${DEVICE}-${RELEASE_NAME}-${IMAGE}-${SUFFIX}" ${DEVICE} ${TEST_LEVEL_UPPER} ${RELEASE_NUMBER} ${IMAGE} "'$(adb shell system-image-cli -i)'" ${MANUAL}
42+
43+}
44+
45+# this enables HTTP to the outside world (e.g. PractiTest) as managed by IS
46+export https_proxy="https://squid.internal:3128/"
47+
48+# looks like:
49+# upload_system_practitest sanity uk "${WORKSPACE}/foo/test-results.subunit"
50+upload_system_practitest ${TEST_LEVEL} ${LABEL} ${SUBUNIT_RESULTS_PATH}
51+
52+unset https_proxy
53+deactivate
54
55=== modified file 'ubuntu-system-tests/jobs.yaml'
56--- ubuntu-system-tests/jobs.yaml 2016-03-07 18:47:31 +0000
57+++ ubuntu-system-tests/jobs.yaml 2016-03-11 20:58:06 +0000
58@@ -29,14 +29,12 @@
59 device_channel: 'bq-aquaris.en'
60 - arale:
61 device_channel: 'meizu.en'
62- release:
63- - vivid
64 jobs:
65- - 'ubuntu-system-tests_{release}_{channel}_{device}_{test_level}_triggered'
66- - 'ubuntu-system-tests_{release}_{channel}_{device}_{test_level}_freestyle'
67+ - 'ust_{channel}_{device}_{test_level}_PT'
68+ - 'ust_{channel}_{device}_{test_level}'
69
70 - job-template:
71- name: 'ubuntu-system-tests_{release}_{channel}_{device}_{test_level}_triggered'
72+ name: 'ust_{channel}_{device}_{test_level}_PT'
73 description: "Triggered upon image update."
74 parameters:
75 - ubuntu-system-tests-parameters:
76@@ -59,7 +57,7 @@
77 results: 'results/artifacts/test-results.xml'
78
79 - job-template:
80- name: 'ubuntu-system-tests_{release}_{channel}_{device}_{test_level}_freestyle'
81+ name: 'ust_{channel}_{device}_{test_level}'
82 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."
83 parameters:
84 - ubuntu-system-tests-parameters:
85@@ -140,11 +138,10 @@
86
87 rm -rf qa-jenkins-jobs
88 bzr branch $QA_JENKINS_JOBS_BRANCH qa-jenkins-jobs
89- cd qa-jenkins-jobs
90
91 export UBUNTU_SYSTEM_TESTS_CONFIG_BRANCH="lp:ubuntu-system-tests-config"
92 export CONFIG_PATH=${WORKSPACE}/ubuntu-system-tests.conf
93- ./scripts/ubuntu-system-tests/write-config.sh
94+ ./qa-jenkins-jobs/scripts/ubuntu-system-tests/write-config.sh
95 cat >> $CONFIG_PATH <<EOF
96 device_serial = $ANDROID_SERIAL
97 output_dir = $OUTPUTDIR
98@@ -164,12 +161,24 @@
99 ;;
100 esac
101
102- ./scripts/get-recovery-image.sh
103+ ./qa-jenkins-jobs/scripts/get-recovery-image.sh
104
105 recover_device_flash_and_run_tests () {
106 # NOTE pass in a list of tests to run
107- ./scripts/recover-device.sh
108- ./scripts/flash-device.sh
109- ./scripts/ubuntu-system-tests/run-ubuntu-system-tests.sh "$1"
110+ ./qa-jenkins-jobs/scripts/recover-device.sh
111+ ./qa-jenkins-jobs/scripts/flash-device.sh
112+ ./qa-jenkins-jobs/scripts/ubuntu-system-tests/run-ubuntu-system-tests.sh "$1"
113 }
114 recover_device_flash_and_run_tests "$(echo "$TESTS_TO_RUN")"
115+
116+ # default to sanity for testing, TODO: consider exiting if not sanity or regression
117+ case "${TESTS_TO_RUN}" in
118+ "regression")
119+ export TEST_LEVEL=regression
120+ ;;
121+ *)
122+ export TEST_LEVEL=sanity
123+ ;;
124+ esac
125+ # "1SS" is the name of the lab
126+ ./qa-jenkins-jobs/scripts/ubuntu-system-tests/report-results-to-practitest.sh $WORKSPACE/results/artifacts/test-results.subunit $TEST_LEVEL 1SS

Subscribers

People subscribed via source and target branches