views:

43

answers:

2

Our JUnits take a total of 6 hours to run. Is there an easy way to run 1/n of them on n different machines?

A: 

Just off the top of my head, one option is to use TeamCity and have different build scripts that know how you want to partition the tests, and set those up as separate projects (each partition), and then set up n agents, which can be done using Amazon EC2 allowing for large values of n.

Since you probably want more than 3 agents, you would be out of their free product territory.

Some assumptions here: There is no common database that ties all of these tests together and all the tests can otherwise run independently of each other.

If there is a common database, that makes things much more complicated, as you would need a database for each agent so the tests don't step on each other (and of course farming out the computing power to EC2 would probably be impractical).

Yishai
+2  A: 

GridGain (a free cloud implementation) is able to distribute JUnit tests runs across a cluster of nodes. See Distributed JUnit Overview.

Just in case, this is not exactly what you're asking for but TestNG can run tests in parallel (thi would already make your build faster). See Advanced parallel testing with TestNG and data providers.

See also

Pascal Thivent