I've started using Jenkins in order to compile and test my builds periodically. The job is fairly simple. It compiles the build and then executes the tests.
The test results are stored in a file. There's also a distinct line saying how many tests have passed. (Something like X tests passed out of Y).
I'd like to know what's the simplest way/plug-in to display these results at the end of the build.
I'd like a visual display, since I know Jenkins is very nice in displaying graphs over time/job.
I appreciate your help, and forgive me if this question already exists on Stackoverflow. I haven't found anything close enough for me.
You can install the Groovy Postbuild Plugin and use it to parse your distinct line and display it right next to your build result :
def matcher = manager.getLogMatcher("(.*) tests passed out of (.*)\$")
if(matcher != null && matcher.matches()) {
passedTests = matcher.group(1)
totalTests = matcher.group(2)
manager.addShortText("${passedTests} / ${totalTests}")
}
You could also enhance it with a badge or a customized color depending of the success ratio.
Hope it helps
Wouldn't it be better if you can publish your test results in a format that is more understandable by Jenkins? If so, see this link on how to generate a simple test result. Once you have done that, the visual display that Jenkins offers comes to you at free of cost.
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