Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-30700

Make Cobertura plug-in support the workflow plugin

    XMLWordPrintable

Details

    Description

      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

      Attachments

        Issue Links

          Activity

            rocktavious kyle rockman added a comment -

            +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.

            rocktavious kyle rockman added a comment - +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.
            mcobden Marcus Cobden added a comment -

            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.

            mcobden Marcus Cobden added a comment - 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.
            mcobden Marcus Cobden added a comment - 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.

            s0undt3ch Pedro Algarvio added a comment - 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?

            bhipple Benjamin Hipple added a comment - 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?
            djviking Sverre Moe added a comment - - edited

            Old issue. Hope to see a fix soon. Now with Jenkins 2.0, pipelines will become more prevalent.

            djviking Sverre Moe added a comment - - edited 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

            mbarrien Michael Barrientos added a comment - There is a week old pull request that needs feedback that implements this at https://github.com/jenkinsci/cobertura-plugin/pull/55
            djviking Sverre Moe added a comment - - edited

            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

            djviking Sverre Moe added a comment - - edited 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
            abcfy2 feng yu added a comment -

            So old issue. Is there any progress about this issue? Wish this issue will be resolved soon.

            abcfy2 feng yu added a comment - So old issue. Is there any progress about this issue? Wish this issue will be resolved soon.
            clausfod clausfod added a comment -

            What is the status for making the Cobertura plugin Pipeline ready ?

            clausfod clausfod added a comment - What is the status for making the Cobertura plugin Pipeline ready ?
            codersparks coder sparks added a comment -

            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

            codersparks coder sparks added a comment - 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!

            consolati1 John Consolati added a comment - I am also interested in the status of this plugin becoming Pipeline ready!
            syb3181 Yibin Sheng added a comment - - edited

            I use HTML Publisher to publish coverage report now, but it is far from satisfactory.

            syb3181 Yibin Sheng added a comment - - edited I use HTML Publisher to publish coverage report now, but it is far from satisfactory.
            orenchapo Oren Chapo added a comment -

            I'm also waiting for Pipeline support, all my Jenkins jobs are pipelines.
            PR-55 looks promising, hope it will be released soon!

            orenchapo Oren Chapo added a comment - I'm also waiting for Pipeline support, all my Jenkins jobs are pipelines. PR-55 looks promising, hope it will be released soon!
            kampak1111 Kamil P added a comment -

            Hi, Just to say it would be useful for me too.

            kampak1111 Kamil P added a comment - Hi, Just to say it would be useful for me too.


            We are also waiting for this, and currently this is the only blocker for us to move to Pipeline based jobs.

            jenkinator Aravind Krishna added a comment - 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?

            jenkinator Aravind Krishna added a comment - syb3181 how do you use HTML publisher to publish cobertura reports (when there are multiple), do you have any example?
            kampak1111 Kamil P added a comment -

            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
                    ])
            
            kampak1111 Kamil P added a comment - 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 ])
            syb3181 Yibin Sheng added a comment -

            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.

            syb3181 Yibin Sheng added a comment - 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.
            jenkinator Aravind Krishna added a comment - - edited

            Thanks syb3181 and kampak1111. I was able to publish the coverage reports.

            How do you generate the trend report of the coverage info?

            jenkinator Aravind Krishna added a comment - - edited Thanks syb3181 and kampak1111 . I was able to publish the coverage reports. How do you generate the trend report of the coverage info?
            syb3181 Yibin Sheng added a comment -

            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 Yibin Sheng added a comment - 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.

            jenkinator Aravind Krishna added a comment - 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.

            pedrofurlanetto Pedro Furlanetto added a comment - 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.

            ryang Ryan Garchinsky added a comment - 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

            scm_issue_link SCM/JIRA link daemon added a comment - 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

            scm_issue_link SCM/JIRA link daemon added a comment - 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

            scm_issue_link SCM/JIRA link daemon added a comment - 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
            jeffpearce Jeff Pearce added a comment -

            This was fixed in release 1.10

            jeffpearce Jeff Pearce added a comment - This was fixed in release 1.10
            nitek Claus Näveke added a comment -

            Is there any kind of documentation available for the pipeline syntax? I couldn't find any, neither on the wiki nor on github

            nitek Claus Näveke added a comment - Is there any kind of documentation available for the pipeline syntax? I couldn't find any, neither on the wiki nor on github
            jeffpearce Jeff Pearce added a comment - - edited

            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

            jeffpearce Jeff Pearce added a comment - - edited 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
            francisdb francisdb added a comment - - edited

            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'
                }
            }

            francisdb francisdb added a comment - - edited 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'     } }
            jeffpearce Jeff Pearce added a comment -

            The next version will support that

            jeffpearce Jeff Pearce added a comment - The next version will support that
            chantivlad chanti vlad added a comment -

            jeffpearce: when is the next version planned for ?

            chantivlad chanti vlad added a comment - jeffpearce : when is the next version planned for ?

            Hi, any news on this?

            xirustam Rustem Zinnatullin added a comment - Hi, any news on this?
            jeffpearce Jeff Pearce added a comment - - edited

            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?

            jeffpearce Jeff Pearce added a comment - - edited 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?

            jeffpearce,
            yes, this is what I needed, thanks!

            xirustam Rustem Zinnatullin added a comment - jeffpearce , yes, this is what I needed, thanks!
            chantivlad chanti vlad added a comment -

            Works like a charm jeffpearce, thanks

            chantivlad chanti vlad added a comment - Works like a charm jeffpearce , thanks
            jeffpearce Jeff Pearce added a comment -

            Glad to hear. Thanks mbarrien - he did the work

            jeffpearce Jeff Pearce added a comment - Glad to hear. Thanks mbarrien - he did the work

            People

              mbarrien Michael Barrientos
              yotamshapira Yotam Shapira
              Votes:
              82 Vote for this issue
              Watchers:
              86 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: