Monday, December 7, 2009

Interesting CI / test distribution strategy

From: the hudson user list

In order to split our build across multiple servers, we have implemented a JUnit "PartitionedSuite" class. When we run our build in maven, we say -Dtest=PartitionedSuite and we pass in an "x/y" parameter like "2/5" or "1/5". The "PartitionedSuite" class scans the classpath for JUnit test classes and puts them in "y" buckets based on the hash of the Test Class name, and then only executes the Tests in bucket number "x". This way, we just define the "x/y" parameter as a per-server variable, and execute the build on y servers, and each server runs one "Partition" of Tests.

No comments:

Post a Comment