shanbin / scoverage-plugin Goto Github PK
View Code? Open in Web Editor NEWJenkins scoverage plugin for Scala code coverage
Home Page: https://wiki.jenkins-ci.org/display/JENKINS/Scoverage+Plugin
License: MIT License
Jenkins scoverage plugin for Scala code coverage
Home Page: https://wiki.jenkins-ci.org/display/JENKINS/Scoverage+Plugin
License: MIT License
We just updated to Jenkins 2.150.1 and the scoverage plugin stopped working for the build-specific reports.
For instance, for the run number 71, jetty returns a
HTTP ERROR 404
Problem accessing /<orgName>/job/<projectName>/71/scoverage-report. Reason:
Not Found
When viewing the report for the project, instead, that is correctly reachable at /<orgName>/job/<projectName>/scoverage/
I double checked the directories created on the master instance, and files are correctly stored, e.g. for build 71 in <jenkinsHome>/jobs/<projectName>/builds/71/scoverage-report
...
Has anyone seen this and found a workaround? It looks like an update to jenkins (possibly the stapler dependency) broke this...
Hi,
I don't seem to be able to find Jenkins Pipeline support for publishing scoverage reports.
Am I missing something?
Thanks,
Gio
Plugin generates graphs, but they always show 0%. Html-report shows correct numbers.
My report directory is "target/scala-2.10/scoverage-report/"
and report file "scoverage.xml".
Scoverage version is 0.98.2.
My build and tests are successful . maven-scoverage
plugin also generate reports but 'scoverage-jenkins' fails to publish it
Publishing Scoverage XML and HTML report ...
ERROR: Build step failed with exception
java.util.NoSuchElementException
at java.util.LinkedList$ListItr.next(LinkedList.java:888)
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$FileCallableWrapper.call(FilePath.java:2691)
at hudson.remoting.UserRequest.perform(UserRequest.java:121)
at hudson.remoting.UserRequest.perform(UserRequest.java:49)
at hudson.remoting.Request$2.run(Request.java:325)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
at ......remote call to hydra01(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1361)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
at hudson.remoting.Channel.call(Channel.java:753)
at hudson.FilePath.act(FilePath.java:980)
at hudson.FilePath.act(FilePath.java:969)
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:75)
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:726)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1053)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1769)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:537)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
Build step 'Publish Scoverage Report' marked build as failure
When the index.html file is missing but the directory exists, an exception is thrown due to a missing check on the list:
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$FileCallableWrapper.call(FilePath.java:2750)
at hudson.remoting.UserRequest.perform(UserRequest.java:121)
This has been reported already and the workaround (run coverageReport) is explainted, but took me also some digging to get to the root cause. It should return also null so that the proper error message is shown from "Unable to find HTML reports under".
It's very handy to see coverage right from the views. So it would be great to have something like
https://wiki.jenkins-ci.org/display/JENKINS/JaCoCo+Plugin#JaCoCoPlugin-Coveragecolumn
When ScoveragePublisher.java scans a scoverage results file i side a folder that starts with M (e.g.
scoverage-report\com\nephila\attribution\common**mail\test.xml)
It gives this error,
Publishing Scoverage XML and HTML report ...
ERROR: Build step failed with exception
java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence near index 56
href=".*scoverage-report\com\nephila\attribution\common\mail/
^
at java.util.regex.Pattern.error(Unknown Source)
at java.util.regex.Pattern.escape(Unknown Source)
at java.util.regex.Pattern.atom(Unknown Source)
at java.util.regex.Pattern.sequence(Unknown Source)
at java.util.regex.Pattern.expr(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.util.regex.Pattern.(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.lang.String.replaceAll(Unknown Source)
at org.jenkinsci.plugins.scoverage.ScoveragePublisher.processReport(ScoveragePublisher.java:128)
at org.jenkinsci.plugins.scoverage.ScoveragePublisher.perform(ScoveragePublisher.java:67)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:76)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Hi,
Could it be possible to have a new official version with fix about html path handling for windows?
The fix seems to be necessary to use this great tool and it would be more convenient than recompiling code on our own side.
Thanks
I specify servision/target/scoverage-report
as the scoverage report directory and scoverage.xml
as the scoverage report file.
In this directory, I can see an index.html
that is viewable with a browser.
But the link the plugin creates in the Jenkins project page,shows empty content.
I think this is a bug.
Using latest version: 1.3.0 and Jenkins 1.651
My maven project is using scoverage plugin 1.1.0.
Produces following in target:
Jenkins config as follows:
Jenkins shows the accurate chart from scoverage however, Clicking the html report leads to 404 similar to #4
On the Jenkins job summary page, I'm seeing the graph of coverage results over time, but if I click on the graph I'm reaching an error page:
HTTP ERROR 404
Problem accessing /job/(job name)/scoverage/. Reason:
Not Found
Jenkins ver. 1.575
Scoverage plugin v 1.1.0
My use-case is:
I run my unit tests, generate a coverage, rename the xml.
I run my integration tests, generate the coverage, rename the xml.
I run my unit+integration tests after each other, generate the coverage.
I want to see the unit, the integration, and the overall coverage at 3(x2) graph, and I want 3 link at the project page to the 3 generated html reports (maybe I can move the html reports dir too if needed).
I never wrote jenkins plugins but I think this is not so much modification, maybe I will try to do this myself (at the weekend), but if sb more experienced could do this, that would be better :)
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
I have a multi module gradle project and i am using the gradle scoverage plugin. It generates a scoverage directory under every module and there is an xml file with coverage results.
Currently , on jenkins scoverage plugin there doesn't seem to be a way to specify something like "find scoverage directory under sub modules" or "take a regex file path glob pattern" for directory and file names.
Thanks for the great work!
I've got one issue with the configuration:
Currently I'm using this step to publish the scoverage results:
step([$class: 'ScoveragePublisher', reportDir: 'target/scala-2.12/scoverage-report', reportFile: 'scoverage.xml'])
What I really would want to configure is the following:
reportDir: 'target/scala-*/scoverage-report'
or
reportDir: 'target/**/scoverage-report'
so that I don't need to update all my configurations when I upgrade the Scala version.
When I try this I get errors that the report cannot be found. Looks like this line right here:
Or did I miss something?
Log warning:
WARNING org.kohsuke.stapler.RequestImpl$TypePair convertJSON 'stapler-class' is deprecated: org.jenkinsci.plugins.scoverage.ScoveragePublisher
scoverage 1.1.1
jenkins 1.601
If you store coverage number for previous builds and fail build if the number of lower. This will ensure that every commit does not lower the coverage and is easy to hold a specific developer responsible for lowering the coverage so that test cases could be added.
What you think.
I know that merged reports are not yet supported but I just want to display one.
In the console, i see :
08:55:26 [info] [scoverage] Generating XML report [/scratch/jenkins/workspace/[myproject] - coverage/[mymodule]/target/scala-2.10/scoverage-report/scoverage.xml]
So scoverage config seems ok.
I tried to configure Scoverage Report Directory with the following values
Any idea ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.