Merge lp:~ahayzen/ubuntu-weather-app/fix-control-depends-01 into lp:ubuntu-weather-app

Proposed by Andrew Hayzen
Status: Needs review
Proposed branch: lp:~ahayzen/ubuntu-weather-app/fix-control-depends-01
Merge into: lp:ubuntu-weather-app
Diff against target: 175 lines (+88/-4)
6 files modified
app/components/NoAPIKeyErrorStateComponent.qml (+2/-2)
debian/changelog (+1/-0)
debian/control (+2/-0)
tests/autopilot/ubuntu_weather_app/__init__.py (+26/-0)
tests/autopilot/ubuntu_weather_app/fixture_setup.py (+52/-0)
tests/autopilot/ubuntu_weather_app/tests/__init__.py (+5/-2)
To merge this branch: bzr merge lp:~ahayzen/ubuntu-weather-app/fix-control-depends-01
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Needs Fixing
Victor Thompson Needs Information
Review via email: mp+282241@code.launchpad.net

Commit message

* Fixes for missing packages in debian/control

Description of the change

* Fixes for missing packages in debian/control

On a blank install in Wily I had to manually install these packages to get the weather-app to run.

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

I'm not sure why this is failing--but it looks good to me.

Could you also fix app/components/NoAPIKeyErrorStateComponent.qml to use Ubuntu.Components 1.3. Not sure how that got set to 1.5... Seems silly to make an MP just for that.

review: Needs Information
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

The first failure is due to the location allow/deny appearing, the same as clock. The other two appear to be due to not enough locations in the list, I assume because it has no current location or it wasn't added correctly.

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/weather-app-autolanding/412/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/1565/console

review: Needs Fixing (continuous-integration)

Unmerged revisions

202. By Andrew Hayzen

* Extra debugging

201. By Andrew Hayzen

* Add GeolocationPermissionRequest helper

200. By Andrew Hayzen

* Split stop and start commands

199. By Andrew Hayzen

* Run location service in background

198. By Andrew Hayzen

* Add fixture to fix location issues
* Update copyright years

197. By Andrew Hayzen

* Fix for incorrect Ubuntu.Components version

196. By Andrew Hayzen

Fixes for missing packages in debian/control

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/components/NoAPIKeyErrorStateComponent.qml'
2--- app/components/NoAPIKeyErrorStateComponent.qml 2015-11-12 01:45:36 +0000
3+++ app/components/NoAPIKeyErrorStateComponent.qml 2016-01-20 16:35:28 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright (C) 2015 Canonical Ltd
7+ * Copyright (C) 2015, 2016 Canonical Ltd
8 *
9 * This file is part of Ubuntu Weather App
10 *
11@@ -17,7 +17,7 @@
12 */
13
14 import QtQuick 2.4
15-import Ubuntu.Components 1.5
16+import Ubuntu.Components 1.3
17 import "../components"
18
19
20
21=== modified file 'debian/changelog'
22--- debian/changelog 2015-12-17 02:29:07 +0000
23+++ debian/changelog 2016-01-20 16:35:28 +0000
24@@ -2,6 +2,7 @@
25
26 [ Andrew Hayzen ]
27 * Release 3.1 and bump version to 3.2
28+ * Fixes for missing packages in debian/control
29
30 [ Girish Rawat ]
31 * Added new READMEs
32
33=== modified file 'debian/control'
34--- debian/control 2015-02-09 16:36:43 +0000
35+++ debian/control 2016-01-20 16:35:28 +0000
36@@ -22,6 +22,8 @@
37 Depends: qmlscene,
38 qtdeclarative5-localstorage-plugin,
39 qml-module-qt-labs-settings,
40+ qtdeclarative5-qtlocation-plugin,
41+ qtdeclarative5-qtpositioning-plugin,
42 qtdeclarative5-qtquick2-plugin,
43 qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
44 suru-icon-theme | ubuntu-mobile-icons,
45
46=== modified file 'tests/autopilot/ubuntu_weather_app/__init__.py'
47--- tests/autopilot/ubuntu_weather_app/__init__.py 2015-11-03 00:38:48 +0000
48+++ tests/autopilot/ubuntu_weather_app/__init__.py 2016-01-20 16:35:28 +0000
49@@ -98,6 +98,16 @@
50
51 self.pointing_device.drag(start_x, start_y,
52 start_x, stop_y, rate=2)
53+
54+ # If the GeoLocation dialog appears select allow
55+ try:
56+ location = self.main_view.wait_select_single(
57+ GeolocationPermissionRequest)
58+ location.click_allow_button()
59+ location.wait_until_destroyed()
60+ except dbus.StateNotFoundError as e:
61+ logger.error("Could not allow location (%s)" % e)
62+
63 self.isReady.wait_for(True)
64 except dbus.StateNotFoundError:
65 logger.error('BottomEdge element not found.')
66@@ -179,6 +189,22 @@
67 objectName="windForecast").value
68
69
70+class GeolocationPermissionRequest(UbuntuUIToolkitCustomProxyObjectBase):
71+ @click_object
72+ def click_allow_button(self):
73+ return self.get_allow_button()
74+
75+ @click_object
76+ def click_deny_button(self):
77+ return self.get_deny_button()
78+
79+ def get_allow_button(self):
80+ return self.select_single("Button", objectName="allow")
81+
82+ def get_deny_button(self):
83+ return self.select_single("Button", objectName="deny")
84+
85+
86 class HomePage(PageWithBottomEdge):
87 """Autopilot helper for HomePage."""
88 def __init__(self, *args, **kwargs):
89
90=== added file 'tests/autopilot/ubuntu_weather_app/fixture_setup.py'
91--- tests/autopilot/ubuntu_weather_app/fixture_setup.py 1970-01-01 00:00:00 +0000
92+++ tests/autopilot/ubuntu_weather_app/fixture_setup.py 2016-01-20 16:35:28 +0000
93@@ -0,0 +1,52 @@
94+# Copyright (C) 2014, 2016 Canonical Ltd
95+#
96+# This file is part of Ubuntu Weather App
97+#
98+# Ubuntu Clock App is free software: you can redistribute it and/or modify
99+# it under the terms of the GNU General Public License version 3 as
100+# published by the Free Software Foundation.
101+#
102+# Ubuntu Clock App is distributed in the hope that it will be useful,
103+# but WITHOUT ANY WARRANTY; without even the implied warranty of
104+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
105+# GNU General Public License for more details.
106+#
107+# You should have received a copy of the GNU General Public License
108+# along with this program. If not, see <http://www.gnu.org/licenses/>.
109+
110+"""Clock app autopilot fixtures."""
111+
112+import fixtures
113+import logging
114+import subprocess
115+
116+
117+class LocationServiceTestEnvironment(fixtures.Fixture):
118+
119+ def setUp(self):
120+ super(LocationServiceTestEnvironment, self).setUp()
121+ self._set_location_service_testing(True)
122+ self.addCleanup(self._set_location_service_testing, False)
123+
124+ def _set_location_service_testing(self, test_mode):
125+ test = 'true' if test_mode else 'false'
126+ logger = logging.getLogger(__name__)
127+
128+ try:
129+ subprocess.check_call(
130+ "sudo service ubuntu-location-service stop",
131+ shell=True)
132+ except subprocess.CalledProcessError as e:
133+ logger.error('Unable to stop location service (%s).' % e)
134+
135+ try:
136+ subprocess.check_call(
137+ "sudo /usr/bin/ubuntu-location-serviced"
138+ " --bus system --provider dummy::Provider"
139+ " --dummy::Provider::ReferenceLocationLat=51.50853"
140+ " --dummy::Provider::ReferenceLocationLon=-0.12574 & disown",
141+ shell=True)
142+ except subprocess.CalledProcessError as e:
143+ logger.error('Unable to start location service in testing mode '
144+ 'tests may fail as a result. (%s)' % e)
145+
146
147=== modified file 'tests/autopilot/ubuntu_weather_app/tests/__init__.py'
148--- tests/autopilot/ubuntu_weather_app/tests/__init__.py 2015-08-18 23:48:51 +0000
149+++ tests/autopilot/ubuntu_weather_app/tests/__init__.py 2016-01-20 16:35:28 +0000
150@@ -1,6 +1,6 @@
151 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
152 #
153-# Copyright (C) 2013, 2014, 2015 Canonical Ltd
154+# Copyright (C) 2013, 2014, 2015, 2016 Canonical Ltd
155 #
156 # This program is free software: you can redistribute it and/or modify
157 # it under the terms of the GNU General Public License version 3 as
158@@ -24,7 +24,7 @@
159 import logging
160
161 import fixtures
162-from ubuntu_weather_app import UbuntuWeatherApp
163+from ubuntu_weather_app import fixture_setup, UbuntuWeatherApp
164 import ubuntu_weather_app
165
166 from autopilot import logging as autopilot_logging
167@@ -65,6 +65,9 @@
168
169 def setUp(self):
170 super(BaseTestCaseWithPatchedHome, self).setUp()
171+
172+ self.useFixture(fixture_setup.LocationServiceTestEnvironment())
173+
174 self.launcher, self.test_type = self.get_launcher_method_and_type()
175 self.home_dir = self._patch_home()
176

Subscribers

People subscribed via source and target branches

to all changes: