Merge lp:~nskaggs/ubuntu-clock-app/fix-ap-setup into lp:ubuntu-clock-app

Proposed by Nicholas Skaggs
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 46
Merged at revision: 46
Proposed branch: lp:~nskaggs/ubuntu-clock-app/fix-ap-setup
Merge into: lp:ubuntu-clock-app
Diff against target: 101 lines (+36/-26)
1 file modified
tests/autopilot/ubuntu_clock_app/tests/__init__.py (+36/-26)
To merge this branch: bzr merge lp:~nskaggs/ubuntu-clock-app/fix-ap-setup
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Nekhelesh Ramananthan Approve
Review via email: mp+230187@code.launchpad.net

Commit message

Tweak AP setup and launching

Description of the change

Tweak AP setup and launching

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

lgtm! Thnx for removing the OSK hide workaround. Looks better now.

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/ubuntu_clock_app/tests/__init__.py'
2--- tests/autopilot/ubuntu_clock_app/tests/__init__.py 2014-08-02 12:57:23 +0000
3+++ tests/autopilot/ubuntu_clock_app/tests/__init__.py 2014-08-08 22:30:40 +0000
4@@ -22,8 +22,7 @@
5 import logging
6 import fixtures
7
8-from autopilot import input
9-from autopilot.platform import model
10+from autopilot import logging as autopilot_logging
11 from ubuntuuitoolkit import (
12 base,
13 emulators as toolkit_emulators
14@@ -40,52 +39,63 @@
15 clock-app tests.
16
17 """
18- local_location = "../../app/ubuntu-clock-app.qml"
19- local_backend_dir = "../../builddir/backend/"
20- installed_location = "/usr/share/ubuntu-clock-app/app/ubuntu-clock-app.qml"
21- installed_backend_dir = "/usr/share/ubuntu-clock-app/builddir/backend/"
22+
23+ local_location = os.path.dirname(os.path.dirname(os.getcwd()))
24+ local_location_qml = os.path.join(
25+ local_location, 'app/ubuntu-clock-app.qml')
26+ local_location_backend = os.path.join(local_location, 'builddir/backend')
27+ installed_location_backend = \
28+ '/usr/share/ubuntu-clock-app/builddir/backend'
29+ installed_location_qml = \
30+ '/usr/share/ubuntu-clock-app/app/ubuntu-clock-app.qml'
31+
32+ # note this directory could change to com.ubuntu.clock at some point
33 sqlite_dir = os.path.expanduser(
34- "~/.local/share/com.ubuntu.clock")
35+ "~/.local/share/com.ubuntu.clock.devel")
36 backup_dir = sqlite_dir + ".backup"
37
38 def setUp(self):
39- super(ClockAppTestCase, self).setUp()
40- self.pointing_device = input.Pointer(self.input_device_class.create())
41-
42- self.useFixture(fixtures.EnvironmentVariable('LC_ALL', newvalue='C'))
43-
44 # backup and wipe db's before testing
45 self.temp_move_sqlite_db()
46 self.addCleanup(self.restore_sqlite_db)
47
48- # turn off the OSK so it doesn't block screen elements
49- if model() != 'Desktop':
50- os.system("stop maliit-server")
51- self.addCleanup(os.system, "start maliit-server")
52-
53- if os.path.exists(self.local_location):
54- self.launch_test_local()
55- elif os.path.exists(self.installed_location):
56- self.launch_test_installed()
57+ launch, self.test_type = self.get_launcher_method_and_type()
58+ self.useFixture(fixtures.EnvironmentVariable('LC_ALL', newvalue='C'))
59+ super(ClockAppTestCase, self).setUp()
60+
61+ launch()
62+
63+ def get_launcher_method_and_type(self):
64+ if os.path.exists(self.local_location_backend):
65+ launcher = self.launch_test_local
66+ test_type = 'local'
67+ elif os.path.exists(self.installed_location_backend):
68+ launcher = self.launch_test_installed
69+ test_type = 'deb'
70 else:
71- self.launch_test_click()
72+ launcher = self.launch_test_click
73+ test_type = 'click'
74+ return launcher, test_type
75
76+ @autopilot_logging.log_action(logger.info)
77 def launch_test_local(self):
78 self.app = self.launch_test_application(
79 base.get_qmlscene_launch_command(),
80- self.local_location,
81- "-I", self.local_backend_dir,
82+ self.local_location_qml,
83+ "-I", self.local_location_backend,
84 app_type='qt',
85 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
86
87+ @autopilot_logging.log_action(logger.info)
88 def launch_test_installed(self):
89 self.app = self.launch_test_application(
90 base.get_qmlscene_launch_command(),
91- self.installed_location,
92- "-I", self.installed_backend_dir,
93+ self.installed_location_qml,
94+ "-I", self.installed_location_backend,
95 app_type='qt',
96 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
97
98+ @autopilot_logging.log_action(logger.info)
99 def launch_test_click(self):
100 self.app = self.launch_click_package(
101 "com.ubuntu.clock.devel",

Subscribers

People subscribed via source and target branches