Merge lp:~charlesk/unity8/indicator-tests into lp:unity8

Proposed by Charles Kerr
Status: Work in progress
Proposed branch: lp:~charlesk/unity8/indicator-tests
Merge into: lp:unity8
Diff against target: 111 lines (+45/-18)
2 files modified
tests/autopilot/unity8/indicators/tests/__init__.py (+35/-0)
tests/autopilot/unity8/indicators/tests/test_indicators.py (+10/-18)
To merge this branch: bzr merge lp:~charlesk/unity8/indicator-tests
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Allan LeSage Pending
Review via email: mp+247639@code.launchpad.net

Commit message

Description of the change

This branch is an attempt to track down the issues in https://code.launchpad.net/~indicator-applet-developers/unity8/indicator-power-autopilot-test/+merge/247079. Since Allan and I aren't able to reproduce the test failures locally, this is a "tracer" MP to try and find the problem.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~charlesk/unity8/indicator-tests updated
1525. By Charles Kerr

remove test_indicator_power.py

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Text conflict in tests/autopilot/unity8/indicators/tests/__init__.py
Text conflict in tests/autopilot/unity8/indicators/tests/test_indicators.py
2 conflicts encountered.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

I'll mark this as WiP since hasn't had the requested issues fixed for more than 2 months

Unmerged revisions

1525. By Charles Kerr

remove test_indicator_power.py

1524. By Charles Kerr

scaffolding only

1523. By Allan LeSage

Add proper assertion.

1522. By Allan LeSage

Mid-stream commit, moving around start-up, now a UnityTestCase.

1521. By Allan LeSage

Some experimental initctl changes.

1520. By Allan LeSage

Adding experimental indicator-power test, more to come.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/unity8/indicators/tests/__init__.py'
--- tests/autopilot/unity8/indicators/tests/__init__.py 2014-03-27 22:07:43 +0000
+++ tests/autopilot/unity8/indicators/tests/__init__.py 2015-01-26 22:01:01 +0000
@@ -15,3 +15,38 @@
15#15#
16# You should have received a copy of the GNU General Public License16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19from unity8 import process_helpers
20from unity8.shell.tests import (
21 UnityTestCase,
22 _get_device_emulation_scenarios,
23)
24
25
26class IndicatorTestCase(UnityTestCase):
27
28 scenarios = _get_device_emulation_scenarios()
29
30 def setUp(self):
31 super(IndicatorTestCase, self).setUp()
32 self._dirty_services = set()
33 self.unity_proxy = self.launch_unity()
34 process_helpers.unlock_unity(self.unity_proxy)
35
36 def start_test_service(self, service_name, *args):
37 """Restart a service (e.g. 'indicator-power-service') with test args.
38
39 Adds a no-arguments restart to addCleanup() so that the system
40 can reset to a nontest version of the service when the tests finish.
41 """
42 self._start_service(service_name, *args)
43 if service_name not in self._dirty_services:
44 self._dirty_services.add(service_name)
45 self.addCleanup(self._start_service, service_name)
46
47 @staticmethod
48 def _start_service(service_name, *args):
49 """Restart an upstart service; e.g. indicator-power-service"""
50 if process_helpers.is_job_running(service_name):
51 process_helpers.stop_job(service_name)
52 process_helpers.start_job(service_name, *args)
1853
=== modified file 'tests/autopilot/unity8/indicators/tests/test_indicators.py'
--- tests/autopilot/unity8/indicators/tests/test_indicators.py 2014-10-13 09:23:34 +0000
+++ tests/autopilot/unity8/indicators/tests/test_indicators.py 2015-01-26 22:01:01 +0000
@@ -18,24 +18,10 @@
1818
19from __future__ import absolute_import19from __future__ import absolute_import
2020
21from autopilot import platform
21from testscenarios import multiply_scenarios22from testscenarios import multiply_scenarios
2223
23from autopilot import platform24from unity8.indicators.tests import IndicatorTestCase
24
25from unity8.process_helpers import unlock_unity
26from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
27
28
29class IndicatorTestCase(UnityTestCase):
30
31 device_emulation_scenarios = _get_device_emulation_scenarios()
32
33 def setUp(self):
34 if platform.model() == 'Desktop':
35 self.skipTest('Test cannot be run on the desktop.')
36 super(IndicatorTestCase, self).setUp()
37 self.unity_proxy = self.launch_unity()
38 unlock_unity(self.unity_proxy)
3925
4026
41class IndicatorExistsTestCase(IndicatorTestCase):27class IndicatorExistsTestCase(IndicatorTestCase):
@@ -51,7 +37,7 @@
51 ]37 ]
52 scenarios = multiply_scenarios(38 scenarios = multiply_scenarios(
53 indicator_scenarios,39 indicator_scenarios,
54 IndicatorTestCase.device_emulation_scenarios40 IndicatorTestCase.scenarios
55 )41 )
5642
57 def setUp(self):43 def setUp(self):
@@ -59,6 +45,9 @@
59 if (platform.model() == 'Nexus 10' and45 if (platform.model() == 'Nexus 10' and
60 self.indicator_name == 'indicator-bluetooth'):46 self.indicator_name == 'indicator-bluetooth'):
61 self.skipTest('Nexus 10 does not have bluetooth at the moment.')47 self.skipTest('Nexus 10 does not have bluetooth at the moment.')
48 if platform.model() == 'Desktop':
49 # names exported differently in unity7
50 self.skipTest('Test cannot be run on the desktop.')
6251
63 def test_indicator_exists(self):52 def test_indicator_exists(self):
64 self.main_window._get_indicator_panel_item(53 self.main_window._get_indicator_panel_item(
@@ -86,7 +75,7 @@
86 ]75 ]
87 scenarios = multiply_scenarios(76 scenarios = multiply_scenarios(
88 indicator_scenarios,77 indicator_scenarios,
89 IndicatorTestCase.device_emulation_scenarios78 IndicatorTestCase.scenarios
90 )79 )
9180
92 def setUp(self):81 def setUp(self):
@@ -94,6 +83,9 @@
94 if (platform.model() == 'Nexus 10' and83 if (platform.model() == 'Nexus 10' and
95 self.indicator_name == 'indicator-bluetooth'):84 self.indicator_name == 'indicator-bluetooth'):
96 self.skipTest('Nexus 10 does not have bluetooth at the moment.')85 self.skipTest('Nexus 10 does not have bluetooth at the moment.')
86 if platform.model() == 'Desktop':
87 # names exported differently in unity7
88 self.skipTest('Test cannot be run on the desktop.')
9789
98 def test_indicator_page_title_matches_widget(self):90 def test_indicator_page_title_matches_widget(self):
99 """Swiping open an indicator must show its correct title.91 """Swiping open an indicator must show its correct title.

Subscribers

People subscribed via source and target branches