[MERGE] Speedup selftest by loading a previously saved test list
John Arbash Meinel
john at arbash-meinel.com
Tue Mar 4 16:49:45 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Vincent Ladeuil wrote:
> Time passed....
>
>>>>>> "robert" == Robert Collins <robertc at robertcollins.net> writes:
>
> robert> bb:approve
> robert> This can likely be tweaked to be a bit more understandable,
>
> Indeed. I wanted the concept approved first.
>
> robert> but the code itself appears solid to me. Another
> robert> useful tweak would be to allow:
>
> robert> 'bzr selftest --module bzrlib.plugins.bzrtools' (for instance) - to use
> robert> an id filter supplied on the command line.
>
> It would be trivial to add on top of this patch. But again, I'd like
> to reach an agreement on the modifications made.
>
> robert> -Rob
>
> Summary:
>
> - test_suite() imposes no constraints on test loader used nor test suite
> returned,
>
> - load_tests provides a loader.
>
> Solution:
>
> - convert modules using test_suite to the use load_tests instead.
> - then use a specialized loader to reduce loading time
>
> It turned out that the most "interesting" modules (those
> consuming the most loading time) were in fact perfect candidate
> for load_tests since they were already really adapting tests.
>
> Doing so also permitted to delete the packages_to_test function
> since all the modules could now be loaded in the same way.
>
> That simplified bzrlib.tests.test_suite() to only three kind sub
> test suites built:
> - vanilla test modules,
> - doc test modules,
> - plugins
>
> I leave the plugins as is so far, but it may be interesting to
> allow them to use the load_tests facility too.
>
> Finally I had some sanity checks when loading tests from a list
> and tried loading each test independently. This revealed small
> import or test naming bugs that I fixed.
>
> Vincent
BB:comment
Overall this looks like a decent patch. I wonder if we shouldn't
continue to use test_suite() when possible and just have it thunk into
load_tests(...). I'm not sure if it is worthwhile as long as we keep
bzrlib.tests.test_suite().
I also wonder how broken we are relative to other test suite runners,
but I don't see any direct indication of our test suite not working for
it, since we still have our topmost .test_suite() call which is still
returning TestSuite objects, etc. So I don't think your patch would
change our compatibility in an direct sense.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHzX2pJdeBCYSNAAMRAiWTAJ9ipM+1QXcDCGSep2YRY7IbCK2b1wCgl8Tj
kqPVijh8Mi/Ejyytt3MqBog=
=5Cmg
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list