Merge lp:~canonical-platform-qa/qa-jenkins-jobs/retrieve-tests-to-run-by-practitest-filter into lp:qa-jenkins-jobs

Proposed by Allan LeSage
Status: Merged
Approved by: Allan LeSage
Approved revision: 167
Merged at revision: 170
Proposed branch: lp:~canonical-platform-qa/qa-jenkins-jobs/retrieve-tests-to-run-by-practitest-filter
Merge into: lp:qa-jenkins-jobs
Diff against target: 99 lines (+36/-35)
2 files modified
jobs/ubuntu-system-tests/ubuntu-system-tests-builder.sh (+36/-14)
scripts/ubuntu-system-tests/run-ubuntu-system-tests.sh (+0/-21)
To merge this branch: bzr merge lp:~canonical-platform-qa/qa-jenkins-jobs/retrieve-tests-to-run-by-practitest-filter
Reviewer Review Type Date Requested Status
Richard Huddie (community) Approve
Max Brustkern (community) Approve
platform-qa-bot continuous-integration Approve
Santiago Baldassin Pending
Review via email: mp+302477@code.launchpad.net

Commit message

Retrieve test lists by PractTest filter.

Description of the change

Instead of using the sanity or regression lists in the ubuntu-system-tests repo, query PractiTest by filter and use tests lists retrieved.

It would be better not to have to use the number of the filter of course, will need a separate fix from ust to do that, adding sbalda and rhuddie as they're involved in.

You can see this working (albeit for a broken build with many test failures) here: https://platform-qa-jenkins.ubuntu.com/job/ust_rc-proposed_krillin_sanity_test_deux/6/consoleFull .

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
Max Brustkern (nuclearbob) wrote :

Makes sense to me.

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

Changes seem ok to me!

review: Approve
167. By Allan LeSage

Merge trunk.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'jobs/ubuntu-system-tests/ubuntu-system-tests-builder.sh'
2--- jobs/ubuntu-system-tests/ubuntu-system-tests-builder.sh 2016-08-09 19:15:10 +0000
3+++ jobs/ubuntu-system-tests/ubuntu-system-tests-builder.sh 2016-08-17 21:02:38 +0000
4@@ -21,18 +21,34 @@
5 EOF
6 cat $CONFIG_PATH
7
8+# let's work in a virtualenv
9+virtualenv --system-site-package --python=python3 ve3
10+. ve3/bin/activate
11+
12+export https_proxy=https://squid.internal:3128/
13+
14+rm -rf ubuntu-system-tests
15+bzr branch $UBUNTU_SYSTEM_TESTS_BRANCH ubuntu-system-tests
16+cd ubuntu-system-tests
17+python3 setup.py develop
18+
19+query_practitest_for_tests_to_run_by_filter () {
20+ python3 -m ubuntu_system_tests.run list --filters filter:$1 --config=$CONFIG_PATH
21+}
22+
23 case "$TESTS_TO_RUN" in
24- "regression")
25- TESTS_TO_RUN=$(bzr cat "$UBUNTU_SYSTEM_TESTS_BRANCH/test_lists/regression.tests" | tr '\n' ' ')
26- ;;
27- "sanity")
28- TESTS_TO_RUN=$(bzr cat "$UBUNTU_SYSTEM_TESTS_BRANCH/test_lists/sanity.tests" | tr '\n' ' ')
29- ;;
30- "")
31- # FIXME: restore error when we're able to install Conditional Build Step plugin!
32- echo "No tests specified, PASS!" >&2
33- exit 0
34- ;;
35+ # yes we magically know the filter numbers
36+ "regression")
37+ TESTS_TO_RUN=$(query_practitest_for_tests_to_run_by_filter 117776)
38+ ;;
39+ "sanity")
40+ TESTS_TO_RUN=$(query_practitest_for_tests_to_run_by_filter 63805)
41+ ;;
42+ "")
43+ # FIXME: restore error when we're able to install Conditional Build Step plugin!
44+ echo "No tests specified, PASS!" >&2
45+ exit 0
46+ ;;
47 esac
48
49 # Jenkins param is a long string, transform to multi-line to do remaining_tests math
50@@ -52,8 +68,12 @@
51 comm -13 <(successfully_run_tests) <(initial_tests_to_run);
52 }
53
54-recover_device_flash_and_run_tests () {
55- ./qa-jenkins-jobs/scripts/ubuntu-system-tests/run-ubuntu-system-tests.sh "$1"
56+run_tests () {
57+ #./qa-jenkins-jobs/scripts/ubuntu-system-tests/run-ubuntu-system-tests.sh "$1"
58+ # setup device
59+ python3 -m ubuntu_system_tests.run setup -n -d -p -u -v --config=$CONFIG_PATH
60+ # run tests
61+ python3 -m ubuntu_system_tests.run run -n -v --config=$CONFIG_PATH "$1"
62 }
63
64 RETRY=0;
65@@ -62,5 +82,7 @@
66 # need to switch back to spaces instead of newlines
67 TESTS_TO_RUN="$(echo $(remaining_tests) | tr '\n' ' ')";
68 echo "Trial number $RETRY with tests $TESTS_TO_RUN";
69- recover_device_flash_and_run_tests "$(echo "$TESTS_TO_RUN")"
70+ run_tests "$(echo "$TESTS_TO_RUN")"
71 done;
72+
73+deactivate # our virtualenv
74
75=== removed file 'scripts/ubuntu-system-tests/run-ubuntu-system-tests.sh'
76--- scripts/ubuntu-system-tests/run-ubuntu-system-tests.sh 2016-06-28 13:24:08 +0000
77+++ scripts/ubuntu-system-tests/run-ubuntu-system-tests.sh 1970-01-01 00:00:00 +0000
78@@ -1,21 +0,0 @@
79-#!/bin/sh
80-set -x
81-set +e
82-
83-export TESTS="$1"
84-
85-# let's work in a virtualenv
86-virtualenv --python=python3 ve3
87-. ve3/bin/activate
88-
89-rm -rf ubuntu-system-tests
90-bzr branch $UBUNTU_SYSTEM_TESTS_BRANCH ubuntu-system-tests
91-cd ubuntu-system-tests
92-
93-python3 setup.py develop
94-# setup device
95-python3 -m ubuntu_system_tests.run setup -n -d -p -u -v --config=$CONFIG_PATH
96-# run tests
97-python3 -m ubuntu_system_tests.run run -n -v --config=$CONFIG_PATH "$TESTS"
98-
99-deactivate # our virtualenv

Subscribers

People subscribed via source and target branches