shanbin / scoverage-plugin

Jenkins scoverage plugin for Scala code coverage
https://wiki.jenkins-ci.org/display/JENKINS/Scoverage+Plugin
MIT License
6 stars 19 forks source link

Scoverage is failing to publish reports #18

Closed EslamElHusseiny closed 7 years ago

EslamElHusseiny commented 7 years ago

I'm trying to use scoverage plugin to publish the coverage test reports, but it is failing I've tried to use plugin version 1.3.1 and 1.3 Jenkins version 2.19.3 Publishing Scoverage XML and HTML report ... ERROR: Build step failed with exception java.util.NoSuchElementException at java.util.LinkedList$ListItr.next(LinkedList.java:890) at org.jenkinsci.plugins.scoverage.ScoveragePublisher$ScovFinder.invoke(ScoveragePublisher.java:91) at org.jenkinsci.plugins.scoverage.ScoveragePublisher$ScovFinder.invoke(ScoveragePublisher.java:71) at hudson.FilePath.act(FilePath.java:1018) at hudson.FilePath.act(FilePath.java:996) at org.jenkinsci.plugins.scoverage.ScoveragePublisher.copyReport(ScoveragePublisher.java:106) at org.jenkinsci.plugins.scoverage.ScoveragePublisher.perform(ScoveragePublisher.java:66) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665) at hudson.model.Run.execute(Run.java:1745) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:404) Build step 'Publish Scoverage Report' marked build as failure

EslamElHusseiny commented 7 years ago

Misunderstanding of how to generate coverage reports. thought that sbt clean coverage test is enough

LikeBareFoot commented 7 years ago

Hi, El, Can you provide some details on how you resolved the problem? I run into the same problem, I tried to publish the coverage report, and I KNOW that the report is in my path: ~/.jenkins/workspace/relevance-service/target/scala-2.10/scoverage-data/scoverage.coverage.xml

And I put it correctly in the project configuration: target/scala-2.10/scoverage-data and scoverage.coverage.xml

If any of these configuration is not correct, I'll get IOException saying directory/file not exist, but not NoSuchElementException. Does it mean that the xml file format is not that correct? Thanks,

LikeBareFoot commented 7 years ago

Thanks El for the help. The fix was to split clean coverage test into several stages: clean compile test coverage test coverageReport assembly

And the path and file to publish should be: target/scala-2.10/scoverage-report index.html