lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Harris <>
Subject Efficiently running a single test class' tests?
Date Fri, 04 Sep 2009 17:35:32 GMT
I gather that you can run the tests from a single test class by
specifying that class's name like so:

    ant test -Dtestcase=ShingleFilterTest

This saves time over doing "ant test" without the testcase argument,
but it's still not at all fast on my machine. To be more specific, I
tried the following:

 * download a fresh Lucene r811157
 * run "ant test -Dtestcase=ShingleFilterTest" a first time, to make
sure everything required to run this test gets built
 * run "ant test -Dtestcase=ShingleFilterTest" a second time, to see
how long running the single test takes once everything is built

This second invocation to ant took 7 minutes, 8 seconds for ant to
finish. Most of the time was obviously not spent running the
ShingleFilterTest itself. According to the
TEST-org.apache.lucene.analysis.shingle.ShingleFilterTest.xml output
file, running that particular class took only


which I assume is in seconds. So the great bulk of the "ant test"
seems to be spent in various ant housecleaning tasks, trying to verify
that everything is indeed built, and/or looking for test classes that
might match the name "ShingleFilterTest".

I tried running

    ant test-contrib -Dtestcase=ShingleFilterTest

to see if limiting to contrib would be any faster. That came back in 5
minutes, 27 seconds. Which is better, but still in the same ballpark.

Is this the sort of time other people see when running a single test
through ant? What alternatives are there if you want to be able to run
a given test really fast -- say, after a 10 second delay, rather than
a 5 minute delay? Does this become trivial once you set up Lucene
properly in an IDE? Any quick command-line techniques?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message