Quantcast

Problem with the CloverPublisher plugin

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Problem with the CloverPublisher plugin

austin_ios_developer
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Problem with the CloverPublisher plugin

Mark Waite
If the clover publisher and gcovr route does not work for you, you could consider an alternate technique.
 
I use the "lcov" command (usually bundled with gcov) to convert the gcov results into HTML pages (browsable source code annotated with the coverage results) and then use the HTML publisher plugin to make those HTML pages available from Jenkins.  The resulting web pages are not as well integrated into Jenkins as the clover output, but it works reliably for me.
 
Mark Waite

From: austin_ios_developer <[hidden email]>
To: [hidden email]
Sent: Tuesday, August 21, 2012 3:43 PM
Subject: Problem with the CloverPublisher plugin

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.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Problem with the CloverPublisher plugin

austin_ios_developer
Thanks, Mark. Reports from lcov look pretty cool. Certainly better than a crash :-)


Brant Merryman
email[hidden email]
cell(512) 547-7400
skypebrant_sears

On Aug 21, 2012, at 4:50 PM, Mark Waite <[hidden email]> wrote:

If the clover publisher and gcovr route does not work for you, you could consider an alternate technique.
 
I use the "lcov" command (usually bundled with gcov) to convert the gcov results into HTML pages (browsable source code annotated with the coverage results) and then use the HTML publisher plugin to make those HTML pages available from Jenkins.  The resulting web pages are not as well integrated into Jenkins as the clover output, but it works reliably for me.
 
Mark Waite

From: austin_ios_developer <[hidden email]>
To: [hidden email]
Sent: Tuesday, August 21, 2012 3:43 PM
Subject: Problem with the CloverPublisher plugin

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.



Loading...