TestVersion.test_main_version fails run from installed package

Bug #644855 reported by Martin Pool on 2010-09-22
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
High
Vincent Ladeuil
2.2
High
Vincent Ladeuil
2.3
High
Vincent Ladeuil

Bug Description

Running 'bzr selftest' from the installed version of bzr 2.3b1 from the bzr-beta-ppa fails like so:

FAIL: bzrlib.tests.blackbox.test_version.TestVersion.test_main_version
----------------------------------------------------------------------
_StringException: Text attachment: log
------------
238.743 run bzr: ['version']
238.743 bazaar version: 2.3b1
238.743 bzr arguments: ['version']
238.744 encoding stdout as sys.stdout encoding 'UTF-8'
238.746 Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1220, in run_bzr_catch_user_errors
    return run_bzr(argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1112, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 690, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 705, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1127, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 3648, in run
    show_version(to_file=self.outf)
  File "/usr/lib/python2.6/dist-packages/bzrlib/version.py", line 39, in show_version
    src_tree = _get_bzr_source_tree()
  File "/usr/lib/python2.6/dist-packages/bzrlib/version.py", line 101, in _get_bzr_source_tree
    control = bzrdir.BzrDir.open_containing(__file__)[0]
  File "/usr/lib/python2.6/dist-packages/bzrlib/bzrdir.py", line 758, in open_containing
    return BzrDir.open_containing_from_transport(transport)
  File "/usr/lib/python2.6/dist-packages/bzrlib/bzrdir.py", line 779, in open_containing_from_transport
    result = BzrDir.open_from_transport(a_transport)
  File "/usr/lib/python2.6/dist-packages/bzrlib/bzrdir.py", line 724, in open_from_transport
    hook(transport)
  File "/usr/lib/python2.6/dist-packages/bzrlib/tests/__init__.py", line 990, in _preopen_isolate_transport
    self._preopen_isolate_url(url)
  File "/usr/lib/python2.6/dist-packages/bzrlib/tests/__init__.py", line 1005, in _preopen_isolate_url
    % (url, self._bzr_selftest_roots))
BzrError: Attempt to escape test isolation: 'file:///usr/lib/python2.6/' ['file:///usr/lib/python2.6/dist-packages/']

238.746 output:
'Bazaar (bzr) 2.3b1\n'
238.746 errors:
"bzr: ERROR: Attempt to escape test isolation: 'file:///usr/lib/python2.6/' ['file:///usr/lib/python2.6/dist-packages/']\n"
------------
Text attachment: traceback
------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/testtools/runtest.py", line 128, in _run_user
    return fn(*args)
  File "/usr/lib/python2.6/dist-packages/testtools/testcase.py", line 368, in _run_test_method
    testMethod()
  File "/usr/lib/python2.6/dist-packages/bzrlib/tests/blackbox/test_version.py", line 39, in test_main_version
    output = self.run_bzr('version')[0]
AssertionError: Unexpected return code
not equal:
a = 0
b = 3

------------

Related branches

Vincent Ladeuil (vila) on 2010-09-22
Changed in bzr:
importance: Medium → High
Vincent Ladeuil (vila) on 2010-09-23
Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
Vincent Ladeuil (vila) wrote :

All these tests want to access the bzr source tree and fail otherwise.

The simplest fix is to skip these tests. That still leave *some* tests about 'bzr version' active (they use run_bzr_suprocess and as such are not affected by the problem).

Vincent Ladeuil (vila) on 2010-09-23
Changed in bzr:
status: Confirmed → In Progress
Vincent Ladeuil (vila) wrote :

For the record, this can be reproduced in a bzr source tree by doing:
   mv .bzr .bzr-hidden

Yeah, I know, ugly >-)

Vincent Ladeuil (vila) on 2010-09-28
Changed in bzr:
milestone: none → 2.1.4
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers