[Bug] run selftest on installed bzr

Alexander Belchenko bialix at ukr.net
Fri Aug 11 09:37:00 BST 2006


When I run selftest on installed copy of bzr on Linux system I found
error in TestCase.run_bzr_subprocess method. This method assume that
user runs selftest only from bzr.dev source tree, because it try to
build full path to bzr script by this code:

         bzr_path = os.path.dirname(os.path.dirname(bzrlib.__file__))+'/bzr'

This approach is wrong if user try to run 'bzr selftest' in directory
where is no bzr.dev source tree present (e.g. in /tmp).

Code above seems very strange because when selftest started in verbose
output there is full path to actual bzr script:

        bzr: /usr/bin/bzr
     bzrlib: /usr/lib/python2.4/site-packages/bzrlib

This behaviour cause error in blackbox.test_diff: test_external_diff:

======================================================================
FAIL: test_external_diff (bzrlib.tests.blackbox.test_diff.TestExternalDiff)

vvvv[log from
bzrlib.tests.blackbox.test_diff.TestExternalDiff.test_external_diff]
relpath '.' => url '.'
converting os path '.' => url
file:///tmp/tmp/test0000.tmp/blackbox.test_diff.TestExternalDiff.test_external_diff
created control directory in
file:///tmp/tmp/test0000.tmp/blackbox.test_diff.TestExternalDiff.test_external_diff/
creating repository in
file:///tmp/tmp/test0000.tmp/blackbox.test_diff.TestExternalDiff.test_external_diff/.bzr/.
creating branch <bzrlib.branch.BzrBranchFormat5 object at 0x40843e6c> in
file:///tmp/tmp/test0000.tmp/blackbox.test_diff.TestExternalDiff.test_external_diff/.bzr/
got branch format Bazaar-NG Metadir branch format 5
got branch format Bazaar-NG Metadir branch format 5
opening working tree
u'/tmp/tmp/test0000.tmp/blackbox.test_diff.TestExternalDiff.test_external_diff'
failed to open
/tmp/tmp/test0000.tmp/blackbox.test_diff.TestExternalDiff.test_external_diff/.bzr/checkout/stat-cache: 

[Errno 2] No such file or directory:
u'/tmp/tmp/test0000.tmp/blackbox.test_diff.TestExternalDiff.test_external_diff/.bzr/checkout/stat-cache'
write hc
wrote working inventory
wrote working inventory
wrote working inventory
wrote working inventory
preparing to commit
Selecting files for commit with filter None
added revision_id {root at cvv-20060810133455-d2f1e70617a7665a}
add {root at cvv-20060810133455-d2f1e70617a7665a} to revision-history
cache hit for revision-history in
BzrBranch5('file:///tmp/tmp/test0000.tmp/blackbox.test_diff.TestExternalDiff.test_external_diff/')
cache hit for revision-history in
BzrBranch5('file:///tmp/tmp/test0000.tmp/blackbox.test_diff.TestExternalDiff.test_external_diff/')
wrote working inventory
preparing to commit
commit parent revision {root at cvv-20060810133455-d2f1e70617a7665a}
Selecting files for commit with filter None
added revision_id {root at cvv-20060810133456-e598f85a0814b496}
add {root at cvv-20060810133456-e598f85a0814b496} to revision-history
cache hit for revision-history in
BzrBranch5('file:///tmp/tmp/test0000.tmp/blackbox.test_diff.TestExternalDiff.test_external_diff/')
cache hit for revision-history in
BzrBranch5('file:///tmp/tmp/test0000.tmp/blackbox.test_diff.TestExternalDiff.test_external_diff/')

^^^^[log from
bzrlib.tests.blackbox.test_diff.TestExternalDiff.test_external_diff]
----------------------------------------------------------------------
Traceback (most recent call last):
   File
"/usr/lib/python2.4/site-packages/bzrlib/tests/blackbox/test_diff.py",
line 284, in test_external_diff
     self.assertEqual('', err)
AssertionError: '' != "/usr/bin/python: can't open file
'/usr/lib/python2.4/site-packages/bzr': [Errno 2] No such file or
directory\n"

======================================================================


--
Alexander






More information about the bazaar mailing list