-
New Feature
-
Resolution: Fixed
-
Major
-
Powered by SuggestiMate
Hi,
I am using the Cobertura plugin in my project for several jobs and now want to specify my jobs as Workflow jobs to better manage my application and reduce configuration overhead.
Thanks,
Yotam
- is duplicated by
-
JENKINS-43420 How to generate cobertura coverage report using pipeline script
-
- Resolved
-
-
JENKINS-35487 Add support for Jenkins Pipeline to the cobertura-plugin
-
- Closed
-
- is related to
-
JENKINS-35487 Add support for Jenkins Pipeline to the cobertura-plugin
-
- Closed
-
- links to
[JENKINS-30700] Make Cobertura plug-in support the workflow plugin
I'm working a changeset for this, but I could do with some advice from someone more familiar with how Jenkins plugins work, as I'm mostly guessing and copying from the junit and xunit plugins.
This commit highlights the areas I need some advice on: https://github.com/leth/cobertura-plugin/commit/52a2ce9b2ec9dde01ff9054e1184c2e833e00a60
I've been waiting for this support for a while now, unfortunately I do not know enough Java to do it myself or I would.
Are there any plans to implement this? Besides eventually of course.
Support for this plugin in pipeline would be wonderful. I have a large number of Jenkins Enterprise jobs that I'd like to port over to Pipeline, but it's a hard sell to developers and managers who enjoy having the nice test coverage graphs. Any updates?
Old issue. Hope to see a fix soon. Now with Jenkins 2.0, pipelines will become more prevalent.
There is a week old pull request that needs feedback that implements this at https://github.com/jenkinsci/cobertura-plugin/pull/55
The GitHub Cobertura issues#50 at https://github.com/jenkinsci/cobertura-plugin/issues/50 shows an update 6 hours ago by mbarrien referencing this issue
So old issue. Is there any progress about this issue? Wish this issue will be resolved soon.
mbarrien Is there any news on progress on this - It is the only plugin that I am waiting for so that I can use Multibranch Pipeline job that will replace my freestyle job?
If not does anyone else know how to update - I have had a look but having never touched the internals of a jenkins plugin my head is now hurting
I am also interested in the status of this plugin becoming Pipeline ready!
I use HTML Publisher to publish coverage report now, but it is far from satisfactory.
I'm also waiting for Pipeline support, all my Jenkins jobs are pipelines.
PR-55 looks promising, hope it will be released soon!
We are also waiting for this, and currently this is the only blocker for us to move to Pipeline based jobs.
syb3181 how do you use HTML publisher to publish cobertura reports (when there are multiple), do you have any example?
this is how I use the html publisher in jenkinsfile
publishHTML(target: [ reportName : 'Coverage Report 1', reportDir : 'foldername/target/coverage-reports/', reportFiles : 'index.html', keepAll : true, alwaysLinkToLastBuild: true, allowMissing : false ])
jenkinator just as kampak1111 posted. BTW, you may use the jenkins groovy syntax box to generate the DSL. To report multiple files in different module in one site, you may put the report dir empty and the reported files pointing to its file path. That's all I know about the plugin.
Thanks syb3181 and kampak1111. I was able to publish the coverage reports.
How do you generate the trend report of the coverage info?
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: '',
reportFiles:
'''common/target/site/cobertura/frame-summary.html,
config-pusher/target/site/cobertura/frame-summary.html,
experimental/target/site/cobertura/frame-summary.html,
joiner/target/site/cobertura/frame-summary.html,
lookup-service/target/site/cobertura/frame-summary.html,
stream-reader/target/site/cobertura/frame-summary.html''',
reportName: 'Coverage Report'
])
jenkinator I wonder if the "keepAll" option meets your need.
syb3181 Thanks. However, "keepAll" just archives the reports of all previous builds, but doesn't help plot the trend report. I am wondering if there is any way to specify HTML report to plot the trend for a custom field (example: line coverage), basically what the Cobertura report publishing does.
Is there any update? It will be really useful to have this feature working.
I agree this would be useful. We recently moved to pipelines and this is 1 thing we are missing.
Code changed in jenkins
User: Michael Barrientos
Path:
pom.xml
src/main/java/hudson/plugins/cobertura/BuildUtils.java
src/main/java/hudson/plugins/cobertura/Chartable.java
src/main/java/hudson/plugins/cobertura/CoberturaBuildAction.java
src/main/java/hudson/plugins/cobertura/CoberturaProjectAction.java
src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java
src/main/java/hudson/plugins/cobertura/CoverageChart.java
src/main/java/hudson/plugins/cobertura/MavenCoberturaBuildAction.java
src/main/java/hudson/plugins/cobertura/MavenCoberturaPublisher.java
src/main/java/hudson/plugins/cobertura/renderers/SourceCodePainter.java
src/main/java/hudson/plugins/cobertura/targets/CoverageResult.java
src/test/java/CoverageTablePortlet/CoverageTablePortletTest.java
src/test/java/hudson/plugins/cobertura/CoberturaFunctionalTest.java
src/test/java/hudson/plugins/cobertura/CoverageResultBuilder.java
src/test/java/hudson/plugins/cobertura/CoverageResultTest.java
http://jenkins-ci.org/commit/cobertura-plugin/85fd6380809a45dff5319d8eb385920d2163fe10
Log:
JENKINS-30700 / #50 Jenkins pipeline support
Code changed in jenkins
User: Michael Barrientos
Path:
src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java
src/main/java/hudson/plugins/cobertura/targets/CoverageTarget.java
http://jenkins-ci.org/commit/cobertura-plugin/681d24c4def7b8b74f0186bc15f205c634524f62
Log:
Merge pull request #55 from mbarrien/pipeline
JENKINS-30700 / #50 Jenkins pipeline support
Compare: https://github.com/jenkinsci/cobertura-plugin/compare/75d7da7accfc...681d24c4def7
Code changed in jenkins
User: Jesse Glick
Path:
COMPATIBILITY.md
http://jenkins-ci.org/commit/pipeline-plugin/23d473486c8e345e8f6586d30f889c313f9f5adf
Log:
Merge pull request #438 from jenkinsci/recampbell-patch-1
JENKINS-30700 Noting cobertura fix
Compare: https://github.com/jenkinsci/pipeline-plugin/compare/d537ba19e3cf...23d473486c8e
Is there any kind of documentation available for the pipeline syntax? I couldn't find any, neither on the wiki nor on github
It would probably be good to have something on the wiki, but you can use the snippet generator to see the syntax. It's under Step: General Build Step. The only caveat is that it doesn't currently generate the code for coverage targets. The next release will generate coverage targets correctly, and it will show as a separate step in the snippet generator instead of under General Build Step
Generates something like this:
step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'fdsfsdfds', failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
would be nice if we could just do like the junit reports
post {
always {
junit '*/target/test-reports/.xml'
}
}
Maybe I'm misunderstanding something, but with recent versions of the plugin, you can do this in your Jenkinsfile:
post {
always {
cobertura coberturaReportFile: '*/.xml'
}
}
Does that meet your needs?
+100 on this, we just switched to jenkins pipeline (formerly workflow) and this plugin is not supported. I would hate to have to roll my own solution just to get my coverage reports publisher need back.