Hi. I'm using Jenkins to build my iOS app and I want to add coverage
reports for my unit tests to my build.
So far, I have been able to successfully generate gcov output for my
project.
Next, I tried to look for a plugin that can interpret the gcov data and
roll it up into a report. The closest one I could find was CloverPublisher.
The instructions I found recommended gcovr to create xml output from my
coverage files.
Since Jenkins already was pointing at my workspace, I just created a build
step that calls a bash script which contains:
/usr/bin/gcovr -x>clover-report.xml
This results in an xml document being created inside of my workspace folder
that appears to be fine.
Next, I created a post build step "Publish Clover Coverage Report".
Since I am creating my "clover-report.xml" inside the workspace, I set the
Clover report Directory (which says to set it relative to workspace) as ".".
I gave the name of my clover report file name: clover-report.xml
I also set some Coverage Metric Targets.
Next I ran a build. The build failed. The raw console output shows (in
part):
Publishing Clang scan-build results
Publishing Clover coverage report...
Publishing Clover HTML report...
Publishing Clover XML report...
Publishing Clover coverage results...
ERROR: Publisher hudson.plugins.clover.CloverPublisher aborted due to exception
java.lang.NullPointerException
at
hudson.plugins.clover.CloverCoverageParser.trimPaths(CloverCoverageParser.java:31)
at
hudson.plugins.clover.CloverCoverageParser.parse(CloverCoverageParser.java:54)
at
hudson.plugins.clover.CloverPublisher.processCloverXml(CloverPublisher.java:202)
at
hudson.plugins.clover.CloverPublisher.perform(CloverPublisher.java:163)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:717)
at
hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:692)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at
hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:639)
at hudson.model.Run.execute(Run.java:1527)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:236)
Recording test results
[PostBuildScript] - Execution post build scripts.
[PostBuildScript] Build is not success : do not execute script
Build step '[PostBuildScript] - Execute a set of scripts' marked build as
failure
Email was triggered for: Failure
Email was triggered for: Still Failing
I'm confused about the NullPointerException.