|
Follow the steps in this document to set up Clover's Test Optimization, which allows targeted testing of only the code which has changed since the last build. This page contains the basic steps for adding Clover's Test Optimization to an existing Maven configuration.
Command-line Quick StartThe quickest possible way to start using Test Optimization in Clover-for-Maven 2 is to run the following command: By default, the snapshot file gets saved to ${basedir}/. For further documentation on these goals, see the maven site docs: Alternatively, add the following profile to the profiles element in your pom.xml. Editing pom.xml for Test OptimizationTo enable Clover's test optimization functionality, add the following profile to the profiles element in your pom.xml: This will then make it possible to run the following command: Test Optimization In-ActionThe first time Clover Test Optimization is used a full test run will be done. You should see the following log message appear in the maven stdout: Screenshot: Clover-for-Maven Console Output 1 followed by this: Screenshot: Clover-for-Maven Console Output 2 If you then rerun the build, without modifying any source files (and ensuring the snapshot file is not deleted) you should see the following: Screenshot: Clover-for-Maven Console Output 3 followed by Screenshot: Clover-for-Maven Console Output 4 If a source file is modified in any way (including whitespace changes), and you re-run the build, only TestCases that cover the modified file will be run. By default, the same snapshot file is updated for 10 consecutive builds. On the 10th build, the snapshot file is deleted and recreated. You can adjust this setting via the fullRunEvery option on the clover2:optimize goal. TIP: If your terminal supports ANSI escape sequences (OS X, Linux by default), supply the Related Links |
|
|
|
|
|


at the end of the first build.






