Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-3534

Allow to import code coverage by ITs even when the jacoco engine is not configured to be the default one

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: 3.2
    • Component/s: Coverage & Tests
    • Labels:
    • Environment:
      Hudson, Ant, Java

      Description

      I'm running a Hudson build that triggers Sonar as a build step via the Sonar Hudson plugin. The project is built with Ant and it generates Jacoco coverage data to <project>/test/coverage_reports/jacoco.exec.

      If I don't change the coverage engine to Jacoco but pass the sonar.jacoco.itReportPath, I get the following log lines in Hudson.

      {{19:56:10.384 INFO p.PhasesTimeProfiler - Sensor JaCoCoItSensor...
      19:56:10.386 INFO o.s.p.j.JaCoCoPlugin - Analysing /<path_to_hudson_job>/workspace/<project>/test/coverage_reports/jacoco.exec
      19:56:11.517 INFO p.PhasesTimeProfiler - Sensor JaCoCoItSensor done: 1133 ms}}

      In this case I don't get any coverage data. If I set the coverage engine to Jacoco in the project properties in Sonar, I get this:

      {{19:56:06.883 INFO p.PhasesTimeProfiler - Sensor JaCoCoSensor...
      19:56:06.903 INFO o.s.p.j.JaCoCoPlugin - Project coverage is set to 0% as no JaCoCo execution data has been dumped: /<path_to_hudson_job>/workspace/target/jacoco.exec
      19:56:10.384 INFO p.PhasesTimeProfiler - Sensor JaCoCoSensor done: 3501 ms
      19:56:10.384 INFO p.PhasesTimeProfiler - Sensor JaCoCoItSensor...
      19:56:10.386 INFO o.s.p.j.JaCoCoPlugin - Analysing /<path_to_hudson_job>/workspace/<project>/test/coverage_reports/jacoco.exec
      19:56:11.517 INFO p.PhasesTimeProfiler - Sensor JaCoCoItSensor done: 1133 ms}}

      So I'm forced to put Jacoco coverage data to /<path_to_hudson_job>/workspace/target/jacoco.exec in order for Sonar to pick it up.

        Attachments

          Activity

            People

            Assignee:
            freddy.mallet Freddy Mallet (Inactive)
            Reporter:
            ripla Risto Yrjänä
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: