Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is kind of a hack, but we use it for similar reasons with Findbugs and Checkstyle. You can set up an Ant task to do the following (this can be split out into multiple tasks, but I'm combining them for brevity):</p> <ol> <li>Run tests with coverage</li> <li>Parse the coverage results and get the coverage percentage</li> <li>Read tmp/lastCoverage.txt from last build (see step #5a)</li> <li>Compare the current coverage percentage with the percentage read from lastCoverage.txt</li> <li><ol> <li>If percentage DIDN'T decrease, write the new percentage over the contents of tmp/lastCoverage.txt</li> <li>If percentage DID decrease, keep the original file and echo "COVERAGE FAILURE" (with ant's <code>echo</code> task).</li> </ol></li> </ol> <p>Note that steps 2 through 5 don't necessarily need to be done with native Ant tasks - you could use something like Ant's <code>javac</code> task to run a Java program to do this for you.</p> <p>Then, configure Hudson:</p> <ul> <li>Under "Source code management", make sure "Use Update" is checked. This will allow your lastCoverage.txt file to be retained between builds. Note that this could be problematic if you really, really need things to be cleaned between builds.</li> <li>Use the <a href="http://hudson.gotdns.com/wiki/display/HUDSON/Text-finder+Plugin" rel="nofollow noreferrer">Hudson Text Finder</a> plugin with a regular expression to search for "COVERAGE FAILURE" in the build output (make sure that "Also search console output" is checked for the plugin). The text finder plugin can mark the build unstable.</li> </ul> <p>You can obviously replace things like the file name/path and console output to whatever fits within the context of your build.</p> <p>As I mentioned above, this is rather hacky, but it's probably one of the few (only?) ways to get Hudson to compare things in the previous build to the current build.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload