[Pkg-bazaar-maint] Proposed change to bzr debian/rules to run more tests

Max Bowsher maxb at f2s.com
Wed Nov 24 15:29:37 UTC 2010

On 24/11/10 13:37, Jelmer Vernooij wrote:
> Hi Max,
> On Wed, 2010-11-24 at 00:19 +0000, Max Bowsher wrote:
>> I am proposing that in the bzr package, we change:
>> common-post-build-indep::
>>     ./bzr selftest --no-plugins
>> to
>> common-post-build-arch::
>>     PYTHONPATH=`pwd`/`python -c 'import sys, distutils.util; print
>> "build/lib.%s-%s" % (distutils.util.get_platform(), sys.version[0:3])'` \
>>                `pwd`/`python -c 'import sys; print "build/scripts-%s" %
>> (sys.version[0:3],)'`/bzr selftest --no-plugins
>> .
>> The problem with the existing invocation is that it tests bzr without
>> any of the compiled extensions, so does not truly match what we go on to
>> install.
>> My proposed change is fairly horrid looking - more elegant ways of
>> achieving this are gratefully accepted.

> I like the idea of running the tests in an environment that's closer to
> what is going to end up in the package.
> However, I'm not sure the risk of adding this (and getting it wrong) is
> worth the gain.

If we get it wrong, the result will be a build failure, not a silent
test skip, so it's not much of a risk.

> If we run the tests from the build directory then that
> means we'll use the extensions but it'll still be different from what
> actually gets installed.

Technically true, though OOI, I am not aware of it differing in any
substantial way. Are you?

> And we don't run the tests of the plugins that
> are bundled yet.

Why are we executing selftest with --no-plugins anyway? Is it just for
the convenience of people hacking on the package outside of a minimal
chroot environment? Can we simply do BZR_PLUGIN_PATH=-user:-site instead?

> I'd prefer to just run the tests out of debian/tmp, so from the install
> prefix and including the plugins, etc. 

The main reason to *not* run the tests on the debian/tmp version is that
this will unavoidably mean running the testsuite under fakeroot/sudo on
the buildds.

Granted, it *already* runs under fakeroot/sudo at the moment (because
cdbs's definition of common-post-build-* is quirky, and actually runs
under "debian/rules binary" not "debian/rules build" despite the name),
but at least, if we figure the right incantation to bind cdbs to our
will, the invocation I suggested will be movable to run during the
"debian/rules build" phase.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-bazaar-maint/attachments/20101124/1d7b25a5/attachment.pgp>

More information about the Pkg-bazaar-maint mailing list