clearlyip / code-coverage-report-action

Provides Code Coverage reports in Github Actions
MIT License
7 stars 5 forks source link

Support cobertura class level coverage #52

Closed kuhnroyal closed 5 months ago

kuhnroyal commented 6 months ago

Currently only package coverages are printed. Some languages don't have a package concept so it would make sense to output class level coverage below the package. This could be configurable.

kuhnroyal commented 6 months ago

Looks like the clover parser already does this, so maybe it can just be the default behavior?

tm1000 commented 6 months ago

Not really sure what you mean by this? Can you show me the reference points in the clover parser that should be in the cobertura parser?

kuhnroyal commented 6 months ago

Sure, the clover parser parses files inside packages here: https://github.com/clearlyip/code-coverage-report-action/blob/main/src/reports/clover/parser/index.ts#L18

But the cobertura parser only parses the top level package elements here: https://github.com/clearlyip/code-coverage-report-action/blob/main/src/reports/cobertura/parser/index.ts#L21 - not the nested classes.

See https://github.com/cobertura/cobertura/blob/master/cobertura/src/site/htdocs/xml/coverage-04.dtd#L30

kuhnroyal commented 5 months ago

Do you think this is doable?

tm1000 commented 5 months ago

@kuhnroyal #53 should be the fix for this. Sorry for taking so long

hsingh-texada commented 5 months ago

@tm1000 Thanks for opening the PR and working on the request. I added a small comment which could be really beneficial for projects that have lots of classes. The request is to add a flag to NOT list classes whose coverage remain unchanged.

Reference comment: https://github.com/clearlyip/code-coverage-report-action/pull/53#issuecomment-2114075053

tm1000 commented 5 months ago

https://github.com/clearlyip/code-coverage-report-action/releases/tag/v5.0