Rev 6042: (vila) Properly report a test failure when selfest can't create its safety in file:///home/pqm/archives/thelove/bzr/2.4/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Wed Aug 31 10:31:44 UTC 2011
At file:///home/pqm/archives/thelove/bzr/2.4/
------------------------------------------------------------
revno: 6042 [merge]
revision-id: pqm at pqm.ubuntu.com-20110831103140-tmbqgxm1o2wea1rz
parent: pqm at pqm.ubuntu.com-20110830215254-znnsj21xfei9za3v
parent: v.ladeuil+lp at free.fr-20110831062252-emvucu4i4goc8s1m
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.4
timestamp: Wed 2011-08-31 10:31:40 +0000
message:
(vila) Properly report a test failure when selfest can't create its safety
net. (Vincent Ladeuil)
modified:
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
doc/en/release-notes/bzr-2.4.txt bzr2.4.txt-20110114053217-k7ym9jfz243fddjm-1
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2011-08-09 09:11:17 +0000
+++ b/bzrlib/tests/__init__.py 2011-08-31 06:22:52 +0000
@@ -2537,7 +2537,16 @@
real branch.
"""
root = TestCaseWithMemoryTransport.TEST_ROOT
- wt = bzrdir.BzrDir.create_standalone_workingtree(root)
+ try:
+ # Make sure we get a readable and accessible home for .bzr.log
+ # and/or config files, and not fallback to weird defaults (see
+ # http://pad.lv/825027).
+ self.assertIs(None, os.environ.get('BZR_HOME', None))
+ os.environ['BZR_HOME'] = root
+ wt = bzrdir.BzrDir.create_standalone_workingtree(root)
+ del os.environ['BZR_HOME']
+ except Exception, e:
+ self.fail("Fail to initialize the safety net: %r\nExiting\n" % (e,))
# Hack for speed: remember the raw bytes of the dirstate file so that
# we don't need to re-open the wt to check it hasn't changed.
TestCaseWithMemoryTransport._SAFETY_NET_PRISTINE_DIRSTATE = (
=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt 2011-08-30 07:27:16 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt 2011-08-30 14:35:11 +0000
@@ -70,6 +70,10 @@
suite. This can include new facilities for writing tests, fixes to
spurious test failures and changes to the way things should be tested.
+* The test suite should now be able to run under weird environments where
+ ``/etc/passwd`` doesn't contain the ``uid`` for the user running selftest
+ or where ``fakeroot`` is used but ``/root`` is inacessible.
+ (Vincent Ladeuil, #825027)
bzr 2.4.0
#########
More information about the bazaar-commits
mailing list