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

Coverage forced to zero even if file excluded using sonar.coverage.exclusions (at module level)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.4
    • Fix Version/s: 6.6-M1, 6.6
    • Component/s: Scanner
    • Labels:
      None

      Description

      Excluding a (Java) file from coverage using sonar.coverage.exclusions should make the file completely excluded from coverage measures. But since 6.4, and when exclusion is applied at module level, the file will have a coverage counted as zero.

      We changed ZeroCoverageSensor to a global Sensor. The problem is that it relies on CoverageExclusions component, that read settings of the current module (so only root module = project here).
      I think we should change CoverageExclusions to collect exclusions for every modules, so that at the end we get the complete list of excluded files.

      Original thread: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/sonarlint/bVgbRf2vFCc/_Y01Eje2BAAJ

      Workaround: coverage exclusions declared at project level (either in UI or on scanner side) are correctly taken into account.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              julien.henry Julien Henry
              Reporter:
              julien.henry Julien Henry
              Votes:
              6 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: