[MERGE/RFC] 'bzr selftest --load bzrlib.tests.test_foo'

John Arbash Meinel john at arbash-meinel.com
Wed May 9 04:34:23 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On my Mac laptop, loading all of the test suite takes a significant
amount of time:

bzr selftest notestsmatchthingstriaoue
6.53s user 1.55s system 61% cpu 13.037 total

So it takes 13s just to find out there aren't any tests to run.

The attached patch adds a parameter to 'bzr selftest', which lets you
specify specific test files to load.

The difference is huge for me:
./bzr selftest --load bzrlib.tests.test_selftest notestsebaonetuha
0.50s user 0.66s system 82% cpu 1.407 total

I don't know if it is just my laptop, or if it is Apple, but being able
to run a subset and more importantly only have that subset loaded, makes
me a lot happier (especially when attempting to do TDD).

I'm not settled on the parameter name (--load). And it might be nice to
specify a path rather than a python path (bzrlib/tests/test_foo.py
rather than bzrlib.tests.test_foo), because bash can auto-complete them.

Another possibility would be to use the auto-loading code, and be able
to pass in a parameter that would let only load a module if it matched
the regex. So sort of like our existing regex match, only applied solely
to filenames.

I probably prefer that, but it depends on code that isn't approved, and
this was easy to write.

Thoughts and feedback are welcome.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGQUE/JdeBCYSNAAMRAmopAKC1sFOywUfjX4TqgHlpx2ZTpEc8MgCgoGmy
GtSWI4ph/7HfriN8AlllUV4=
=TzG9
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: selftest_only.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20070508/d596068a/attachment-0001.diff 


More information about the bazaar mailing list