I have a python project that houses four subprojects that kind of go together but are kept in the same github repository as they are logically separate. So my project directory structure is like below.
.
├── project1
├── project2
├── project3
├── project4
├── Jenkinsfile
├── README.md
├── requirements.txt
I have a jenkins build which builds all the projects. It launches pytest to run all the test. I can see that its running all the test and coverage.xml is created for all the projects.
I want to create cobertura to check the coverage reports. In my jenkins build script I first run the pytest command and then rename the coverage.xml to project specific like project1_coverage.xml
At the end I have the following steps in my jenkins file.
// Cobertura test coverage
step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'proj1_coverage.xml', failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'proj2_coverage.xml', failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'proj3_coverage.xml', failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'proj4_coverage.xml', failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
```
Its creating 4 reports but its only reporting report for one of the files or the first file. How can I make cobertura report the data in all the coverage.xml files.
Thanks a lot.