codeclimate / test-reporter

Code Climate Test Reporter
MIT License
156 stars 76 forks source link

Jacoco Formatter Bug #433

Open akroon3r opened 4 years ago

akroon3r commented 4 years ago

The team that I work with is using cc-test-reporter on a Java Sprint Boot project. We currently have an Interface (https://github.com/SierraSystems/ntt-data-notification-service/blob/master/src/main/java/com/nttdata/nttdatanotificationservice/service/WebHookService.java)

It generates the following code in a Jacoco XML report:

<class name="com/nttdata/nttdatanotificationservice/service/WebHookService"
  sourcefilename="WebHookService.java"/>

We noticed that the example XML file included in the jacoco formatter doesn't include a test case like this. Jacoco formatter reports the following for a case like this when converting XML to JSON when using ./cc-test-reporter format-coverage:

"coverage": "[]",
      "covered_percent": 0,
      "covered_strength": 0,
      "line_counts": {
        "missed": 0,
        "covered": 0,
        "total": 0
      },

Which then is interpretted on Code Climate frontend as a file with zero coverage, when it possibly should be ignored. When coverage is run locally, Jacoco ignores this file when calculating the overall coverage report (not included).

Any additional insight to this problem would be great.