codacy / codacy-coverage-reporter

Multi-language coverage reporter for Codacy
https://www.codacy.com
Other
135 stars 94 forks source link

Search for Cobertura files named coverage.xml #201

Closed LourensVeen closed 4 years ago

LourensVeen commented 4 years ago

(This is a feature request, so I'm skipping the software versions.)

Coverage.py generates Cobertura-format output in a file named coverage.xml by default. codacy-coverage-reporter by default only looks for cobertura.xml. As a result, these tools don't work together out-of-the box.

Coverage.py can be configured to write a file named cobertura.xml, and c-c-r can be configured to read a file named coverage.xml, but it would be nice if these tools would work together by default, rather than requiring user intervention.

Expected Behavior

When c-c-r is run without arguments, it automatically picks up coverage.xml as generated by default by coverage.py.

Actual Behavior

c-c-r gives an error message, com.codacy: Can't guess any report due to no matching!

Reproducible Test Case

See https://github.com/codacy/codacy-coverage-reporter-action/issues/8.

I don't speak a word of Scala and haven't gone into the code much, but it seems that simply extending the regex on line 180 of https://github.com/codacy/codacy-coverage-reporter/blob/master/src/main/scala/com/codacy/rules/ReportRules.scala might do the trick?

franciscodua commented 4 years ago

Hi @LourensVeen

Although you make a good point about the integration with Coverage.py, coverage.xml is a very generic name. So, we are concerned with the potential to have false positives when looking for possible reports, and how this is a breaking change. Also, right now users have easy alternatives to bypass this. Either by specifying the reports they want to upload (now available everywhere, be it GitHub action, CircleCi orb or running the script directly) or by generating different reports names.

Because we're not moving on with this approach, I'll close this issue. Thanks for the feedback, keep it coming