Merge lp:~kissiel/checkbox/checkbox-touch-cleanup into lp:checkbox

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 3826
Merged at revision: 3856
Proposed branch: lp:~kissiel/checkbox/checkbox-touch-cleanup
Merge into: lp:checkbox
Diff against target: 507 lines (+0/-477)
5 files modified
checkbox-touch/components/HelloComponent.qml (+0/-15)
checkbox-touch/components/ScreensPreviewPage.qml (+0/-237)
checkbox-touch/preview.qml (+0/-65)
checkbox-touch/py/checkbox_touch.py (+0/-110)
checkbox-touch/tests/unit/tst_hellocomponent.qml (+0/-50)
To merge this branch: bzr merge lp:~kissiel/checkbox/checkbox-touch-cleanup
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Zygmunt Krynicki (community) Approve
Review via email: mp+260582@code.launchpad.net

Description of the change

This MR removes some unused bits from the Checkbox-Touch.

6827eae checkbox-touch: remove FakeCheckboxTouchApplication
2d4d959 checkbox-touch: remove HelloComponent
8504c0f checkbox-touch: remove screens preview page

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

+1, thanks

review: Approve
Revision history for this message
Daniel Manrique (roadmr) wrote :

Attempt to merge into lp:checkbox failed due to conflicts:

text conflict in checkbox-touch/py/checkbox_touch.py

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

Self-approving, as the only change after Zygmunt's review was a simple rebase.

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

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

[precise] starting container
[precise] (timing) 0.06user 0.01system 0:05.22elapsed 1%CPU (0avgtext+0avgdata 7848maxresident)k
[precise] (timing) 0inputs+32outputs (0major+7529minor)pagefaults 0swaps
[precise] provisioning container
[precise] (timing) 46.65user 14.74system 1:39.52elapsed 61%CPU (0avgtext+0avgdata 52404maxresident)k
[precise] (timing) 0inputs+19176outputs (0major+6475307minor)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) 28.25user 2.14system 0:30.71elapsed 98%CPU (0avgtext+0avgdata 116644maxresident)k
[precise-testing] (timing) 0inputs+4264outputs (0major+478500minor)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.64user 0.14system 0:00.83elapsed 94%CPU (0avgtext+0avgdata 42864maxresident)k
[precise-testing] (timing) 0inputs+1528outputs (0major+21620minor)pagefaults 0swaps
Found a test script: ./checkbox-support/requirements/container-tests-checkbox-support
[precise-testing] container-tests-checkbox-support: PASS
[precise-testing] (timing) 16.97user 0.16system 0:17.61elapsed 97%CPU (0avgtext+0avgdata 84236maxresident)k
[precise-testing] (timing) 0inputs+1312outputs (0major+31841minor)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 53%CPU (0avgtext+0avgdata 2044maxresident)k
[precise-testing] (timing) 0inputs+8outputs (0major+2383minor)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) 1.34user 0.09system 0:01.47elapsed 97%CPU (0avgtext+0avgdata 49672maxresident)k
[precise-testing] (timing) 0inputs+40outputs (0major+15020minor)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.03system 0:00.20elapsed 92%CPU (0avgtext+0avgdata 10588maxresident)k
[precise-testing] (timing) 0inputs+88outputs (0major+5046minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox
[precise-testing] container-tests-plainbox: PASS
[precise-testing] (timing) 32.86user 1.26system 0:34.46elapsed 99%CPU (0avgtext+0avgdata 134856maxresident)k
[precise-testing] (timing) 0inputs+3016outputs (0major+161950minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox-documentation
[precise-testing] container-tests-plainbox-documentation: PASS
[precise-testing] (t...

3825. By Maciej Kisielewski

checkbox-touch: remove HelloComponent

This patch removes boilerplate component that was generated by SDK's wizard.
It's about time :)

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

3826. By Maciej Kisielewski

checkbox-touch: remove screens preview page

This patch removes 'alternative' way of lunching the app, where user could see
individual components. This component - ScreensPreviewPage got stale and no one
used it, so this commit ends its existance.

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

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'checkbox-touch/components/HelloComponent.qml'
--- checkbox-touch/components/HelloComponent.qml 2014-08-11 12:29:41 +0000
+++ checkbox-touch/components/HelloComponent.qml 1970-01-01 00:00:00 +0000
@@ -1,15 +0,0 @@
1import QtQuick 2.0
2import Ubuntu.Components 0.1
3
4UbuntuShape {
5 width: 200
6 height: width
7
8 property alias text : myText.text
9
10 Label {
11 id: myText
12 anchors.centerIn: parent
13 }
14}
15
160
=== removed file 'checkbox-touch/components/ScreensPreviewPage.qml'
--- checkbox-touch/components/ScreensPreviewPage.qml 2014-09-29 19:18:47 +0000
+++ checkbox-touch/components/ScreensPreviewPage.qml 1970-01-01 00:00:00 +0000
@@ -1,237 +0,0 @@
1/*
2 * This file is part of Checkbox
3 *
4 * Copyright 2014 Canonical Ltd.
5 *
6 * Authors:
7 * - Maciej Kisielewski <maciej.kisielewski@canonical.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 3.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22import QtQuick 2.0
23import Ubuntu.Components 1.1
24import QtQuick.Layouts 1.1
25
26Page {
27 id: screensPreviewPage
28 title: i18n.tr("Screens preview")
29 visible: false
30
31 Flickable {
32 anchors.fill: parent
33 contentHeight: column.height
34 contentWidth: column.width
35 anchors.margins: units.gu(1)
36 ColumnLayout {
37 id: column
38 spacing: units.gu(3)
39 Label {
40 fontSize: "x-large"
41 Layout.alignment: Qt.AlignHCenter
42 Layout.fillWidth: true
43 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
44 text: i18n.tr("This is a developer screen that allows you to preview particular part of the app.\nSelect which screen to preview")
45 }
46 Button {
47 text: i18n.tr("Welcome page")
48 onClicked: {
49 var newPage = Qt.createComponent(Qt.resolvedUrl("WelcomePage.qml")).createObject();
50 newPage.welcomeText = i18n.tr("This application is under development.\nThere is nothing beyond this screen yet");
51 newPage.startTestingTriggered.connect(function() { pageStack.pop() })
52 pageStack.push(newPage);
53 }
54 }
55 Button {
56 text: i18n.tr("Automated test page")
57 onClicked: {
58 var test = {
59 "name": "memory/info",
60 "description": "This test checks the amount of memory which is reporting \
61in meminfo against the size of the memory modules detected by DMI."
62 };
63 var newPage = Qt.createComponent(Qt.resolvedUrl("AutomatedTestPage.qml")).createObject();
64 newPage.test = test;
65 pageStack.push(newPage);
66 }
67 }
68 Button {
69 text: i18n.tr("User-Interact-Verify test page")
70 onClicked: {
71 var test = {
72 "name": "Headphones playback",
73 "description": "This test will check that headphones connector works correctly.\n\
74STEPS:\n\
75 1. Connect a pair of headphones to your audio device\n\
76 2. Click the Test button to play a sound to your audio device"
77 };
78 var newPage = Qt.createComponent(Qt.resolvedUrl("InteractIntroPage.qml")).createObject();
79 newPage.test = test;
80 newPage.testStarted.connect(userInteractVerifyTestStarted);
81 newPage.testDone.connect(testDone);
82 //Triggering of timer should change the state on intro page
83 interactIntroTimer.triggered.connect(newPage.stopActivity)
84 pageStack.push(newPage);
85 }
86 }
87 Button {
88 objectName: "resumeSessionPageButton"
89 text: i18n.tr("Resume session page")
90 onClicked: {
91 var newPage = Qt.createComponent(Qt.resolvedUrl("ResumeSessionPage.qml")).createObject();
92 newPage.resumeText = "Checkbox did not finish completely.\n\n\
93Do you want to rerun the last test, continue to the next test, or restart from the beginning?";
94 newPage.rerunLast.connect(function() {
95 console.log("Rerun last test selected");
96 replaceOnPageStack(screensPreviewPage);
97 });
98 newPage.continueSession.connect(function() {
99 console.log("Continue session selected");
100 replaceOnPageStack(screensPreviewPage);
101 });
102 newPage.restartSession.connect(function() {
103 console.log("Restart session selected");
104 replaceOnPageStack(screensPreviewPage);
105 });
106 replaceOnPageStack(newPage);
107 }
108 }
109 Button {
110 objectName: "manualIntroPageButton"
111 text: i18n.tr("Manual test page")
112 onClicked: {
113 var test = {
114 "name": "Volume Down Key",
115 "description": "PURPOSE:\n This test will test the volume down key\n\
116STEPS:\n 1. Click the volume down key of your phone",
117 "verificationDescription": "Did the volume go down when you pressed the volume down key?"
118 };
119
120 var newPage = Qt.createComponent(Qt.resolvedUrl("ManualIntroPage.qml")).createObject();
121 newPage.testDone.connect(testDone);
122 newPage.test = test;
123 newPage.continueClicked.connect(function() {
124 var verificationPage = Qt.createComponent(Qt.resolvedUrl("TestVerificationPage.qml")).createObject();
125 verificationPage.test = test;
126 verificationPage.testDone.connect(testDone);
127 pageStack.push(verificationPage);
128 });
129 pageStack.push(newPage);
130 }
131 }
132 Row {
133 spacing: units.gu(3)
134 Button {
135 text: i18n.tr("User-Interact test page")
136 onClicked: {
137 var test = {
138 "name": "Finger Expand",
139 "description": "PURPOSE:\n Check touchscreen expand gesture for zoom\n\
140 STEPS:\n\
141 1. Press the Test button\n\
142 2. Using 2 fingers, resize the blue square until it turns green, then release it."
143 };
144
145 var newPage = Qt.createComponent(Qt.resolvedUrl("InteractIntroPage.qml")).createObject();
146 newPage.test = test;
147 newPage.testDone.connect(testDone);
148 newPage.testStarted.connect(userInteractTestStarted);
149 interactIntroTimer.triggered.connect(newPage.stopActivity)
150 pageStack.push(newPage);
151 }
152 }
153 Label {
154 text: "Should pass?"
155 }
156
157 Switch {
158 id: userInteractShouldFail
159 }
160 }
161 Button {
162 id: verificationPageButton
163 text: i18n.tr("Test verification page")
164 onClicked: {
165 var test = {
166 "name": "Headphones playback",
167 "verificationDescription": "Did you hear a sound through the headphones and did the sound \
168play without any distortion, clicks or other strange noises from your headphones?"
169 };
170
171 interactIntroTimer.triggered.disconnect(verificationPageButton.clicked);
172 var newPage = Qt.createComponent(Qt.resolvedUrl("TestVerificationPage.qml")).createObject();
173 newPage.test = test;
174 newPage.testDone.connect(testDone);
175 pageStack.push(newPage);
176 }
177 }
178 Button {
179 text: i18n.tr("Results page")
180 onClicked: {
181 var newPage = Qt.createComponent(Qt.resolvedUrl("ResultsPage.qml")).createObject();
182 newPage.results = {"totalPassed": 15, "totalFailed": 3, "totalSkipped": 5};
183 pageStack.push(newPage);
184 }
185 }
186 LatchButton {
187 objectName: "latchButton"
188 text: "Latch button"
189 }
190 }
191 }
192 /*
193 This timer emulates running test.
194 */
195 Timer {
196 id: interactIntroTimer
197 interval: 2000; running: false; repeat: false
198 }
199
200 function testDone(test) {
201 console.log("Test finished with result: " + test["outcome"]);
202 unwindStack();
203 }
204
205 function replaceOnPageStack(newPage) {
206 pageStack.pop();
207 pageStack.push(newPage);
208 }
209 function userInteractVerifyTestStarted() {
210 interactIntroTimer.triggered.connect(verificationPageButton.clicked);
211 interactIntroTimer.start();
212 }
213 function showUserInteractSummaryPage() {
214 interactIntroTimer.triggered.disconnect(showUserInteractSummaryPage)
215 var newPage = Qt.createComponent(Qt.resolvedUrl("UserInteractSummaryPage.qml")).createObject();
216 var test = {
217 "name": "Finger Expand",
218 "outcome": (userInteractShouldFail.checked == true) ? "pass" : "fail"
219 }
220 newPage.test = test
221 newPage.testDone.connect(testDone);
222 pageStack.push(newPage);
223 }
224 function userInteractTestStarted() {
225 interactIntroTimer.triggered.connect(showUserInteractSummaryPage);
226 interactIntroTimer.start();
227 }
228 function unwindStack() {
229 /*
230 This function pops pages of from the stack until we're on screensPreviewPage
231 Ordinary pageStack.pop() would'n work as there might be 1 or 2 pages on stack
232 */
233 while(pageStack.currentPage!=screensPreviewPage) {
234 pageStack.pop();
235 }
236 }
237}
2380
=== removed file 'checkbox-touch/preview.qml'
--- checkbox-touch/preview.qml 2014-12-03 15:05:34 +0000
+++ checkbox-touch/preview.qml 1970-01-01 00:00:00 +0000
@@ -1,65 +0,0 @@
1/*
2 * This file is part of Checkbox
3 *
4 * Copyright 2014 Canonical Ltd.
5 *
6 * Authors:
7 * - Maciej Kisielewski <maciej.kisielewski@canonical.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 3.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21import QtQuick 2.0
22import Ubuntu.Components 1.1
23import "components"
24
25/*!
26 \brief MainView with a Label and Button elements.
27*/
28
29MainView {
30 // objectName for functional testing purposes (autopilot-qt5)
31 objectName: "mainView"
32
33 // Note! applicationName needs to match the "name" field of the click manifest
34 applicationName: "com.ubuntu.checkbox"
35
36 /*
37 This property enables the application to change orientation
38 when the device is rotated. The default is false.
39 */
40 //automaticOrientation: true
41
42 width: units.gu(100)
43 height: units.gu(75)
44
45 useDeprecatedToolbar: false
46
47 // High-level object representing the full checkbox testing stack
48 CheckboxStack {
49 onStackReady: {
50 console.log("Pyotherside version " + pyothersideVersion);
51 console.log("Python version " + pythonVersion);
52 console.log("Plainbox version " + plainboxVersion);
53 console.log("Checkbox version " + applicationVersion);
54 }
55 }
56
57 PageStack {
58 id: pageStack
59 objectName: "pageStack"
60 Component.onCompleted: {
61 var newPage = Qt.createComponent(Qt.resolvedUrl("components/ScreensPreviewPage.qml")).createObject();
62 push(newPage);
63 }
64 }
65}
660
=== modified file 'checkbox-touch/py/checkbox_touch.py'
--- checkbox-touch/py/checkbox_touch.py 2015-05-29 14:45:19 +0000
+++ checkbox-touch/py/checkbox_touch.py 2015-06-08 08:21:58 +0000
@@ -136,116 +136,6 @@
136 return b not in a136 return b not in a
137137
138138
139class FakeCheckboxTouchApplication(PlainboxApplication):
140
141 __version__ = (1, 1, 3, 'final', 0)
142
143 def __init__(self):
144 if plainbox.__version__ < (0, 21):
145 raise SystemExit("plainbox 0.21 required, you have {}".format(
146 ToolBase.format_version_tuple(plainbox.__version__)))
147 # adjust_logging(logging.INFO, ['checkbox.touch'], True)
148 self.index = 0
149 self.max_tests = 50
150 self.max_categories = 30
151
152 def __repr__(self):
153 return "fake-app"
154
155 @view
156 def get_version_pair(self):
157 return {
158 'plainbox_version': ToolBase.format_version_tuple(
159 plainbox.__version__),
160 'application_version': ToolBase.format_version_tuple(
161 self.__version__)
162 }
163
164 @view
165 def start_session(self):
166 return {
167 'session_id': 'fake'
168 }
169
170 @view
171 def get_testplans(self):
172 return {
173 'testplan_info_list': [{
174 "mod_id": "id-{}".format(i),
175 "mod_name": "name-{}".format(i),
176 "mod_selected": True,
177 } for i in range(self.max_categories)]
178 }
179
180 @view
181 def remember_testplan(self):
182 pass
183
184 @view
185 def get_categories(self):
186 return {
187 'category_info_list': [{
188 "mod_id": "id-{}".format(i),
189 "mod_name": "name-{}".format(i),
190 "mod_selected": True,
191 } for i in range(self.max_categories)]
192 }
193
194 @view
195 def remember_categories(self, selected_id_list):
196 pass
197
198 @view
199 def get_available_tests(self):
200 return {
201 'test_info_list': sorted([
202 {
203 "mod_id": "id-{}".format(i),
204 "mod_name": "name-{}".format(i),
205 "mod_group": "group-{}".format(i % 3),
206 "mod_selected": True,
207 } for i in range(self.max_tests)],
208 key=lambda item: item['mod_group'])
209 }
210
211 @view
212 def remember_tests(self, selected_id_list):
213 pass
214
215 @view
216 def get_next_test(self):
217 if self.index < self.max_tests:
218 result = {
219 "id": "id-{}".format(self.index),
220 "name": 'name-{}'.format(self.index),
221 "description": 'description-{}'.format(self.index),
222 "verificationDescription": "Verification",
223 "plugin": "manual",
224 "command": "command"
225 }
226 self.index += 1
227 return result
228 else:
229 return {}
230
231 @view
232 def register_test_result(self, test):
233 pass
234
235 @view
236 def run_test_activity(self, test):
237 test['outcome'] = 'pass'
238 return test
239
240 @view
241 def get_results(self):
242 return {
243 'totalPassed': 31,
244 'totalFailed': 9,
245 'totalSkipped': 10
246 }
247
248
249class CheckboxTouchApplication(PlainboxApplication):139class CheckboxTouchApplication(PlainboxApplication):
250 """140 """
251 Class implementing the whole checkbox-touch application logic.141 Class implementing the whole checkbox-touch application logic.
252142
=== removed file 'checkbox-touch/tests/unit/tst_hellocomponent.qml'
--- checkbox-touch/tests/unit/tst_hellocomponent.qml 2014-08-11 12:29:41 +0000
+++ checkbox-touch/tests/unit/tst_hellocomponent.qml 1970-01-01 00:00:00 +0000
@@ -1,50 +0,0 @@
1import QtQuick 2.0
2import QtTest 1.0
3import Ubuntu.Components 0.1
4import "../../components"
5
6// See more details @ http://qt-project.org/doc/qt-5.0/qtquick/qml-testcase.html
7
8// Execute tests with:
9// qmltestrunner
10
11Item {
12 // The objects
13 HelloComponent {
14 id: objectUnderTest
15 }
16
17 TestCase {
18 name: "HelloComponent"
19
20 function init() {
21 console.debug(">> init");
22 compare("",objectUnderTest.text,"text was not empty on init");
23 console.debug("<< init");
24 }
25
26 function cleanup() {
27 console.debug(">> cleanup");
28 console.debug("<< cleanup");
29 }
30
31 function initTestCase() {
32 console.debug(">> initTestCase");
33 console.debug("<< initTestCase");
34 }
35
36 function cleanupTestCase() {
37 console.debug(">> cleanupTestCase");
38 console.debug("<< cleanupTestCase");
39 }
40
41 function test_canReadAndWriteText() {
42 var expected = "Hello World";
43
44 objectUnderTest.text = expected;
45
46 compare(expected,objectUnderTest.text,"expected did not equal result");
47 }
48 }
49}
50

Subscribers

People subscribed via source and target branches