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

Cannot use Clover for multiple apps in project

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • clover-plugin
    • None

      We have a repo that has multiple applications in it. The apps are compiled and coverage files are generated in two different directories (different build phases).

      Our pipeline file looks like following:

      stage('Report') {
          steps {
              script {
                  def apps = ['app1', 'app2']
      
                  apps.each { appName ->
                      def reportDir = "coverage/apps/${appName}"
                      def cloverFilePath = "${reportDir}/clover.xml"
      
                      echo "[COVERAGE] Publishing Clover report for ${appName} (${cloverFilePath})"
                      clover(
                          cloverReportDir: reportDir,
                          cloverReportFileName: 'clover.xml',
                          healthyTarget: [methodCoverage: 70, conditionalCoverage: 80, statementCoverage: 80],
                          unhealthyTarget: [methodCoverage: 0, conditionalCoverage: 0, statementCoverage: 0],
                          failingTarget: [methodCoverage: 0, conditionalCoverage: 0, statementCoverage: 0]
                      )
                  }
              }
          }
      }

       
      However, when the build runs in Jenkins, the coverage reports show the same application twice (the second app):

      The links to HTML and Summary reports go to the same location.

      Please advise how using Clover multiple times in the same build can be accomplished. Thank you!

            minutehand Amritanshu
            l3ender Ross
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: