Merge lp:~thomir-deactivatedaccount/ubuntu-calendar-app/trunk-fix-ugly-bits into lp:ubuntu-calendar-app

Proposed by Charles Kerr
Status: Rejected
Rejected by: Nicholas Skaggs
Proposed branch: lp:~thomir-deactivatedaccount/ubuntu-calendar-app/trunk-fix-ugly-bits
Merge into: lp:ubuntu-calendar-app
Diff against target: 26 lines (+6/-3)
1 file modified
tests/autopilot/calendar_app/tests/__init__.py (+6/-3)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/ubuntu-calendar-app/trunk-fix-ugly-bits
Reviewer Review Type Date Requested Status
Nicholas Skaggs (community) Disapprove
Review via email: mp+221099@code.launchpad.net

Commit message

Fix tmp directory breakage that occurred in unit test's scaffolding under some conditions.

Description of the change

Fix an error in the __init__.py of calendar_app's autopilot tests. '~' was not being expanded by python into a full path when click_test == true, causing tests to fail with:

File "/home/phablet/autopilot/calendar_app/tests/test_weekview.py", line 31, in setUp
super(TestWeekView, self).setUp()
File "/home/phablet/autopilot/calendar_app/tests/__init__.py", line 69, in setUp
self.home_dir = self._patch_home()
File "/home/phablet/autopilot/calendar_app/tests/__init__.py", line 128, in _patch_home
self.useFixture(temp_dir_fixture)
File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 628, in useFixture
fixture.setUp()
File "/usr/lib/python3/dist-packages/fixtures/_fixtures/tempdir.py", line 44, in setUp
self.path = tempfile.mkdtemp(dir=self.rootdir)
File "/usr/lib/python3.4/tempfile.py", line 434, in mkdtemp
_os.mkdir(file, 0o700)
FileNotFoundError: [Errno 2] No such file or directory: '~/autopilot/fakeenv/tmpy3o03xq5'
}}}

To post a comment you must log in.
Revision history for this message
Charles Kerr (charlesk) wrote :

Looks like Nick's done a separate fix at lp:~nskaggs/ubuntu-calendar-app/fix-ap-env-setup so maybe this isn't necessary anymore.

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

Sorry, I was out sick for the week. Thanks for the heads up on this and the suggested tweaks!

We've been iterating on getting test isolation going with apparmor; the other mp incorporates some of what's in here, so I'm going to just reject this.

review: Disapprove

Unmerged revisions

292. By Thomi Richards

Fixed bug where '~' was not being expanded, and cleaned up some other code.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/calendar_app/tests/__init__.py'
--- tests/autopilot/calendar_app/tests/__init__.py 2014-05-23 08:11:57 +0000
+++ tests/autopilot/calendar_app/tests/__init__.py 2014-05-27 15:06:10 +0000
@@ -48,8 +48,7 @@
48 else:48 else:
49 scenarios = [('with touch', dict(input_device_class=Touch))]49 scenarios = [('with touch', dict(input_device_class=Touch))]
5050
51 local_location = os.path.dirname(os.path.dirname(os.getcwd()))51 local_location_qml = os.path.join(os.getcwd(), '..', '..', 'calendar.qml')
52 local_location_qml = local_location + "/calendar.qml"
53 installed_location_qml = "/usr/share/calendar-app/calendar.qml"52 installed_location_qml = "/usr/share/calendar-app/calendar.qml"
5453
55 def get_launcher_and_type(self):54 def get_launcher_and_type(self):
@@ -120,7 +119,11 @@
120 #click requires apparmor profile, and writing to special dir119 #click requires apparmor profile, and writing to special dir
121 #but the desktop can write to a traditional /tmp directory120 #but the desktop can write to a traditional /tmp directory
122 if self.test_type == 'click':121 if self.test_type == 'click':
123 temp_dir = os.path.join('~', 'autopilot', 'fakeenv')122 temp_dir = os.path.join(
123 os.path.expanduser('~'),
124 'autopilot',
125 'fakeenv'
126 )
124 logger.debug(temp_dir)127 logger.debug(temp_dir)
125 temp_dir_fixture = fixtures.TempDir(temp_dir)128 temp_dir_fixture = fixtures.TempDir(temp_dir)
126 else:129 else:

Subscribers

People subscribed via source and target branches

to status/vote changes: