Merge lp:~nskaggs/notes-app/ap-setup-update into lp:notes-app

Proposed by Nicholas Skaggs
Status: Work in progress
Proposed branch: lp:~nskaggs/notes-app/ap-setup-update
Merge into: lp:notes-app
Diff against target: 192 lines (+60/-50)
3 files modified
click/manifest.json.in (+11/-8)
tests/autopilot/notes_app/tests/__init__.py (+48/-41)
tests/autopilot/notes_app/tests/test_delete.py (+1/-1)
To merge this branch: bzr merge lp:~nskaggs/notes-app/ap-setup-update
Reviewer Review Type Date Requested Status
Nicholas Skaggs (community) Disapprove
PS Jenkins bot continuous-integration Needs Fixing
Martin Pitt Needs Fixing
Review via email: mp+225992@code.launchpad.net

Commit message

Update AP launch to fix #1338979

Description of the change

Update AP launch to fix #1338979

I didn't attempt to properly mock, or otherwise change the tests. More work could be done :)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

You can run and verify this for yourself by doing the following:

bzr branch lp:~nskaggs/notes-app/ap-setup-update notes-app
adt-run notes-app --click=com.ubuntu.notes --- \ssh -s /usr/share/autopkgtest/ssh-setup/adb

Ensure you have a connected ubuntu touch device ready to run.

Revision history for this message
Martin Pitt (pitti) wrote :

I get http://paste.ubuntu.com/7775468/ on image 121; this might be due to the new UITK that landed recently? Also, this still has a ton of "invalid option -- 'I'" errors in the AP log, presumably because this branch only changes the invocation of qmlscene in the test, but not in CMakeLists.txt?

Not sure about the ConnectionResetError, are they expected as part of the test web server log, or are an actual failure? I think the actual failure here is

  ubuntuuitoolkit._custom_proxy_objects._common.ToolkitException: Only swiping to the right will cause the item to be deleted.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Pitti, I believe you are seeing https://bugs.launchpad.net/ubuntu/+source/qtdeclarative-opensource-src/+bug/1298659.

The swipe issue actually was fixed in trunk, so I merged that back.

281. By Nicholas Skaggs

really revert CMake changes

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Martin Pitt (pitti) wrote :

Mostly working now; the AP tests succeed, but autopkgtest fails on having a ton of stderr, due to several exceptions and the fake web server log: http://paste.ubuntu.com/7830998/

I think these are all just from the fake web server, so probably its output should be directed to /dev/null, or perhaps to a log file which you print on a test failure, or just generally put into $ADT_ARTIFACTS/web-server.log?

Alternatively, add the "allow-stderr" restriction.

Thanks!

review: Needs Fixing
282. By Nicholas Skaggs

add allow-stderr to manifest for autopkgtest

283. By Nicholas Skaggs

fix syntax

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
284. By Nicholas Skaggs

use "@AUTOPILOT_DIR@" still

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) :
review: Disapprove

Unmerged revisions

284. By Nicholas Skaggs

use "@AUTOPILOT_DIR@" still

283. By Nicholas Skaggs

fix syntax

282. By Nicholas Skaggs

add allow-stderr to manifest for autopkgtest

281. By Nicholas Skaggs

really revert CMake changes

280. By Nicholas Skaggs

revert changes to cmake

279. By Nicholas Skaggs

fix test delete name

278. By Nicholas Skaggs

merge trunk

277. By Nicholas Skaggs

remove swipe to left to delete (no longer valid)

276. By Nicholas Skaggs

remove -I from cmake

275. By Nicholas Skaggs

remove unneeded debug args

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'click/manifest.json.in'
2--- click/manifest.json.in 2014-04-10 10:38:52 +0000
3+++ click/manifest.json.in 2014-08-07 14:37:59 +0000
4@@ -1,24 +1,27 @@
5 {
6 "architecture": "armhf",
7- "description":
8+ "description":
9 "Note taking application for the Ubuntu platform",
10- "framework": "ubuntu-sdk-14.04-dev1",
11+ "framework": "ubuntu-sdk-14.04-dev1",
12 "hooks": {
13 "notes": {
14- "apparmor": "notes-apparmor.json",
15+ "apparmor": "notes-apparmor.json",
16 "desktop": "@CMAKE_INSTALL_DATADIR@/applications/@DESKTOP_FILE@"
17 }
18- },
19+ },
20 "icon": "notepad",
21 "maintainer": "Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>",
22- "name": "com.ubuntu.notes",
23- "title": "Notes",
24+ "name": "com.ubuntu.notes",
25+ "title": "Notes",
26 "version": "1.4.@BZR_REVNO@",
27 "x-source": {
28- "vcs-bzr": "lp:notes-app",
29+ "vcs-bzr": "lp:notes-app",
30 "vcs-bzr-revno": "@BZR_REVNO@"
31 },
32 "x-test": {
33- "autopilot": "@AUTOPILOT_DIR@"
34+ "autopilot": {
35+ "autopilot_module": "@AUTOPILOT_DIR@",
36+ "restrictions": ["allow-stderr"]
37+ }
38 }
39 }
40
41=== modified file 'tests/autopilot/notes_app/tests/__init__.py'
42--- tests/autopilot/notes_app/tests/__init__.py 2014-03-10 16:45:41 +0000
43+++ tests/autopilot/notes_app/tests/__init__.py 2014-08-07 14:37:59 +0000
44@@ -14,7 +14,6 @@
45 except ImportError:
46 import BaseHTTPServer as server
47 import errno
48-import glob
49 try:
50 from hashlib import md5
51 except ImportError:
52@@ -23,18 +22,25 @@
53 import os.path
54 import socket
55 import threading
56+import logging
57
58+from autopilot import logging as autopilot_logging
59 from autopilot.input import Mouse, Touch, Pointer
60 from autopilot.matchers import Eventually
61 from autopilot.platform import model
62 from autopilot.testcase import AutopilotTestCase
63 from testtools.matchers import Equals
64
65-from ubuntuuitoolkit.emulators import UbuntuUIToolkitEmulatorBase
66+from ubuntuuitoolkit import (
67+ base,
68+ emulators as toolkit_emulators,
69+)
70
71 from notes_app.emulators.notesapp import NotesApp
72 from . import imagedata
73
74+logger = logging.getLogger(__name__)
75+
76
77 class NotesAppTestCase(AutopilotTestCase):
78
79@@ -48,52 +54,54 @@
80 else:
81 scenarios = [('with touch', dict(input_device_class=Touch))]
82
83- local_location = "../../NotesApp.qml"
84+ working_dir = os.getcwd()
85+ local_location_dir = os.path.dirname(os.path.dirname(working_dir))
86+ local_location = local_location_dir + "/NotesApp.qml"
87+ installed_location = "/usr/share/notes-app/NotesApp.qml"
88+
89+ def setup_environment(self):
90+ if os.path.exists(self.local_location):
91+ launch = self.launch_test_local
92+ test_type = 'local'
93+ elif os.path.exists(self.installed_location):
94+ launch = self.launch_test_installed
95+ test_type = 'deb'
96+ else:
97+ launch = self.launch_test_click
98+ test_type = 'click'
99+ return launch, test_type
100
101 def setUp(self):
102+ launch, self.test_type = self.setup_environment()
103 self.pointing_device = Pointer(self.input_device_class.create())
104 super(NotesAppTestCase, self).setUp()
105- self.launch_app()
106- self.main_window.visible.wait_for(True)
107- self.main_window.close_toolbar()
108-
109- """Workaround to find the qmlscene binary via shell globbing.
110- This is needed since we can't rely on qt5-default being installed on
111- devices to make qmlscene available in the path"""
112- def qmlscene(self):
113- return glob.glob("/usr/lib/*/qt5/bin/qmlscene")[0]
114-
115- def launch_app(self):
116- if os.path.exists(self.local_location):
117- self.launch_app_local()
118- elif os.path.exists('/usr/share/notes-app/NotesApp.qml'):
119- self.launch_app_installed()
120- else:
121- self.launch_click_installed()
122-
123- def launch_app_local(self):
124- self.app = self.launch_test_application(
125- self.qmlscene(),
126- "-I",
127- "../../src",
128- "../../NotesApp.qml",
129- emulator_base=UbuntuUIToolkitEmulatorBase)
130-
131- def launch_app_installed(self):
132- self.app = self.launch_test_application(
133- self.qmlscene(),
134- "/usr/share/notes-app/NotesApp.qml",
135- "--desktop_file_hint=/usr/share/applications/notes-app.desktop",
136- app_type='qt',
137- emulator_base=UbuntuUIToolkitEmulatorBase)
138-
139- def launch_click_installed(self):
140+ launch()
141+
142+ @autopilot_logging.log_action(logger.info)
143+ def launch_test_local(self):
144+ self.app = self.launch_test_application(
145+ base.get_qmlscene_launch_command(),
146+ self.local_location,
147+ app_type='qt',
148+ emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
149+
150+ @autopilot_logging.log_action(logger.info)
151+ def launch_test_installed(self):
152+ self.app = self.launch_test_application(
153+ base.get_qmlscene_launch_command(),
154+ self.installed_location,
155+ app_type='qt',
156+ emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
157+
158+ @autopilot_logging.log_action(logger.info)
159+ def launch_test_click(self):
160 self.app = self.launch_click_package(
161 "com.ubuntu.notes",
162- emulator_base=UbuntuUIToolkitEmulatorBase)
163+ emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
164
165 def launch_and_quit_app(self):
166- self.launch_app()
167+ launch, self.test_type = self.setup_environment()
168+ launch()
169 self.main_window.visible.wait_for(True)
170
171 # When calling launch_app an instance of the spawned process
172@@ -145,7 +153,6 @@
173 self.assertThat(note.isExpanded, Eventually(Equals(False)))
174
175
176-
177 class HTTPRequestHandler(server.BaseHTTPRequestHandler):
178
179 """
180
181=== modified file 'tests/autopilot/notes_app/tests/test_delete.py'
182--- tests/autopilot/notes_app/tests/test_delete.py 2014-07-09 15:03:22 +0000
183+++ tests/autopilot/notes_app/tests/test_delete.py 2014-08-07 14:37:59 +0000
184@@ -38,7 +38,7 @@
185 conn.commit()
186 conn.close()
187
188- def test_slide_to_delete_right(self):
189+ def test_slide_to_delete(self):
190 note = self.main_window.get_notes()[0]
191 listitem = self.main_window.get_note_listitem(note)
192 listitem.swipe_to_delete()

Subscribers

People subscribed via source and target branches