Merge lp://staging/~vila/bzr/433120-tiger-selftest-regressions into lp://staging/bzr

Proposed by Vincent Ladeuil
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp://staging/~vila/bzr/433120-tiger-selftest-regressions
Merge into: lp://staging/bzr
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~vila/bzr/433120-tiger-selftest-regressions
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+12119@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

See commit message for details.
Nothing controversial I think , except that may be we may want
to call realpath on mkdtemp in osutils (i.e. make a real wrapper there
to ensure the path returned is always the real one),
but I find it a bit too much given that:
- the test failures have been rare so far,
- only tests are trapped because they want to compare the strings
  instead of the real paths,

It sounds a bit like the debate about disable_extensions_warning() to me :-/

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vincent Ladeuil wrote:
> Vincent Ladeuil has proposed merging lp:~vila/bzr/433120-tiger-selftest-regressions into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
> See commit message for details.
> Nothing controversial I think , except that may be we may want
> to call realpath on mkdtemp in osutils (i.e. make a real wrapper there
> to ensure the path returned is always the real one),
> but I find it a bit too much given that:
> - the test failures have been rare so far,
> - only tests are trapped because they want to compare the strings
> instead of the real paths,
>
> It sounds a bit like the debate about disable_extensions_warning() to me :-/
>

 review: approve
 merge: approve

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkq1GCsACgkQJdeBCYSNAAP1SgCgk8CJUlr/zP7ey/iFrGe+mhDy
jNcAnjvamH04fnztEUJNEAi+oSF2StPt
=QwpA
-----END PGP SIGNATURE-----

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/tests/__init__.py'
2--- bzrlib/tests/__init__.py 2009-09-18 08:55:12 +0000
3+++ bzrlib/tests/__init__.py 2009-09-19 16:14:10 +0000
4@@ -2346,7 +2346,9 @@
5
6 def _make_test_root(self):
7 if TestCaseWithMemoryTransport.TEST_ROOT is None:
8- root = osutils.mkdtemp(prefix='testbzr-', suffix='.tmp')
9+ # Watch out for tricky test dir (on OSX /tmp -> /private/tmp)
10+ root = osutils.realpath(osutils.mkdtemp(prefix='testbzr-',
11+ suffix='.tmp'))
12 TestCaseWithMemoryTransport.TEST_ROOT = root
13
14 self._create_safety_net()
15
16=== modified file 'bzrlib/tests/blackbox/test_outside_wt.py'
17--- bzrlib/tests/blackbox/test_outside_wt.py 2009-09-17 11:54:41 +0000
18+++ bzrlib/tests/blackbox/test_outside_wt.py 2009-09-19 16:14:10 +0000
19@@ -32,7 +32,8 @@
20 """Test that bzr gives proper errors outside of a working tree."""
21
22 def test_cwd_log(self):
23- tmp_dir = osutils.mkdtemp()
24+ # Watch out for tricky test dir (on OSX /tmp -> /private/tmp)
25+ tmp_dir = osutils.realpath(osutils.mkdtemp())
26 # We expect a read-to-root attempt to occur.
27 self.permit_url('file:///')
28 self.addCleanup(lambda: osutils.rmtree(tmp_dir))
29@@ -54,7 +55,8 @@
30 # A directory we can run commands from which we hope is not contained
31 # in a bzr tree (though if there is one at or above $TEMPDIR, this is
32 # false and may cause test failures).
33- tmp_dir = osutils.mkdtemp()
34+ # Watch out for tricky test dir (on OSX /tmp -> /private/tmp)
35+ tmp_dir = osutils.realpath(osutils.mkdtemp())
36 self.addCleanup(lambda: osutils.rmtree(tmp_dir))
37 # We expect a read-to-root attempt to occur.
38 self.permit_url('file:///')
39
40=== modified file 'bzrlib/tests/script.py'
41--- bzrlib/tests/script.py 2009-09-18 08:48:23 +0000
42+++ bzrlib/tests/script.py 2009-09-19 16:14:10 +0000
43@@ -349,7 +349,9 @@
44 try:
45 os.remove(p)
46 except OSError, e:
47- if e.errno == errno.EISDIR:
48+ # Various OSes raises different exceptions (linux: EISDIR,
49+ # win32: EACCES, OSX: EPERM) when invoked on a directory
50+ if e.errno in (errno.EISDIR, errno.EPERM, errno.EACCES):
51 if recursive:
52 osutils.rmtree(p)
53 else:
54
55=== modified file 'bzrlib/tests/test_osutils.py'
56--- bzrlib/tests/test_osutils.py 2009-09-17 06:49:43 +0000
57+++ bzrlib/tests/test_osutils.py 2009-09-19 16:14:10 +0000
58@@ -447,16 +447,12 @@
59 def test_canonical_relpath_simple(self):
60 f = file('MixedCaseName', 'w')
61 f.close()
62- # Watch out for tricky test dir (on OSX /tmp -> /private/tmp)
63- real_base_dir = osutils.realpath(self.test_base_dir)
64- actual = osutils.canonical_relpath(real_base_dir, 'mixedcasename')
65+ actual = osutils.canonical_relpath(self.test_base_dir, 'mixedcasename')
66 self.failUnlessEqual('work/MixedCaseName', actual)
67
68 def test_canonical_relpath_missing_tail(self):
69 os.mkdir('MixedCaseParent')
70- # Watch out for tricky test dir (on OSX /tmp -> /private/tmp)
71- real_base_dir = osutils.realpath(self.test_base_dir)
72- actual = osutils.canonical_relpath(real_base_dir,
73+ actual = osutils.canonical_relpath(self.test_base_dir,
74 'mixedcaseparent/nochild')
75 self.failUnlessEqual('work/MixedCaseParent/nochild', actual)
76