[Bug] run selftest on installed bzr

John Arbash Meinel john at arbash-meinel.com
Mon Aug 14 16:47:35 BST 2006


Alexander Belchenko wrote:
> 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

Well, there are 2 pieces here. We need to know what 'bzr' to run when
spawning bzr. cmd_selftest uses osutils.realpath(sys.argv[0]). Which may
be reasonable to use as part of the Test Suite. The only thing is that
theoretically, anything could run the test suite. I believe there are a
couple people who have used a gui unittest runner to run the bzr
selftest suite. And obviously that would fail.

So maybe the best thing to do would be to use a fallback. Something like:

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

if not os.path.exists(bzr_path):
  bzr_path = osutils.realpath(sys.argv[0])

> 
> This behaviour cause error in blackbox.test_diff: test_external_diff:

This should cause a failure in any 'run_bzr_subprocess' call. Though we
may only have 1 in the current test suite. (I know the benchmark suite
has a few more).

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060814/6b0820f4/attachment.pgp 


More information about the bazaar mailing list