Merge lp:~kissiel/checkbox/launchers-on-device into lp:checkbox
- launchers-on-device
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Maciej Kisielewski |
Approved revision: | 4481 |
Merged at revision: | 4460 |
Proposed branch: | lp:~kissiel/checkbox/launchers-on-device |
Merge into: | lp:checkbox |
Diff against target: |
722 lines (+305/-79) 16 files modified
checkbox-ng/launchers/checkbox-cli (+1/-1) checkbox-touch/build-me (+24/-3) checkbox-touch/checkbox-touch.qml (+97/-65) checkbox-touch/components/CheckboxTouchApplication.qml (+5/-0) checkbox-touch/components/SelectionPage.qml (+1/-0) checkbox-touch/py/checkbox_touch.py (+33/-6) checkbox-touch/py/embedded_providers.py (+1/-0) checkbox-touch/tests/autopilot/autopilot-provider/units/autopilot.pxu (+9/-0) checkbox-touch/tests/autopilot/checkbox_touch/__init__.py (+26/-3) checkbox-touch/tests/autopilot/checkbox_touch/test_checkbox_touch.py (+9/-0) checkbox-touch/tests/autopilot/checkbox_touch/test_launchers.py (+60/-0) checkbox-touch/tests/autopilot/launchers/filtered-tp (+6/-0) checkbox-touch/tests/autopilot/launchers/force-test-not-silent (+13/-0) checkbox-touch/tests/autopilot/launchers/full-auto (+13/-0) checkbox-touch/tests/autopilot/launchers/preselected-tp (+6/-0) plainbox/plainbox/impl/launcher.py (+1/-1) |
To merge this branch: | bzr merge lp:~kissiel/checkbox/launchers-on-device |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Larson | Approve | ||
Maciej Kisielewski | Needs Fixing | ||
Review via email: mp+301372@code.launchpad.net |
Commit message
Description of the change
This MR brings launcher functionality to Ubuntu Touch devices.
To use launchers use ./build-me with '--launcher PATH_TO_LAUNCHER' option - this will embed the file into click and use it on start-up.
Checkbox-Converged can now also run in full-auto mode, use 'type=converged
0f9c13b converged: use default launcher def. when launchers not used
dbaaa25 converged: forward 'forced' info to the views
9d0f3f2 converged: change 'x < 2 && x >0' to 'x === 1'
c42d8fb converged: obey 'forced' by launcher on selections
05ff30c plainbox, -ng: add 'converged-silent' ui type
474bb2e converged: support 'converged-silent' type
49aa7d9 converged: expose parsed settings from launcher
21dbe98 converged: store launcher settings in qml
10b7f6b converged: treat 'undecided' as 'skipped'
1976fbe converged: correct and import Launchers globally
29eb17b converged: add bundling of launcher to build-me
63801ff converged: fix missing namespace in fake provider
8e345da converged: prohibit usage of legacy launchers
e1bda91 converged:
d3c181e converged: remove launchers and autopilot mutual exclusivity
3908b6d converged:
0ba6a6c converged: add objectName to testplanSelecti
1f684b2 converged: fix a crash when submission settings were lacking name
a18ae52 converged: get rid of 'testplan' from appSettings
1d3e11b converged: expose mod_selected for autopilot
354d3ad converged:
a0b3947 converged:
10491c1 converged:
e069c55 converged:
Maciej Kisielewski (kissiel) wrote : | # |
Answered inline.
The branch needs one fix - being not reliant on the race condition on startup.
Paul Larson (pwlars) wrote : | # |
Ok, tested this locally and seems to work fine. I ran the full auto via adb (thanks for the refresher on how to do that!) and got a weird spurious failure the first time which we've seen before, but then on retry got 22/22 passing. I'm +1 on it.
Thanks!
Maciej Kisielewski (kissiel) wrote : | # |
\o/
Let's land it!
Preview Diff
1 | === modified file 'checkbox-ng/launchers/checkbox-cli' |
2 | --- checkbox-ng/launchers/checkbox-cli 2016-07-26 19:41:41 +0000 |
3 | +++ checkbox-ng/launchers/checkbox-cli 2016-08-03 18:28:09 +0000 |
4 | @@ -200,7 +200,7 @@ |
5 | # it's a legacy launcher, use legacy way of running commands |
6 | from checkbox_ng.tools import CheckboxLauncherTool |
7 | raise SystemExit(CheckboxLauncherTool().main(sys.argv[1:])) |
8 | - if self.launcher.ui_type == 'converged': |
9 | + if self.launcher.ui_type in ['converged', 'converged-silent']: |
10 | # Stop processing the launcher config and call the QML ui |
11 | qml_main_file = '/usr/share/checkbox-converged/checkbox-touch.qml' |
12 | basedir = os.path.dirname(__file__) |
13 | |
14 | === modified file 'checkbox-touch/build-me' |
15 | --- checkbox-touch/build-me 2016-07-27 08:43:28 +0000 |
16 | +++ checkbox-touch/build-me 2016-08-03 18:28:09 +0000 |
17 | @@ -147,6 +147,8 @@ |
18 | help=("Updates the potfile and quits")) |
19 | parser.add_argument("--with-autopilot", action='store_true', |
20 | help="Add autopilot hooks to the click") |
21 | + parser.add_argument("--launcher", action='store', type=str, |
22 | + help=("Launcher file to use")) |
23 | args = parser.parse_args() |
24 | if args.update_potfile: |
25 | update_pot() |
26 | @@ -202,14 +204,22 @@ |
27 | with backedup_dir('po'): |
28 | build_i18n() |
29 | |
30 | - generate_desktop_file('Checkbox', 'checkbox-touch.desktop', |
31 | - lang=args.forced_lang) |
32 | + exec_flags = '' |
33 | + if args.launcher: |
34 | + copy_launcher(args.launcher) |
35 | + exec_flags = '--launcher ./launcher' |
36 | + generate_desktop_file( |
37 | + 'Checkbox', |
38 | + 'checkbox-touch.desktop', |
39 | + lang=args.forced_lang, |
40 | + exec_flags=exec_flags) |
41 | if args.with_autopilot: |
42 | generate_desktop_file( |
43 | 'Checkbox-Autopilot', |
44 | 'checkbox-autopilot.desktop', |
45 | lang='en', |
46 | - exec_flags='--autopilot') |
47 | + exec_flags=('--autopilot ' |
48 | + '--launcher=/tmp/checkbox_autopilot_launcher')) |
49 | |
50 | if not os.path.exists('../build-cbt'): |
51 | os.makedirs('../build-cbt') |
52 | @@ -227,6 +237,17 @@ |
53 | install_click_ssh(pkg, args.ssh, port) |
54 | |
55 | |
56 | +def copy_launcher(launcher_file): |
57 | + target = './launcher' |
58 | + if os.path.exists(target) and os.path.samefile(launcher_file, target): |
59 | + print("Reusing existing './launcher' launcher") |
60 | + return |
61 | + if os.path.exists(target): |
62 | + sys.exit('%s already exists. Aborting!' % target) |
63 | + print('Copying over the launcher') |
64 | + shutil.copyfile(launcher_file, target) |
65 | + |
66 | + |
67 | def validate_providers(): |
68 | print("Validating providers") |
69 | providers_valid = True |
70 | |
71 | === modified file 'checkbox-touch/checkbox-touch.qml' |
72 | --- checkbox-touch/checkbox-touch.qml 2016-07-21 16:40:41 +0000 |
73 | +++ checkbox-touch/checkbox-touch.qml 2016-08-03 18:28:09 +0000 |
74 | @@ -53,10 +53,10 @@ |
75 | property var appSettings: { |
76 | "applicationName" : applicationName, |
77 | "revision": "unknown revision", |
78 | - "testplan": "", |
79 | "providersDir": "providers", |
80 | "submission": null |
81 | } |
82 | + property var launcherSettings |
83 | |
84 | Arguments { |
85 | id: args |
86 | @@ -95,10 +95,10 @@ |
87 | i18n.domain = "com.ubuntu.checkbox"; |
88 | if (args.values["autopilot"]) { |
89 | // autopilot-testing mode |
90 | - appSettings["testplan"] = "2015.com.canonical.certification::checkbox-touch-autopilot"; |
91 | appSettings["providersDir"] = "tests/autopilot/autopilot-provider"; |
92 | appSettings["log-level"] = "warning"; |
93 | - } else if (args.values["launcher"]) { |
94 | + } |
95 | + if (args.values["launcher"]) { |
96 | appSettings["launcher"] = args.values["launcher"]; |
97 | } else { |
98 | // normal execution - load settings.json file |
99 | @@ -168,14 +168,20 @@ |
100 | "checkbox_touch" : applicationVersion, |
101 | "plainbox" : plainboxVersion |
102 | }; |
103 | - getIncompleteSessions(function(sessions) { |
104 | - incompleteSessions = sessions; |
105 | - resumeSessionPage.incompleteSessionCount = sessions.length; |
106 | + getLauncherSettings(function(res) { |
107 | + launcherSettings = res; |
108 | + getIncompleteSessions(function(sessions) { |
109 | + incompleteSessions = sessions; |
110 | + resumeSessionPage.incompleteSessionCount = sessions.length; |
111 | + }); |
112 | + resumeOrStartSession(); |
113 | }); |
114 | - resumeOrStartSession(); |
115 | } |
116 | onSessionReady: { |
117 | welcomePage.enableButton() |
118 | + if (launcherSettings['ui_type'] == 'converged-silent') { |
119 | + welcomePage.startTestingTriggered() |
120 | + } |
121 | } |
122 | Component.onCompleted: { |
123 | // register to py.initiated signal |
124 | @@ -219,25 +225,22 @@ |
125 | welcomeText: i18n.tr("Welcome to Checkbox Touch\nVersion: %1\n(%2 %3)") |
126 | .arg(app.applicationVersion).arg(appSettings.revision).arg(appSettings.clickBuildDate) |
127 | onStartTestingTriggered: { |
128 | - if (appSettings.testplan != "") { |
129 | - app.rememberTestplan(appSettings.testplan, function() { |
130 | - categorySelectionPage.setup(); |
131 | - enableButton(); |
132 | - }); |
133 | - } else { |
134 | - app.getTestplans(function(response) { |
135 | - var tp_list = response.testplan_info_list; |
136 | - if (tp_list.length < 2 && tp_list.length > 0) { |
137 | - app.rememberTestplan(tp_list[0].mod_id, function() { |
138 | - categorySelectionPage.setup(); |
139 | - }); |
140 | - } |
141 | - else { |
142 | - testplanSelectionPage.setup(tp_list) |
143 | - } |
144 | - enableButton(); |
145 | - }); |
146 | - } |
147 | + app.getTestplans(function(response) { |
148 | + var tp_list = response.testplan_info_list; |
149 | + if (tp_list.length === 1) { |
150 | + // one test plan might be the result of launcher |
151 | + // preselecting test plan |
152 | + // default behaviour of c-box-converged is to skip the |
153 | + // screen if there's only one TP |
154 | + app.rememberTestplan(tp_list[0].mod_id, function() { |
155 | + categorySelectionPage.setup(); |
156 | + }); |
157 | + } |
158 | + else { |
159 | + testplanSelectionPage.setup(tp_list) |
160 | + } |
161 | + enableButton(); |
162 | + }); |
163 | } |
164 | onAboutClicked: pageStack.push(aboutPage) |
165 | } |
166 | @@ -318,6 +321,7 @@ |
167 | |
168 | SelectionPage { |
169 | id: testplanSelectionPage |
170 | + objectName: "testplanSelectionPage" |
171 | title: i18n.tr("Select test plan") |
172 | onlyOneAllowed: true |
173 | largeBuffer: args.values["autopilot"] |
174 | @@ -378,6 +382,13 @@ |
175 | modelUpdated(); |
176 | pageStack.push(categorySelectionPage); |
177 | } |
178 | + if (response.forced_selection) { |
179 | + var selection = []; |
180 | + for(var i=0; i < response.category_info_list.length; i++) { |
181 | + selection.push(response.category_info_list[i].mod_id); |
182 | + } |
183 | + selectionDone(selection); |
184 | + } |
185 | // if called from welcome page, no continuation is given |
186 | if (continuation) continuation(); |
187 | }); |
188 | @@ -414,6 +425,9 @@ |
189 | } |
190 | modelUpdated(); |
191 | pageStack.push(testSelectionPage); |
192 | + if (response.forced_selection) { |
193 | + gatherSelection() |
194 | + } |
195 | continuation(); |
196 | }); |
197 | } |
198 | @@ -491,25 +505,29 @@ |
199 | } |
200 | |
201 | function resumeOrStartSession() { |
202 | - app.isSessionResumable(function(result) { |
203 | - if (result.resumable === true) { |
204 | - if (appSettings.forcedResume) { |
205 | - app.resumeSession(true, undefined, processNextTest) |
206 | - } else { |
207 | - pageStack.clear(); |
208 | - resumeSessionPage.lastTestName = result.running_job_name; |
209 | - pageStack.push(resumeSessionPage); |
210 | - } |
211 | - } else { |
212 | - if (result.errors_encountered) { |
213 | - dialogMgr.showError(mainView, i18n.tr("Could not resume session."), |
214 | - gcAndStartSession(), |
215 | - i18n.tr("Start new session")); |
216 | - } else { |
217 | - gcAndStartSession(); |
218 | - } |
219 | - } |
220 | - }); |
221 | + if (launcherSettings.ui_type == 'converged-silent') { |
222 | + app.startSession() |
223 | + } else { |
224 | + app.isSessionResumable(function(result) { |
225 | + if (result.resumable === true) { |
226 | + if (appSettings.forcedResume) { |
227 | + app.resumeSession(true, undefined, processNextTest) |
228 | + } else { |
229 | + pageStack.clear(); |
230 | + resumeSessionPage.lastTestName = result.running_job_name; |
231 | + pageStack.push(resumeSessionPage); |
232 | + } |
233 | + } else { |
234 | + if (result.errors_encountered) { |
235 | + dialogMgr.showError(mainView, i18n.tr("Could not resume session."), |
236 | + gcAndStartSession(), |
237 | + i18n.tr("Start new session")); |
238 | + } else { |
239 | + gcAndStartSession(); |
240 | + } |
241 | + } |
242 | + }); |
243 | + } |
244 | } |
245 | |
246 | function processNextTest() { |
247 | @@ -547,33 +565,41 @@ |
248 | |
249 | function performTest(test) { |
250 | switch (test['plugin']) { |
251 | - case 'manual': |
252 | - performManualTest(test); |
253 | - break; |
254 | - case 'user-interact-verify': |
255 | - performUserInteractVerifyTest(test); |
256 | - break; |
257 | case 'local': |
258 | case 'shell': |
259 | case 'attachment': |
260 | case 'resource': |
261 | performAutomatedTest(test); |
262 | break; |
263 | - case 'user-verify': |
264 | - performUserVerifyTest(test); |
265 | - break; |
266 | - case 'user-interact': |
267 | - performUserInteractTest(test); |
268 | - break; |
269 | - case 'qml': |
270 | - if (test.flags.indexOf("confined") > -1) |
271 | - performConfinedQmlTest(test); |
272 | - else |
273 | - performQmlTest(test); |
274 | - break; |
275 | default: |
276 | - test.outcome = "skip"; |
277 | - completeTest(test); |
278 | + if (launcherSettings.ui_type !== 'converged-silent') { |
279 | + switch (test['plugin']) { |
280 | + case 'manual': |
281 | + performManualTest(test); |
282 | + break; |
283 | + case 'user-interact-verify': |
284 | + performUserInteractVerifyTest(test); |
285 | + break; |
286 | + case 'user-verify': |
287 | + performUserVerifyTest(test); |
288 | + break; |
289 | + case 'user-interact': |
290 | + performUserInteractTest(test); |
291 | + break; |
292 | + case 'qml': |
293 | + if (test.flags.indexOf("confined") > -1) |
294 | + performConfinedQmlTest(test); |
295 | + else |
296 | + performQmlTest(test); |
297 | + break; |
298 | + default: |
299 | + test.outcome = "skip"; |
300 | + completeTest(test); |
301 | + } |
302 | + } else { |
303 | + runTestActivity(test, completeTest); |
304 | + } |
305 | + break; |
306 | } |
307 | } |
308 | |
309 | @@ -668,8 +694,10 @@ |
310 | if (result.type === "certification") { |
311 | appSettings["submission"] = {} |
312 | appSettings["submission"].type = "c3" |
313 | + appSettings["submission"].name = "c3" |
314 | if (result.staging === "yes") { |
315 | appSettings["submission"].type = "c3-staging" |
316 | + appSettings["submission"].name = "c3-staging" |
317 | } |
318 | if (result.secure_id) { |
319 | appSettings["submission"].secure_id = result.secure_id |
320 | @@ -682,6 +710,10 @@ |
321 | } |
322 | resultsPage.submissionName = i18n.tr("Certification Site"); |
323 | } |
324 | + if (launcherSettings['ui_type'] == 'converged-silent') { |
325 | + resultsPage.saveReportClicked(); |
326 | + resultsPage.submitReportClicked(); |
327 | + } |
328 | }); |
329 | if (appSettings["submission"]) { |
330 | resultsPage.submissionName = appSettings["submission"].name; |
331 | |
332 | === modified file 'checkbox-touch/components/CheckboxTouchApplication.qml' |
333 | --- checkbox-touch/components/CheckboxTouchApplication.qml 2016-07-21 16:40:41 +0000 |
334 | +++ checkbox-touch/components/CheckboxTouchApplication.qml 2016-08-03 18:28:09 +0000 |
335 | @@ -202,6 +202,11 @@ |
336 | console.error("Unable to remove old sessions") |
337 | }); |
338 | } |
339 | + function getLauncherSettings(continuation) { |
340 | + request("get_launcher_settings", [], continuation, function(error) { |
341 | + console.error("Unable to get launcher settings") |
342 | + }); |
343 | + } |
344 | |
345 | function rememberPassword(password, continuation) { |
346 | // using low-level py.call() to 'silently' pass password string through pyotherside |
347 | |
348 | === modified file 'checkbox-touch/components/SelectionPage.qml' |
349 | --- checkbox-touch/components/SelectionPage.qml 2016-07-11 12:39:35 +0000 |
350 | +++ checkbox-touch/components/SelectionPage.qml 2016-08-03 18:28:09 +0000 |
351 | @@ -279,6 +279,7 @@ |
352 | text: mod_name |
353 | enabled: !mod_disabled |
354 | property var item_mod_id: mod_id |
355 | + property var item_mod_selected: mod_selected |
356 | /* Create a checkbox-lookalike that doesn't have the internal onTrigger |
357 | * signal handler that overrides the binding to the model.mod_selected |
358 | * property. If we use the normal CheckBox component here then the |
359 | |
360 | === modified file 'checkbox-touch/py/checkbox_touch.py' |
361 | --- checkbox-touch/py/checkbox_touch.py 2016-07-26 12:41:32 +0000 |
362 | +++ checkbox-touch/py/checkbox_touch.py 2016-08-03 18:28:09 +0000 |
363 | @@ -62,6 +62,9 @@ |
364 | from plainbox.impl import pod |
365 | from plainbox.impl.clitools import ToolBase |
366 | from plainbox.impl.commands.inv_run import SilentUI |
367 | +from plainbox.impl.launcher import DefaultLauncherDefinition |
368 | +from plainbox.impl.launcher import LauncherDefinition |
369 | +from plainbox.impl.launcher import LauncherDefinitionLegacy |
370 | from plainbox.impl.result import JobResultBuilder |
371 | from plainbox.impl.session.assistant import SessionAssistant |
372 | from plainbox.impl.transport import get_all_transports |
373 | @@ -181,7 +184,6 @@ |
374 | self.assistant.use_alternate_execution_controllers(ctrl_setup_list) |
375 | |
376 | if launcher_definition: |
377 | - from plainbox.impl.launcher import LauncherDefinition |
378 | generic_launcher = LauncherDefinition() |
379 | generic_launcher.read([launcher_definition]) |
380 | config_filename = os.path.expandvars( |
381 | @@ -195,13 +197,29 @@ |
382 | self.launcher = generic_launcher.get_concrete_launcher() |
383 | configs.append(launcher_definition) |
384 | self.launcher.read(configs) |
385 | + # Checkbox-Converged supports new launcher syntax, so if we have |
386 | + # LauncherDefinitionLegacy as launcher right now, let's replace it |
387 | + # with a default one |
388 | + if type(self.launcher) == LauncherDefinitionLegacy: |
389 | + self.launcher = DefaultLauncherDefinition() |
390 | self.assistant.use_alternate_configuration(self.launcher) |
391 | self._prepare_transports() |
392 | + else: |
393 | + self.launcher = DefaultLauncherDefinition() |
394 | |
395 | def __repr__(self): |
396 | return "app" |
397 | |
398 | @view |
399 | + def get_launcher_settings(self): |
400 | + # this pseudo-adapter exists so qml can now know some bits about the |
401 | + # launcher, if you need another setting in the QML fron-end, just add |
402 | + # it to the returned dict below |
403 | + return { |
404 | + 'ui_type': self.launcher.ui_type, |
405 | + } |
406 | + |
407 | + @view |
408 | def load_providers(self, providers_dir): |
409 | if self.launcher: |
410 | self.assistant.select_providers( |
411 | @@ -318,7 +336,8 @@ |
412 | "mod_selected": |
413 | tp.id == self.launcher.test_plan_default_selection, |
414 | "mod_disabled": False, |
415 | - } for tp in self._available_test_plans] |
416 | + } for tp in self._available_test_plans], |
417 | + 'forced_selection': self.launcher.test_plan_forced |
418 | } |
419 | else: |
420 | self._available_test_plans = [ |
421 | @@ -330,7 +349,8 @@ |
422 | "mod_name": tp.name, |
423 | "mod_selected": False, |
424 | "mod_disabled": False, |
425 | - } for tp in self._available_test_plans] |
426 | + } for tp in self._available_test_plans], |
427 | + 'forced_selection': False |
428 | } |
429 | |
430 | @view |
431 | @@ -365,7 +385,10 @@ |
432 | for category_id in self.assistant.get_participating_categories() |
433 | )] |
434 | category_info_list.sort(key=lambda ci: (ci['mod_name'])) |
435 | - return {'category_info_list': category_info_list} |
436 | + return { |
437 | + 'category_info_list': category_info_list, |
438 | + 'forced_selection': self.launcher.test_selection_forced |
439 | + } |
440 | |
441 | @view |
442 | def remember_categories(self, selected_id_list): |
443 | @@ -397,7 +420,10 @@ |
444 | "mod_disabled": job.id in mandatory_jobs, |
445 | } for job in job_units] |
446 | test_info_list.sort(key=lambda ti: (ti['mod_group'], ti['mod_name'])) |
447 | - return {'test_info_list': test_info_list} |
448 | + return { |
449 | + 'test_info_list': test_info_list, |
450 | + 'forced_selection': self.launcher.test_selection_forced |
451 | + } |
452 | |
453 | @view |
454 | def get_rerun_candidates(self): |
455 | @@ -513,7 +539,8 @@ |
456 | 'totalPassed': stats[IJobResult.OUTCOME_PASS], |
457 | 'totalFailed': stats[IJobResult.OUTCOME_FAIL], |
458 | 'totalSkipped': stats[IJobResult.OUTCOME_SKIP] + |
459 | - stats[IJobResult.OUTCOME_NOT_SUPPORTED] |
460 | + stats[IJobResult.OUTCOME_NOT_SUPPORTED] + |
461 | + stats[IJobResult.OUTCOME_UNDECIDED] |
462 | } |
463 | |
464 | @view |
465 | |
466 | === modified file 'checkbox-touch/py/embedded_providers.py' |
467 | --- checkbox-touch/py/embedded_providers.py 2014-11-14 07:09:26 +0000 |
468 | +++ checkbox-touch/py/embedded_providers.py 2016-08-03 18:28:09 +0000 |
469 | @@ -68,6 +68,7 @@ |
470 | definition = Provider1Definition() |
471 | definition.location = location |
472 | definition.name = setup_kwargs.get('name', None) |
473 | + definition.namespace = setup_kwargs.get('namespace', Unset) |
474 | definition.version = setup_kwargs.get('version', None) |
475 | definition.description = setup_kwargs.get('description', None) |
476 | definition.gettext_domain = setup_kwargs.get( |
477 | |
478 | === modified file 'checkbox-touch/tests/autopilot/autopilot-provider/units/autopilot.pxu' |
479 | --- checkbox-touch/tests/autopilot/autopilot-provider/units/autopilot.pxu 2016-07-27 08:43:28 +0000 |
480 | +++ checkbox-touch/tests/autopilot/autopilot-provider/units/autopilot.pxu 2016-08-03 18:28:09 +0000 |
481 | @@ -7,6 +7,15 @@ |
482 | include: autopilot/.* |
483 | mandatory_include: mandatory-job |
484 | |
485 | +unit: test plan |
486 | +_description: |
487 | + Alternative test plan for autopilot |
488 | +id: autopilot-alt |
489 | +_name: Alternative test plan for autopilot |
490 | +include: |
491 | + autopilot/automated-test-that-passes |
492 | +estimated_duration: 10 |
493 | + |
494 | unit: category |
495 | id: normal |
496 | _name: Tests not requiring sudo |
497 | |
498 | === modified file 'checkbox-touch/tests/autopilot/checkbox_touch/__init__.py' |
499 | --- checkbox-touch/tests/autopilot/checkbox_touch/__init__.py 2016-07-27 08:43:28 +0000 |
500 | +++ checkbox-touch/tests/autopilot/checkbox_touch/__init__.py 2016-08-03 18:28:09 +0000 |
501 | @@ -28,12 +28,25 @@ |
502 | package_id = 'com.ubuntu.checkbox' |
503 | app_name = 'checkbox-touch-autopilot' |
504 | |
505 | + launcher = '' |
506 | + |
507 | def setUp(self): |
508 | super(ClickAppTestCase, self).setUp() |
509 | self.pointing_device = input.Pointer(self.input_device_class.create()) |
510 | + if self.launcher: |
511 | + link = '/tmp/checkbox_autopilot_launcher' |
512 | + target = os.path.abspath(os.path.join('launchers', self.launcher)) |
513 | + if os.path.lexists(link): |
514 | + os.unlink(link) |
515 | + os.symlink(target, link) |
516 | self.launch_application() |
517 | self.assertThat(self.main_view.visible, Eventually(Equals(True))) |
518 | |
519 | + def tearDown(self): |
520 | + if self.launcher: |
521 | + os.unlink('/tmp/checkbox_autopilot_launcher') |
522 | + super(ClickAppTestCase, self).tearDown() |
523 | + |
524 | def skipResumeIfShown(self): |
525 | """Skip restart screen if presented.""" |
526 | # this doesn't use 'long wait' helper, because a 'welcome page' may be |
527 | @@ -63,6 +76,15 @@ |
528 | start_btn = welcome_page.wait_select_single( |
529 | objectName='startTestButton') |
530 | self.pointing_device.click_object(start_btn) |
531 | + tp_selection_page = self.app.wait_select_single( |
532 | + objectName='testplanSelectionPage', visible=True) |
533 | + tp_item = tp_selection_page.wait_select_single( |
534 | + objectName='listItem', item_mod_id=( |
535 | + '2015.com.canonical.certification::checkbox-touch-autopilot')) |
536 | + self.pointing_device.click_object(tp_item) |
537 | + continue_btn = tp_selection_page.wait_select_single( |
538 | + objectName='continueButton', visible=True) |
539 | + self.pointing_device.click_object(continue_btn) |
540 | category_page = self.app.wait_select_single( |
541 | objectName='categorySelectionPage', visible=True) |
542 | self._click_action_button('trailingActionBar', 'toggleSelectionAction') |
543 | @@ -172,6 +194,7 @@ |
544 | app_qml_source_location, |
545 | '--autopilot', |
546 | '--settings=""', |
547 | + '--launcher=/tmp/checkbox_autopilot_launcher', |
548 | app_type='qt', |
549 | emulator_base=emulators.UbuntuUIToolkitEmulatorBase) |
550 | else: |
551 | @@ -180,11 +203,11 @@ |
552 | "only run from source.") |
553 | |
554 | def _get_app_qml_source_path(self): |
555 | - qml_file_name = '{0}.qml'.format(self.app_name) |
556 | - return os.path.join(self._get_path_to_app_source(), qml_file_name) |
557 | + return os.path.join( |
558 | + self._get_path_to_app_source(), 'checkbox-touch.qml') |
559 | |
560 | def _get_path_to_app_source(self): |
561 | - return os.path.join(get_path_to_source_root(), self.app_name) |
562 | + return os.path.join(get_path_to_source_root(), 'checkbox-touch') |
563 | |
564 | def _get_plainbox_qml_modules_path(self): |
565 | try: |
566 | |
567 | === modified file 'checkbox-touch/tests/autopilot/checkbox_touch/test_checkbox_touch.py' |
568 | --- checkbox-touch/tests/autopilot/checkbox_touch/test_checkbox_touch.py 2016-07-27 08:43:28 +0000 |
569 | +++ checkbox-touch/tests/autopilot/checkbox_touch/test_checkbox_touch.py 2016-08-03 18:28:09 +0000 |
570 | @@ -51,6 +51,15 @@ |
571 | start_btn = welcome_page.wait_select_single( |
572 | objectName='startTestButton') |
573 | self.pointing_device.click_object(start_btn) |
574 | + tp_selection_page = self.app.wait_select_single( |
575 | + objectName='testplanSelectionPage', visible=True) |
576 | + tp_item = tp_selection_page.wait_select_single( |
577 | + objectName='listItem', item_mod_id=( |
578 | + '2015.com.canonical.certification::checkbox-touch-autopilot')) |
579 | + self.pointing_device.click_object(tp_item) |
580 | + continue_btn = tp_selection_page.wait_select_single( |
581 | + objectName='continueButton', visible=True) |
582 | + self.pointing_device.click_object(continue_btn) |
583 | category_page = self.app.wait_select_single( |
584 | objectName='categorySelectionPage', visible=True) |
585 | self._click_action_button('trailingActionBar', 'toggleSelectionAction') |
586 | |
587 | === added file 'checkbox-touch/tests/autopilot/checkbox_touch/test_launchers.py' |
588 | --- checkbox-touch/tests/autopilot/checkbox_touch/test_launchers.py 1970-01-01 00:00:00 +0000 |
589 | +++ checkbox-touch/tests/autopilot/checkbox_touch/test_launchers.py 2016-08-03 18:28:09 +0000 |
590 | @@ -0,0 +1,60 @@ |
591 | +import checkbox_touch |
592 | + |
593 | +class FullAutoLauncherTests(checkbox_touch.ClickAppTestCase): |
594 | + |
595 | + launcher = 'full-auto' |
596 | + |
597 | + def test_full_auto(self): |
598 | + password_box = self.long_wait_select_single( |
599 | + self.app, objectName='passwordBox') |
600 | + ok_btn = self.app.wait_select_single(objectName='cancelButton') |
601 | + self.pointing_device.click_object(ok_btn) |
602 | + results = {'passed': '7', 'failed': '2', 'skipped': '13'} |
603 | + self.check_results(results) |
604 | + |
605 | +class ForceTestLauncherTests(checkbox_touch.ClickAppTestCase): |
606 | + |
607 | + launcher = 'force-test-not-silent' |
608 | + |
609 | + def test_force_test_not_silent(self): |
610 | + self.skipResumeIfShown() |
611 | + welcome_page = self.long_wait_select_single( |
612 | + self.app, objectName='welcomePage', state='loaded') |
613 | + start_btn = welcome_page.wait_select_single( |
614 | + objectName='startTestButton') |
615 | + self.pointing_device.click_object(start_btn) |
616 | + results = {'passed': '1', 'failed': '0', 'skipped': '0'} |
617 | + self.check_results(results) |
618 | + |
619 | +class PreselectedTPLauncherTests(checkbox_touch.ClickAppTestCase): |
620 | + |
621 | + launcher = 'preselected-tp' |
622 | + |
623 | + def test_preselected_tp(self): |
624 | + self.skipResumeIfShown() |
625 | + welcome_page = self.long_wait_select_single( |
626 | + self.app, objectName='welcomePage', state='loaded') |
627 | + start_btn = welcome_page.wait_select_single( |
628 | + objectName='startTestButton') |
629 | + self.pointing_device.click_object(start_btn) |
630 | + tp_selection_page = self.app.wait_select_single( |
631 | + objectName='testplanSelectionPage', visible=True) |
632 | + tp_item = tp_selection_page.wait_select_single( |
633 | + objectName='listItem', item_mod_id=( |
634 | + '2015.com.canonical.certification::autopilot-alt'), |
635 | + item_mod_selected=True) |
636 | + |
637 | +class FilteredTPLauncherTests(checkbox_touch.ClickAppTestCase): |
638 | + |
639 | + launcher = 'filtered-tp' |
640 | + |
641 | + def test_filtered_tp(self): |
642 | + self.skipResumeIfShown() |
643 | + welcome_page = self.long_wait_select_single( |
644 | + self.app, objectName='welcomePage', state='loaded') |
645 | + start_btn = welcome_page.wait_select_single( |
646 | + objectName='startTestButton') |
647 | + self.pointing_device.click_object(start_btn) |
648 | + # if filtering worked, we should be on the category selection screen |
649 | + category_page = self.app.wait_select_single( |
650 | + objectName='categorySelectionPage', visible=True) |
651 | |
652 | === added directory 'checkbox-touch/tests/autopilot/launchers' |
653 | === added file 'checkbox-touch/tests/autopilot/launchers/filtered-tp' |
654 | --- checkbox-touch/tests/autopilot/launchers/filtered-tp 1970-01-01 00:00:00 +0000 |
655 | +++ checkbox-touch/tests/autopilot/launchers/filtered-tp 2016-08-03 18:28:09 +0000 |
656 | @@ -0,0 +1,6 @@ |
657 | +[launcher] |
658 | +launcher_version = 1 |
659 | +stock_reports = submission_files |
660 | + |
661 | +[test plan] |
662 | +filter = 2015.com.canonical.certification::autopilot-alt |
663 | |
664 | === added file 'checkbox-touch/tests/autopilot/launchers/force-test-not-silent' |
665 | --- checkbox-touch/tests/autopilot/launchers/force-test-not-silent 1970-01-01 00:00:00 +0000 |
666 | +++ checkbox-touch/tests/autopilot/launchers/force-test-not-silent 2016-08-03 18:28:09 +0000 |
667 | @@ -0,0 +1,13 @@ |
668 | +[launcher] |
669 | +launcher_version = 1 |
670 | +stock_reports = submission_files |
671 | + |
672 | +[test plan] |
673 | +unit = 2015.com.canonical.certification::autopilot-alt |
674 | +forced = yes |
675 | + |
676 | +[test selection] |
677 | +forced = yes |
678 | + |
679 | +[ui] |
680 | +type = converged |
681 | |
682 | === added file 'checkbox-touch/tests/autopilot/launchers/full-auto' |
683 | --- checkbox-touch/tests/autopilot/launchers/full-auto 1970-01-01 00:00:00 +0000 |
684 | +++ checkbox-touch/tests/autopilot/launchers/full-auto 2016-08-03 18:28:09 +0000 |
685 | @@ -0,0 +1,13 @@ |
686 | +[launcher] |
687 | +launcher_version = 1 |
688 | +stock_reports = submission_files |
689 | + |
690 | +[test plan] |
691 | +unit = 2015.com.canonical.certification::checkbox-touch-autopilot |
692 | +forced = yes |
693 | + |
694 | +[test selection] |
695 | +forced = yes |
696 | + |
697 | +[ui] |
698 | +type = converged-silent |
699 | |
700 | === added file 'checkbox-touch/tests/autopilot/launchers/preselected-tp' |
701 | --- checkbox-touch/tests/autopilot/launchers/preselected-tp 1970-01-01 00:00:00 +0000 |
702 | +++ checkbox-touch/tests/autopilot/launchers/preselected-tp 2016-08-03 18:28:09 +0000 |
703 | @@ -0,0 +1,6 @@ |
704 | +[launcher] |
705 | +launcher_version = 1 |
706 | +stock_reports = submission_files |
707 | + |
708 | +[test plan] |
709 | +unit = 2015.com.canonical.certification::autopilot-alt |
710 | |
711 | === modified file 'plainbox/plainbox/impl/launcher.py' |
712 | --- plainbox/plainbox/impl/launcher.py 2016-07-26 12:41:32 +0000 |
713 | +++ plainbox/plainbox/impl/launcher.py 2016-08-03 18:28:09 +0000 |
714 | @@ -245,7 +245,7 @@ |
715 | name='type', |
716 | default='interactive', |
717 | validator_list=[config.ChoiceValidator( |
718 | - ['interactive', 'silent', 'converged'])], |
719 | + ['interactive', 'silent', 'converged', 'converged-silent'])], |
720 | help_text=_('Type of stock user interface to use.')) |
721 | |
722 | dont_suppress_output = config.Variable( |
A couple of questions below. I'll try to give this a run-through later today unless someone beats me to it.