Merge lp:~kissiel/checkbox/autopilot-testing into lp:checkbox

Proposed by Maciej Kisielewski
Status: Superseded
Proposed branch: lp:~kissiel/checkbox/autopilot-testing
Merge into: lp:checkbox
Diff against target: 460 lines (+108/-136)
15 files modified
checkbox-touch/Makefile (+2/-1)
checkbox-touch/README.rst (+1/-1)
checkbox-touch/build-me (+3/-2)
checkbox-touch/checkbox-touch.qml (+34/-17)
checkbox-touch/checkbox-touch.qmlproject (+1/-1)
checkbox-touch/components/CheckboxTouchApplication.qml (+4/-4)
checkbox-touch/py/checkbox_touch.py (+19/-6)
checkbox-touch/tests/autopilot/autopilot-provider/jobs/autopilot.pxu (+7/-0)
checkbox-touch/tests/autopilot/autopilot-provider/manage.py (+21/-0)
checkbox-touch/tests/autopilot/checkbox_touch/__init__.py (+1/-0)
checkbox-touch/tests/autopilot/checkbox_touch/test_checkbox_touch.py (+12/-0)
checkbox-touch/tests/autopilot/checkbox_touch/test_latch_button.py (+0/-16)
checkbox-touch/tests/autopilot/checkbox_touch/test_manual_intro_page.py (+0/-35)
checkbox-touch/tests/autopilot/checkbox_touch/test_resume_session_screen.py (+0/-52)
checkbox-touch/tests/autopilot/run (+3/-1)
To merge this branch: bzr merge lp:~kissiel/checkbox/autopilot-testing
Reviewer Review Type Date Requested Status
Maciej Kisielewski Approve
Zygmunt Krynicki (community) Approve
Review via email: mp+252731@code.launchpad.net

This proposal supersedes a proposal from 2015-03-09.

This proposal has been superseded by a proposal from 2015-03-22.

Description of the change

This MR lays foundations for autopilot testing for checkbox touch.
Major changes/additions are:

* Addition of Utopic as a target in test-in-lxc
* Addition of per-release requirements provisioning
* Move from main.qml to checkbox-touch.qml as the 'entry point' to CBT
* Add option to run CBT in autopilot-y way

b660802 checkbox-touch: add basic autopilot test
fe8d162 checkbox-touch: add autopilot tests to container-tests
0cff0e5 test-in-lxc: make test-in-lxc run tests on utopic
0e2fb89 checkbox-touch: make autopilot tests fail if autopilot is not installed
15d5bec checkbox-touch: make `make autopilot` run ./get-libs first
1dba042 support: make install-*-dependencies support release-specific packages
86d9f2a checkbox-touch: use absolute paths for autopilot provider
90e5d25 checkbox-touch: make autopilot run CBT with '--autopilot option'
e0f9b84 checkbox-touch: remove old autopilot tests
1e53580 checkbox-touch: make checkbox-touch.qml entry point to the app
bfba415 checkbox-touch: add providersDir to generated settings.json
946e613 checkbox-touch: add --autopilot option to main.qml
37df775 checkbox-touch: make APP_DIR fall back to '.'
b113a33 checkbox-touch: be explicit about where to load providers from

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote : Posted in a previous version of this proposal

Question: The test in lxc containers is what we're running when MR are proposed and this script is only called by the tarmac lander, right? I'm trying to make the difference between the test actually run when building a ppa in a build environment (ppa) from tests run with tarmac in containers.
I ask because I see that you're using lsb_release in a couple of places but IIRC such tool is not available in a build env.

And finally rev 3594, you're mentioning an autopilot provider, do we have such thing in the known providers?

review: Needs Information
Revision history for this message
Maciej Kisielewski (kissiel) wrote : Posted in a previous version of this proposal

> Question: The test in lxc containers is what we're running when MR are
> proposed and this script is only called by the tarmac lander, right?
AFAIK yes. tarmac-verify runs test-in-lxc if TEST_RUNNER is not defined or set to lxc.

> I'm
> trying to make the difference between the test actually run when building a
> ppa in a build environment (ppa) from tests run with tarmac in containers.
> I ask because I see that you're using lsb_release in a couple of places but
> IIRC such tool is not available in a build env.
>
> And finally rev 3594, you're mentioning an autopilot provider, do we have such
> thing in the known providers?

Yeah, even empty autopilot provider is required. I just added it and repushed the branch. Sorry for missing it in original MR.

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote : Posted in a previous version of this proposal

ok, thank for the quick fix.

I've tested it in a VM and it works well (Results here: http://pastebin.ubuntu.com/10579771/)

+1

review: Approve
Revision history for this message
Daniel Manrique (roadmr) wrote : Posted in a previous version of this proposal
Download full text (17.6 KiB)

The attempt to merge lp:~kissiel/checkbox/autopilot-testing into lp:checkbox failed. Below is the output from the failed tests.

[precise] starting container
[precise] (timing) 0.07user 0.02system 0:04.25elapsed 2%CPU (0avgtext+0avgdata 7852maxresident)k
[precise] (timing) 0inputs+32outputs (0major+7006minor)pagefaults 0swaps
[precise] provisioning container
[precise] (timing) 39.58user 12.69system 1:31.80elapsed 56%CPU (0avgtext+0avgdata 51820maxresident)k
[precise] (timing) 0inputs+16424outputs (0major+4479699minor)pagefaults 0swaps
[precise-testing] Starting tests...
Found a test script: ./checkbox-gui/requirements/container-tests-checkbox-gui-build
[precise-testing] container-tests-checkbox-gui-build: PASS
[precise-testing] (timing) 29.34user 2.18system 0:31.93elapsed 98%CPU (0avgtext+0avgdata 116196maxresident)k
[precise-testing] (timing) 0inputs+4240outputs (0major+478802minor)pagefaults 0swaps
Found a test script: ./checkbox-ng/requirements/container-tests-checkbox-ng-unit
[precise-testing] container-tests-checkbox-ng-unit: PASS
[precise-testing] (timing) 0.67user 0.13system 0:00.83elapsed 96%CPU (0avgtext+0avgdata 40976maxresident)k
[precise-testing] (timing) 0inputs+3880outputs (0major+21245minor)pagefaults 0swaps
Found a test script: ./checkbox-support/requirements/container-tests-checkbox-support
[precise-testing] container-tests-checkbox-support: PASS
[precise-testing] (timing) 15.51user 0.18system 0:15.81elapsed 99%CPU (0avgtext+0avgdata 83228maxresident)k
[precise-testing] (timing) 0inputs+1032outputs (0major+31565minor)pagefaults 0swaps
Found a test script: ./checkbox-touch/requirements/container-tests-touch-autopilot
[precise-testing] container-tests-touch-autopilot: PASS
[precise-testing] (timing) 0.02user 0.01system 0:00.05elapsed 67%CPU (0avgtext+0avgdata 4696maxresident)k
[precise-testing] (timing) 0inputs+8outputs (0major+3881minor)pagefaults 0swaps
Found a test script: ./checkbox-touch/requirements/container-tests-touch-unit-tests
[precise-testing] container-tests-touch-unit-tests: PASS
[precise-testing] (timing) 0.00user 0.00system 0:00.02elapsed 28%CPU (0avgtext+0avgdata 2044maxresident)k
[precise-testing] (timing) 0inputs+8outputs (0major+2395minor)pagefaults 0swaps
Found a test script: ./plainbox/plainbox/impl/providers/categories/requirements/container-tests-provider-categories
[precise-testing] container-tests-provider-categories: PASS
[precise-testing] (timing) 0.22user 0.03system 0:00.28elapsed 93%CPU (0avgtext+0avgdata 15356maxresident)k
[precise-testing] (timing) 0inputs+176outputs (0major+6422minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/001-container-tests-plainbox-egg-info
[precise-testing] 001-container-tests-plainbox-egg-info: PASS
[precise-testing] (timing) 0.14user 0.04system 0:00.20elapsed 91%CPU (0avgtext+0avgdata 10544maxresident)k
[precise-testing] (timing) 0inputs+88outputs (0major+5043minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox
[precise-testing] container-tests-plainbox: PASS
[precise-testing] (timing) 12.66user 0.82...

Revision history for this message
Maciej Kisielewski (kissiel) wrote : Posted in a previous version of this proposal

Added 'thumbnailer-service' to utopic-deb-touch requirements.
Self aproving to retry the merge.

Revision history for this message
Daniel Manrique (roadmr) wrote :
Download full text (17.6 KiB)

The attempt to merge lp:~kissiel/checkbox/autopilot-testing into lp:checkbox failed. Below is the output from the failed tests.

[precise] starting container
[precise] (timing) 0.06user 0.03system 0:05.27elapsed 1%CPU (0avgtext+0avgdata 7852maxresident)k
[precise] (timing) 0inputs+32outputs (0major+7502minor)pagefaults 0swaps
[precise] provisioning container
[precise] (timing) 39.96user 12.85system 1:31.60elapsed 57%CPU (0avgtext+0avgdata 51824maxresident)k
[precise] (timing) 0inputs+16424outputs (0major+4488457minor)pagefaults 0swaps
[precise-testing] Starting tests...
Found a test script: ./checkbox-gui/requirements/container-tests-checkbox-gui-build
[precise-testing] container-tests-checkbox-gui-build: PASS
[precise-testing] (timing) 27.69user 2.23system 0:30.31elapsed 98%CPU (0avgtext+0avgdata 116196maxresident)k
[precise-testing] (timing) 0inputs+4240outputs (0major+478807minor)pagefaults 0swaps
Found a test script: ./checkbox-ng/requirements/container-tests-checkbox-ng-unit
[precise-testing] container-tests-checkbox-ng-unit: PASS
[precise-testing] (timing) 0.68user 0.12system 0:00.84elapsed 96%CPU (0avgtext+0avgdata 40976maxresident)k
[precise-testing] (timing) 0inputs+3880outputs (0major+21258minor)pagefaults 0swaps
Found a test script: ./checkbox-support/requirements/container-tests-checkbox-support
[precise-testing] container-tests-checkbox-support: PASS
[precise-testing] (timing) 17.37user 0.10system 0:18.26elapsed 95%CPU (0avgtext+0avgdata 83096maxresident)k
[precise-testing] (timing) 0inputs+1032outputs (0major+31454minor)pagefaults 0swaps
Found a test script: ./checkbox-touch/requirements/container-tests-touch-autopilot
[precise-testing] container-tests-touch-autopilot: PASS
[precise-testing] (timing) 0.01user 0.02system 0:00.05elapsed 69%CPU (0avgtext+0avgdata 4696maxresident)k
[precise-testing] (timing) 0inputs+8outputs (0major+3875minor)pagefaults 0swaps
Found a test script: ./checkbox-touch/requirements/container-tests-touch-unit-tests
[precise-testing] container-tests-touch-unit-tests: PASS
[precise-testing] (timing) 0.00user 0.00system 0:00.02elapsed 42%CPU (0avgtext+0avgdata 2044maxresident)k
[precise-testing] (timing) 0inputs+8outputs (0major+2390minor)pagefaults 0swaps
Found a test script: ./plainbox/plainbox/impl/providers/categories/requirements/container-tests-provider-categories
[precise-testing] container-tests-provider-categories: PASS
[precise-testing] (timing) 0.20user 0.05system 0:00.28elapsed 92%CPU (0avgtext+0avgdata 15356maxresident)k
[precise-testing] (timing) 0inputs+176outputs (0major+6420minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/001-container-tests-plainbox-egg-info
[precise-testing] 001-container-tests-plainbox-egg-info: PASS
[precise-testing] (timing) 0.15user 0.06system 0:00.23elapsed 92%CPU (0avgtext+0avgdata 10548maxresident)k
[precise-testing] (timing) 0inputs+88outputs (0major+5051minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox
[precise-testing] container-tests-plainbox: PASS
[precise-testing] (timing) 12.78user 0.85...

Revision history for this message
Maciej Kisielewski (kissiel) wrote :

Disabled GLX for autopilot tests.

Revision history for this message
Daniel Manrique (roadmr) wrote :
Download full text (17.6 KiB)

The attempt to merge lp:~kissiel/checkbox/autopilot-testing into lp:checkbox failed. Below is the output from the failed tests.

[precise] starting container
[precise] (timing) 0.05user 0.03system 0:05.22elapsed 1%CPU (0avgtext+0avgdata 7860maxresident)k
[precise] (timing) 0inputs+32outputs (0major+7495minor)pagefaults 0swaps
[precise] provisioning container
[precise] (timing) 39.59user 11.16system 1:37.06elapsed 52%CPU (0avgtext+0avgdata 51820maxresident)k
[precise] (timing) 0inputs+16424outputs (0major+4503355minor)pagefaults 0swaps
[precise-testing] Starting tests...
Found a test script: ./checkbox-gui/requirements/container-tests-checkbox-gui-build
[precise-testing] container-tests-checkbox-gui-build: PASS
[precise-testing] (timing) 29.82user 2.02system 0:32.24elapsed 98%CPU (0avgtext+0avgdata 116196maxresident)k
[precise-testing] (timing) 0inputs+4240outputs (0major+478818minor)pagefaults 0swaps
Found a test script: ./checkbox-ng/requirements/container-tests-checkbox-ng-unit
[precise-testing] container-tests-checkbox-ng-unit: PASS
[precise-testing] (timing) 0.56user 0.13system 0:00.95elapsed 73%CPU (0avgtext+0avgdata 40976maxresident)k
[precise-testing] (timing) 0inputs+3880outputs (0major+21271minor)pagefaults 0swaps
Found a test script: ./checkbox-support/requirements/container-tests-checkbox-support
[precise-testing] container-tests-checkbox-support: PASS
[precise-testing] (timing) 15.48user 0.12system 0:16.07elapsed 97%CPU (0avgtext+0avgdata 83112maxresident)k
[precise-testing] (timing) 0inputs+1032outputs (0major+31565minor)pagefaults 0swaps
Found a test script: ./checkbox-touch/requirements/container-tests-touch-autopilot
[precise-testing] container-tests-touch-autopilot: PASS
[precise-testing] (timing) 0.02user 0.01system 0:00.05elapsed 66%CPU (0avgtext+0avgdata 4692maxresident)k
[precise-testing] (timing) 0inputs+8outputs (0major+3882minor)pagefaults 0swaps
Found a test script: ./checkbox-touch/requirements/container-tests-touch-unit-tests
[precise-testing] container-tests-touch-unit-tests: PASS
[precise-testing] (timing) 0.00user 0.00system 0:00.03elapsed 35%CPU (0avgtext+0avgdata 2044maxresident)k
[precise-testing] (timing) 0inputs+8outputs (0major+2388minor)pagefaults 0swaps
Found a test script: ./plainbox/plainbox/impl/providers/categories/requirements/container-tests-provider-categories
[precise-testing] container-tests-provider-categories: PASS
[precise-testing] (timing) 0.18user 0.06system 0:00.27elapsed 93%CPU (0avgtext+0avgdata 15360maxresident)k
[precise-testing] (timing) 0inputs+176outputs (0major+6416minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/001-container-tests-plainbox-egg-info
[precise-testing] 001-container-tests-plainbox-egg-info: PASS
[precise-testing] (timing) 0.14user 0.04system 0:00.19elapsed 90%CPU (0avgtext+0avgdata 10548maxresident)k
[precise-testing] (timing) 0inputs+88outputs (0major+5048minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox
[precise-testing] container-tests-plainbox: PASS
[precise-testing] (timing) 12.13user 0.78...

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Please rebase, also look at two inline comments below.

3624. By Maciej Kisielewski

checkbox-touch: be explicit about where to load providers from

This patch makes all chain of calls responsible for loading providers in
Checkbox-Touch explicit about the path from which to load providers from.
This paves the way for autopilot provider to be loaded on the side of normal
providers.

Signed-off-by: Maciej Kisielewski <email address hidden>

3625. By Maciej Kisielewski

checkbox-touch: make APP_DIR fall back to '.'

This patch makes Checkbox-Touch expand APP_DIR envvar to '.' when it's absent.
This makes loading of local providers on desktop work as expected.
Signed-off-by: Maciej Kisielewski <email address hidden>

3626. By Maciej Kisielewski

checkbox-touch: add --autopilot option to main.qml

This patch adds an option to run Checkbox-Touch in autopilot mode, that changes
path from which providers are loaded and preselects autopilot testplan.

Signed-off-by: Maciej Kisielewski <email address hidden>

3627. By Maciej Kisielewski

checkbox-touch: add providersDir to generated settings.json

Signed-off-by: Maciej Kisielewski <email address hidden>

3628. By Maciej Kisielewski

checkbox-touch: remove checkbox-touch.qml symlink

Signed-off-by: Maciej Kisielewski <email address hidden>

3629. By Maciej Kisielewski

checkbox-touch: rename main.qml to checkbox-touch.qml

Signed-off-by: Maciej Kisielewski <email address hidden>

3630. By Maciej Kisielewski

checkbox-touch: make checkbox-touch.qml entry point to the app

This patch changes main file to be checkbox-touch.qml instead of main.
Except the obvious improvement, which is clarity, it makes it compliant with
the default behaviour autopilot takes when trying to launch app.

Signed-off-by: Maciej Kisielewski <email address hidden>

3631. By Maciej Kisielewski

checkbox-touch: remove old autopilot tests

Signed-off-by: Maciej Kisielewski <email address hidden>

3632. By Maciej Kisielewski

checkbox-touch: make autopilot run CBT with '--autopilot option'

This patch makes autopilot tests run Checkbox-Touch with '--autopilot' option
by default.

Signed-off-by: Maciej Kisielewski <email address hidden>

3633. By Maciej Kisielewski

checkbox-touch: use absolute paths for autopilot provider

This patch makes Checkbox-Touch use correct absolute path when building path to
autopilot provider files.

Signed-off-by: Maciej Kisielewski <email address hidden>

3634. By Maciej Kisielewski

checkbox-touch: make `make autopilot` run ./get-libs first

Signed-off-by: Maciej Kisielewski <email address hidden>

3635. By Maciej Kisielewski

checkbox-touch: make autopilot tests fail if autopilot is not installed

This patch fixes a false positive feedback when runnning autopilot without
having it installed.

Signed-off-by: Maciej Kisielewski <email address hidden>

3636. By Maciej Kisielewski

checkbox-touch: add autopilot provider

This patch adds empty provider that is used when running autopilot tests. All
future autopilot scenarios should base on jobs defined in this provider.

Signed-off-by: Maciej Kisielewski <email address hidden>

3637. By Maciej Kisielewski

checkbox-touch: add basic autopilot test

This patch adds an autopilot test that checks if app can be launched.

Signed-off-by: Maciej Kisielewski <email address hidden>

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

+1, thanks, looking forward towards resolving infrastructure issues to see all your work in practice!

review: Approve
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

self-approving to push this to merging

review: Approve

Unmerged revisions

3637. By Maciej Kisielewski

checkbox-touch: add basic autopilot test

This patch adds an autopilot test that checks if app can be launched.

Signed-off-by: Maciej Kisielewski <email address hidden>

3636. By Maciej Kisielewski

checkbox-touch: add autopilot provider

This patch adds empty provider that is used when running autopilot tests. All
future autopilot scenarios should base on jobs defined in this provider.

Signed-off-by: Maciej Kisielewski <email address hidden>

3635. By Maciej Kisielewski

checkbox-touch: make autopilot tests fail if autopilot is not installed

This patch fixes a false positive feedback when runnning autopilot without
having it installed.

Signed-off-by: Maciej Kisielewski <email address hidden>

3634. By Maciej Kisielewski

checkbox-touch: make `make autopilot` run ./get-libs first

Signed-off-by: Maciej Kisielewski <email address hidden>

3633. By Maciej Kisielewski

checkbox-touch: use absolute paths for autopilot provider

This patch makes Checkbox-Touch use correct absolute path when building path to
autopilot provider files.

Signed-off-by: Maciej Kisielewski <email address hidden>

3632. By Maciej Kisielewski

checkbox-touch: make autopilot run CBT with '--autopilot option'

This patch makes autopilot tests run Checkbox-Touch with '--autopilot' option
by default.

Signed-off-by: Maciej Kisielewski <email address hidden>

3631. By Maciej Kisielewski

checkbox-touch: remove old autopilot tests

Signed-off-by: Maciej Kisielewski <email address hidden>

3630. By Maciej Kisielewski

checkbox-touch: make checkbox-touch.qml entry point to the app

This patch changes main file to be checkbox-touch.qml instead of main.
Except the obvious improvement, which is clarity, it makes it compliant with
the default behaviour autopilot takes when trying to launch app.

Signed-off-by: Maciej Kisielewski <email address hidden>

3629. By Maciej Kisielewski

checkbox-touch: rename main.qml to checkbox-touch.qml

Signed-off-by: Maciej Kisielewski <email address hidden>

3628. By Maciej Kisielewski

checkbox-touch: remove checkbox-touch.qml symlink

Signed-off-by: Maciej Kisielewski <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-touch/Makefile'
2--- checkbox-touch/Makefile 2014-08-11 14:20:37 +0000
3+++ checkbox-touch/Makefile 2015-03-20 13:15:31 +0000
4@@ -11,6 +11,7 @@
5 all:
6
7 autopilot:
8+ ./get-libs
9 chmod +x tests/autopilot/run
10 tests/autopilot/run
11
12@@ -18,5 +19,5 @@
13 qmltestrunner -input tests/unit
14
15 run:
16- /usr/bin/qmlscene $@ main.qml
17+ /usr/bin/qmlscene $@ checkbox-touch.qml
18
19
20=== modified file 'checkbox-touch/README.rst'
21--- checkbox-touch/README.rst 2014-12-03 15:05:34 +0000
22+++ checkbox-touch/README.rst 2015-03-20 13:15:31 +0000
23@@ -56,7 +56,7 @@
24 Running Checkbox-Touch on a desktop
25 -----------------------------------
26
27-To run on a desktop run `qmlscene main.qml`
28+To run on a desktop run `qmlscene checkbox-touch.qml`
29 Note: Make sure you've ran `./get-libs` first.
30
31
32
33=== modified file 'checkbox-touch/build-me'
34--- checkbox-touch/build-me 2015-03-13 14:21:40 +0000
35+++ checkbox-touch/build-me 2015-03-20 13:15:31 +0000
36@@ -80,7 +80,8 @@
37 "_comment": "file generated automatically with {0}"
38 .format(parser.prog),
39 "revision": get_revision_string(),
40- "testplan": args.testplan
41+ "testplan": args.testplan,
42+ "providersDir": "providers"
43 }
44 settings_file = open('settings.json', 'w')
45 settings_file.write(json.dumps(settings, sort_keys=True, indent=4))
46@@ -115,7 +116,7 @@
47 [Desktop Entry]
48 Name=Checkbox
49 Comment=System testing utility for Ubuntu
50- Exec=qmlscene {import_options} $@ main.qml
51+ Exec=qmlscene {import_options} $@ checkbox-touch.qml
52 Icon=checkbox-touch.svg
53 Terminal=false
54 Type=Application
55
56=== removed symlink 'checkbox-touch/checkbox-touch.qml'
57=== target was u'preview.qml'
58=== renamed file 'checkbox-touch/main.qml' => 'checkbox-touch/checkbox-touch.qml'
59--- checkbox-touch/main.qml 2015-02-09 14:19:48 +0000
60+++ checkbox-touch/checkbox-touch.qml 2015-03-20 13:15:31 +0000
61@@ -57,24 +57,41 @@
62 property var appSettings: {
63 "applicationName" : applicationName,
64 "revision": "unknown revision",
65- "testplan": ""
66+ "testplan": "",
67+ "providersDir": "providers"
68+ }
69+
70+ Arguments {
71+ id: args
72+ Argument {
73+ name: "autopilot"
74+ help: i18n.tr("Run Checkbox-Touch in autopilot-testing mode")
75+ required: false
76+ }
77 }
78
79 Component.onCompleted: {
80- var xhr = new XMLHttpRequest;
81- xhr.open("GET", "settings.json");
82- xhr.onreadystatechange = function() {
83- if (xhr.readyState == XMLHttpRequest.DONE) {
84- try {
85- appSettings = JSON.parse(xhr.responseText);
86- } catch (x) {
87- // if we cannot parse settings.json, we should leave
88- // deafult values of appSettings
89- console.log("Could not parse settings.json. Using default values")
90+ if (args.values["autopilot"]) {
91+ // autopilot-testing mode
92+ appSettings["testplan"] = "2015.com.canonical.certification::checkbox-touch-autopilot"
93+ appSettings["providersDir"] = "tests/autopilot/autopilot-provider"
94+ } else {
95+ // normal execution - load settings.json file
96+ var xhr = new XMLHttpRequest;
97+ xhr.open("GET", "settings.json");
98+ xhr.onreadystatechange = function() {
99+ if (xhr.readyState == XMLHttpRequest.DONE) {
100+ try {
101+ appSettings = JSON.parse(xhr.responseText);
102+ } catch (x) {
103+ // if we cannot parse settings.json, we should leave
104+ // deafult values of appSettings
105+ console.log("Could not parse settings.json. Using default values")
106+ }
107 }
108 }
109+ xhr.send();
110 }
111- xhr.send();
112 }
113
114
115@@ -115,7 +132,7 @@
116 "checkbox_touch" : applicationVersion,
117 "plainbox" : plainboxVersion
118 };
119- resumeOrStartSession();
120+ resumeOrStartSession(appSettings["providersDir"]);
121 }
122 onSessionReady: {
123 welcomePage.enableButton()
124@@ -223,7 +240,7 @@
125 onRestartSession: {
126 pageStack.clear();
127 pageStack.push(welcomePage);
128- app.startSession();
129+ app.startSession(appSettings["providersDir"]);
130 }
131 }
132
133@@ -310,10 +327,10 @@
134 } else {
135 if (result.errors_encountered) {
136 ErrorLogic.showError(mainView, i18n.tr("Could not resume session."),
137- app.startSession(),
138+ app.startSession(appSettings["providersDir"]),
139 i18n.tr("Start new session"));
140 } else {
141- app.startSession();
142+ app.startSession(appSettings["providersDir"]);
143 }
144 }
145 });
146@@ -363,7 +380,7 @@
147 resultsPage.endTesting.connect(function() {
148 pageStack.clear();
149 app.clearSession(function() {
150- app.startSession();
151+ app.startSession(appSettings["providersDir"]);
152 pageStack.push(welcomePage);
153 });
154 });
155
156=== modified file 'checkbox-touch/checkbox-touch.qmlproject'
157--- checkbox-touch/checkbox-touch.qmlproject 2014-08-12 18:58:43 +0000
158+++ checkbox-touch/checkbox-touch.qmlproject 2015-03-20 13:15:31 +0000
159@@ -1,7 +1,7 @@
160 import QmlProject 1.1
161
162 Project {
163- mainFile: "main.qml"
164+ mainFile: "checkbox-touch.qml"
165
166 /* Include .qml, .js, and image files from current directory and subdirectories */
167 QmlFiles {
168
169=== modified file 'checkbox-touch/components/CheckboxTouchApplication.qml'
170--- checkbox-touch/components/CheckboxTouchApplication.qml 2015-03-13 14:21:45 +0000
171+++ checkbox-touch/components/CheckboxTouchApplication.qml 2015-03-20 13:15:31 +0000
172@@ -44,16 +44,16 @@
173 // Starts session in plainbox and runs all necessary setup actions.
174 // Calling this function will signal sessionReady() once it's finished
175 // doing setup.
176- function startSession() {
177- request("start_session", [], function(result) {
178+ function startSession(providersDir) {
179+ request("start_session", [providersDir], function(result) {
180 sessionDir = result['session_dir'];
181 sessionReady();
182 }, function(error) {
183 console.error("Unable to start session: " + error);
184 });
185 }
186- function resumeSession(rerunLastTest, continuation) {
187- request("resume_session", [rerunLastTest], function(result) {
188+ function resumeSession(rerunLastTest, providersDir, continuation) {
189+ request("resume_session", [rerunLastTest, providersDir], function(result) {
190 if (!result["session_id"]) {
191 pageStack.pop();
192 ErrorLogic.showError(mainView,
193
194=== modified file 'checkbox-touch/py/checkbox_touch.py'
195--- checkbox-touch/py/checkbox_touch.py 2015-03-13 14:21:45 +0000
196+++ checkbox-touch/py/checkbox_touch.py 2015-03-20 13:15:31 +0000
197@@ -351,7 +351,7 @@
198 }
199
200 @view
201- def start_session(self):
202+ def start_session(self, providers_dir):
203 if self.manager is not None:
204 _logger.warning("start_session() should not be called twice!")
205 else:
206@@ -360,7 +360,7 @@
207 self.manager.add_local_device_context()
208 self.context = self.manager.default_device_context
209 # Add some all providers into the context
210- for provider in self._get_default_providers():
211+ for provider in self._get_default_providers(providers_dir):
212 self.context.add_provider(provider)
213 # Fill in the meta-data
214 self.context.state.metadata.app_id = 'checkbox-touch'
215@@ -386,9 +386,10 @@
216 }
217
218 @view
219- def resume_session(self, rerun_last_test):
220+ def resume_session(self, rerun_last_test, providers_dir):
221 all_units = list(itertools.chain(
222- *[p.unit_list for p in self._get_default_providers()]))
223+ *[p.unit_list for p in self._get_default_providers(
224+ providers_dir)]))
225 try:
226 self.manager = SessionManager.load_session(
227 all_units, self.resume_candidate_storage)
228@@ -772,12 +773,24 @@
229 self.session_storage_repo = SessionStorageRepository(
230 self._get_app_cache_directory())
231
232- def _get_default_providers(self):
233+ def _get_default_providers(self, providers_dir):
234+ """
235+ Get providers
236+
237+ :param providers_dir:
238+ Path within application tree from which to load providers
239+ :returns:
240+ list of loaded providers
241+ """
242 all_providers.load()
243 provider_list = all_providers.get_all_plugin_objects()
244 # when running on ubuntu-touch device, APP_DIR env var is present
245 # and points to touch application top directory
246- path = os.path.join(os.path.expandvars('$APP_DIR'), 'providers')
247+ app_root_dir = os.path.normpath(os.getenv(
248+ 'APP_DIR', os.path.join(os.path.dirname(__file__), '..')))
249+ path = os.path.join(app_root_dir,
250+ os.path.normpath(providers_dir))
251+ _logger.info("Loading all providers from %s", path)
252 if os.path.exists(path):
253 embedded_providers = EmbeddedProvider1PlugInCollection(path)
254 provider_list += embedded_providers.get_all_plugin_objects()
255
256=== added directory 'checkbox-touch/tests/autopilot/autopilot-provider'
257=== added directory 'checkbox-touch/tests/autopilot/autopilot-provider/jobs'
258=== added file 'checkbox-touch/tests/autopilot/autopilot-provider/jobs/autopilot.pxu'
259--- checkbox-touch/tests/autopilot/autopilot-provider/jobs/autopilot.pxu 1970-01-01 00:00:00 +0000
260+++ checkbox-touch/tests/autopilot/autopilot-provider/jobs/autopilot.pxu 2015-03-20 13:15:31 +0000
261@@ -0,0 +1,7 @@
262+unit: test plan
263+_description:
264+ Test plan that should be default one run by autopilot.
265+id: checkbox-touch-autopilot
266+_name: Checkbox-Touch autpoilot self-test
267+estimated_duration: 60
268+include: autopilot/.*
269
270=== added file 'checkbox-touch/tests/autopilot/autopilot-provider/manage.py'
271--- checkbox-touch/tests/autopilot/autopilot-provider/manage.py 1970-01-01 00:00:00 +0000
272+++ checkbox-touch/tests/autopilot/autopilot-provider/manage.py 2015-03-20 13:15:31 +0000
273@@ -0,0 +1,21 @@
274+#!/usr/bin/env python3
275+from plainbox.provider_manager import setup, N_
276+
277+# You can inject other stuff here but please don't go overboard.
278+#
279+# In particular, if you need comprehensive compilation support to get
280+# your bin/ populated then please try to discuss that with us in the
281+# upstream project IRC channel #checkbox on irc.freenode.net.
282+
283+# NOTE: one thing that you could do here, that makes a lot of sense,
284+# is to compute version somehow. This may vary depending on the
285+# context of your provider. Future version of PlainBox will offer git,
286+# bzr and mercurial integration using the versiontools library
287+# (optional)
288+
289+setup(
290+ name='2015.com.canonical.certification:autopilot-touch',
291+ version="1.0",
292+ description=N_("The 2015.com.canonical.certification:autopilot-touch provider"),
293+ gettext_domain="2015_com_canonical_certification_autopilot-touch",
294+)
295\ No newline at end of file
296
297=== modified file 'checkbox-touch/tests/autopilot/checkbox_touch/__init__.py'
298--- checkbox-touch/tests/autopilot/checkbox_touch/__init__.py 2014-08-11 12:36:57 +0000
299+++ checkbox-touch/tests/autopilot/checkbox_touch/__init__.py 2015-03-20 13:15:31 +0000
300@@ -47,6 +47,7 @@
301 base.get_qmlscene_launch_command(),
302 '-I' + _get_module_include_path(),
303 app_qml_source_location,
304+ '--autopilot',
305 app_type='qt',
306 emulator_base=emulators.UbuntuUIToolkitEmulatorBase)
307 else:
308
309=== added file 'checkbox-touch/tests/autopilot/checkbox_touch/test_checkbox_touch.py'
310--- checkbox-touch/tests/autopilot/checkbox_touch/test_checkbox_touch.py 1970-01-01 00:00:00 +0000
311+++ checkbox-touch/tests/autopilot/checkbox_touch/test_checkbox_touch.py 2015-03-20 13:15:31 +0000
312@@ -0,0 +1,12 @@
313+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
314+
315+from testtools.matchers import Equals
316+from autopilot.matchers import Eventually
317+
318+import checkbox_touch
319+
320+class TestCheckboxTouch(checkbox_touch.ClickAppTestCase):
321+ """Test checking if app launches"""
322+ def test_launches(self):
323+ main_view = self.app.select_single(objectName='mainView')
324+ self.assertThat(main_view.visible, Eventually(Equals(True)))
325
326=== removed file 'checkbox-touch/tests/autopilot/checkbox_touch/test_latch_button.py'
327--- checkbox-touch/tests/autopilot/checkbox_touch/test_latch_button.py 2014-09-11 08:09:35 +0000
328+++ checkbox-touch/tests/autopilot/checkbox_touch/test_latch_button.py 1970-01-01 00:00:00 +0000
329@@ -1,16 +0,0 @@
330-# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
331-
332-from testtools.matchers import Equals
333-
334-import checkbox_touch
335-
336-
337-class LatchButtonTestCase(checkbox_touch.ClickAppTestCase):
338- """Tests for the LatchButton component"""
339- def test_latching(self):
340- latch_button = self.app.select_single(objectName="latchButton")
341- latch_button.swipe_into_view()
342- signal = latch_button.watch_signal("latchedClicked()")
343- self.pointing_device.click_object(latch_button)
344- self.pointing_device.click_object(latch_button) # click again!
345- self.assertThat(signal.num_emissions, Equals(1))
346
347=== removed file 'checkbox-touch/tests/autopilot/checkbox_touch/test_manual_intro_page.py'
348--- checkbox-touch/tests/autopilot/checkbox_touch/test_manual_intro_page.py 2014-09-11 08:09:35 +0000
349+++ checkbox-touch/tests/autopilot/checkbox_touch/test_manual_intro_page.py 1970-01-01 00:00:00 +0000
350@@ -1,35 +0,0 @@
351-# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
352-
353-from testtools.matchers import Equals
354-
355-import checkbox_touch
356-
357-
358-class ManualIntroPageTestCase(checkbox_touch.ClickAppTestCase):
359- """Tests for the Intro page to Manual test"""
360-
361- def setUp(self):
362- super(ManualIntroPageTestCase, self).setUp()
363- # open ManualIntroPage by clicking on 'Manual test page' butotn
364- button = self.main_view.select_single(
365- objectName='manualIntroPageButton')
366- self.pointing_device.click_object(button)
367- self.page = self.app.select_single(objectName='manualIntroPage')
368-
369- def test_default_content(self):
370- self.assertThat(self.page.title, Equals('Test Description'))
371-
372- def test_continue_button(self):
373- continue_button = self.page.select_single(objectName='continueButton')
374- self.assertThat(continue_button.text, Equals('Continue'))
375- signal = self.page.watch_signal('continueClicked()')
376- self.pointing_device.click_object(continue_button)
377- self.assertThat(signal.was_emitted, Equals(True))
378-
379- def test_goes_to_verification(self):
380- continue_button = self.page.select_single(objectName='continueButton')
381- self.pointing_device.click_object(continue_button)
382- next_page = self.app.select_single(objectName='testVerificationPage')
383- self.assertThat(next_page.title, Equals('Verification'))
384- page_stack = self.main_view.select_single(objectName='pageStack')
385- self.assertThat(page_stack.depth, Equals(3))
386
387=== removed file 'checkbox-touch/tests/autopilot/checkbox_touch/test_resume_session_screen.py'
388--- checkbox-touch/tests/autopilot/checkbox_touch/test_resume_session_screen.py 2014-09-11 08:09:35 +0000
389+++ checkbox-touch/tests/autopilot/checkbox_touch/test_resume_session_screen.py 1970-01-01 00:00:00 +0000
390@@ -1,52 +0,0 @@
391-# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
392-
393-"""Tests for the Hello World"""
394-
395-from testtools.matchers import Equals
396-
397-import checkbox_touch
398-
399-
400-class ResumeSessionScreenTestCase(checkbox_touch.ClickAppTestCase):
401- """Tests for resume session screen"""
402-
403- def setUp(self):
404- super(ResumeSessionScreenTestCase, self).setUp()
405- # click "resume session page"
406- button = self.main_view.select_single(
407- objectName='resumeSessionPageButton')
408- self.pointing_device.click_object(button)
409- self.page = self.app.select_single(objectName='resumeSessionPage')
410-
411- def test_default_content(self):
412- self.assertThat(self.page.title, Equals('Resume session'))
413- button_texts = [('rerunButtonLabel', 'Rerun last'),
414- ('continueButtonLabel', 'Continue'),
415- ('restartButtonLabel', 'Restart')]
416- for obj_name, text in button_texts:
417- obj = self.main_view.select_single(objectName=obj_name)
418- self.assertThat(obj.text, Equals(text))
419-
420- def test_signal_rerun_last(self):
421- signal_watcher = self.page.watch_signal('rerunLast()')
422- button = self.main_view.select_single(objectName='rerunButton')
423- self.pointing_device.click_object(button)
424- self.assertThat(signal_watcher.was_emitted, Equals(True))
425- page_stack = self.main_view.select_single(objectName='pageStack')
426- self.assertThat(page_stack.depth, Equals(1))
427-
428- def test_signal_continue_session(self):
429- signal_watcher = self.page.watch_signal('continueSession()')
430- button = self.main_view.select_single(objectName='continueButton')
431- self.pointing_device.click_object(button)
432- self.assertThat(signal_watcher.was_emitted, Equals(True))
433- page_stack = self.main_view.select_single(objectName='pageStack')
434- self.assertThat(page_stack.depth, Equals(1))
435-
436- def test_signal_restart_session(self):
437- signal_watcher = self.page.watch_signal('restartSession()')
438- button = self.main_view.select_single(objectName='restartButton')
439- self.pointing_device.click_object(button)
440- self.assertThat(signal_watcher.was_emitted, Equals(True))
441- page_stack = self.main_view.select_single(objectName='pageStack')
442- self.assertThat(page_stack.depth, Equals(1))
443
444=== modified file 'checkbox-touch/tests/autopilot/run'
445--- checkbox-touch/tests/autopilot/run 2014-08-11 12:36:57 +0000
446+++ checkbox-touch/tests/autopilot/run 2015-03-20 13:15:31 +0000
447@@ -2,11 +2,13 @@
448
449 if [[ -z `which autopilot` ]]; then
450 echo "Autopilot is not installed. Skip"
451- exit
452+ exit 1
453 fi
454
455 SCRIPTPATH=`dirname $0`
456 pushd ${SCRIPTPATH}
457 autopilot run checkbox_touch
458+ret=$?
459 popd
460+exit $ret
461

Subscribers

People subscribed via source and target branches