← Back to team overview

launchpad-dev team mailing list archive

Re: How to run a few unit tests a bit faster

 

On Thu, Aug 26, 2010 at 03:15:26PM +1200, Michael Hudson wrote:
> On Wed, 25 Aug 2010 21:58:55 -0400, Gary Poster <gary.poster@xxxxxxxxxxxxx> wrote:
> > I think most people use the -t option to bin/test to find tests to
> > run.  This finds all possible tests, and then filters.  If you are
> > only running some relatively svelte little tests without layer set up,
> > this can be very noticeable.
> >
> > You might like -m and -p.  -m runs the tests in a module.  -p runs the
> > tests in a package.  For me on Launchpad, -t is about 3 times slower
> > than -m or -p.
> 
> What's the difference between passing -m or -p and not passing any
> option at all?  The following all run the same number of tests at the
> same speed afaict:
> 
> ./bin/test -p lp.codehosting.vfs.tests -u
> ./bin/test -m lp.codehosting.vfs.tests -u
> ./bin/test lp.codehosting.vfs.tests -u
> 
> Also, I don't understand the difference between -m and -p, given that
> you pass a package to -m... oh, it seems that -m takes a regexp whereas
> -p takes a package path.  That suggests that -p ought to be fractionally
> faster, but it really doesn't seem to make any difference to me.
> 
> In any case, yeah, don't use -t if you can get away without it!

Well, unless -t is used together with -m or -p. That way you can filter
down to specific tests within the package or module, and it's still as
fast as -m or -p alone.


-- 
Björn Tillenius | https://launchpad.net/~bjornt



References