How to change name of Cobertura report

38 Views Asked by At

I am using Cobertura plugin for code coverage in Jenkins to test multiple python versions in two different docker containers, rockylinux-8 and rockylinux-9. What I am getting after process is finished are two file reports with the same name: Cobertura Coverage Report. I would like to be able to change names of these reports to something like Rocky-8 Coverage Report and Rocky-9 Coverage Report.

I have checked this question but I couldn't find anything newer that works.

Does anybody have any idea how to change names?

enter image description here

this is part of jenkins pipeline:

stages {
        stage ('Execute tests for RockyLinux'){
            parallel {
                stage ('Test Rocky 8') {
                    agent {
                        docker {
                            image 'localhost:5000/rocky-8:latest'
                            args '-u jenkins:jenkins'
                        }
                    }
                    steps {
                        echo 'Building Rpm...'
                        sh '''
                            pyenv local 3.7.15 3.8.15 3.9.15 3.10.13 3.11.6
                            tox
                            coverage xml --omit=*usr* --omit=*.tox*
                        '''
                        cobertura coberturaReportFile: '**/coverage.xml'
                    }
                }
                stage ('Test Rocky 9') {
                    agent {
                        docker {
                            image 'localhost:5000/rocky-9:latest'
                            args '-u jenkins:jenkins'
                        }
                    }
                    steps {
                        echo 'Building Rpm...'
                        sh '''
                            pyenv local 3.7.15 3.8.15 3.9.15 3.10.13 3.11.6
                            for version in 37 38 39 310 311; do tox -e py${version}-requests0; done
                            coverage xml --omit=*usr* --omit=*.tox*
                        '''
                        cobertura coberturaReportFile: '**/coverage.xml'
                    }
                }
            }
        }
0

There are 0 best solutions below