Is there anyone who was successful in getting a plot using Jenkins with the Measurement Plots plugin and a xUnit test results file with the tags?
If yes, I'd like to see a sample of a working xUnit file and get from you any tips you may have about configuring Jenkins and the appropriate Jenkins job to accomplish this feat.
I just figured it out with some help from the author. The trick is to escape the XML inside the XML and use <system-out>
to feed the Measurements Plot plugin. The steps below shows how to use it and feed various values into the plugin:
Execute Shell Command:
echo '<?xml version="1.0" encoding="UTF-8"?>' > testdetail-lcov.xml
echo '<testsuites name="CodeAnalysis" tests="2" failures="0" disabled="0" errors="0" time="0">' >> testdetail-lcov.xml
echo '<testsuite name="Suite" tests="1" >' >> testdetail-lcov.xml
echo '<testcase name="Case" status="run" time="0" classname="Suite">' >> testdetail-lcov.xml
echo '</testcase></testsuite>' >> testdetail-lcov.xml
echo '<testsuite tests="1" >' >> testdetail-lcov.xml
echo '<testcase name="Lcov" status="run" time="0" classname="CodeAnalysis.Coverage">' >> testdetail-lcov.xml
echo '<system-out>' >> testdetail-lcov.xml
echo "<measurement><name>Line Coverage</name><value>$VALUETEST</value></measurement>" >> testdetail-lcov.xml
echo '</system-out>' >> testdetail-lcov.xml
echo '</testcase></testsuite></testsuites>' >> testdetail-lcov.xml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With