Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use cobertura with parallel build ? #92

Open
ikus060 opened this issue Feb 17, 2018 · 3 comments
Open

How to use cobertura with parallel build ? #92

ikus060 opened this issue Feb 17, 2018 · 3 comments

Comments

@ikus060
Copy link

ikus060 commented Feb 17, 2018

I'm trying to understand how to use cobertura when we are compiling and testing on multiple configuration. We have create a build to run on multiple axis (debian version, python version, cherrypy version, etc.) Each of them are running tests and generating a coverage.xml report.

How should I use cobertura in this situation ?

Here the Jenkins file: https://github.com/ikus060/rdiffweb/blob/develop/Jenkinsfile

Right now, I've try to publish the coverage report for each build. But it adds an entry on the Job. Like this
image

@jeffpearce
Copy link
Contributor

One thing I've done to combine them is to stash each report, using a unique name for each, then at the end of the job unstash them all into a folder and publish from there - the cobertura plugin will combine them into one report

@jeffpearce
Copy link
Contributor

jeffpearce commented Feb 22, 2018

e.g.
First report:

dir('path-to-coverage) {
    stash name: "coverage-1", includes: "*.xml"
}

Second report:

dir('path-to-coverage') {
    stash name: "coverage-2", includes: "*.xml"
}

At the end of your job:

stage('publish code coverage') {
    // Publish combined code coverage results 
    unstash 'coverage-1';
    unstash 'coverage-2';

    step([$class: 'CoberturaPublisher', \
      coberturaReportFile: "*.xml"])
}

@damonZDM
Copy link

例如 第一份报告:

dir('path-to-coverage) {
    stash name: "coverage-1", includes: "*.xml"
}

第二份报告:

dir('path-to-coverage') {
    stash name: "coverage-2", includes: "*.xml"
}

在你的工作结束时:

stage('publish code coverage') {
    // Publish combined code coverage results 
    unstash 'coverage-1';
    unstash 'coverage-2';

    step([$class: 'CoberturaPublisher', \
      coberturaReportFile: "*.xml"])
}

Nice answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants