aconrad / pycobertura

A code coverage diff tool for Cobertura reports
MIT License
114 stars 39 forks source link

Coverage is not reported on Github PR file changes as mentioned in the documentation #189

Open mohamedrez opened 1 month ago

mohamedrez commented 1 month ago

Hello and thank you for this package.

I am currently using this to report the missing covered lines on the PR: pycobertura show --format github-annotation cov.xml

It is being reported on the Action:

Screenshot 2024-07-23 at 11 10 48 am

But not in the file changes:

image

I needed the same as mentioned on the documentation:

image
aconrad commented 1 month ago

@goatwu1993 can you help answer? I'm not familiar with GitHub annotations.

goatwu1993 commented 1 month ago

hmm. works at my repo. Just triggered another run. https://github.com/goatwu1993/pycobertura-test/pull/7

goatwu1993 commented 1 month ago

@mohamedrez It seems to be the error of the file path. your filename is under the ./rover (rover/common/xxx) while the cobertura (cov.xml) doesn't (common/xxx)

goatwu1993 commented 1 month ago

probably can leverage the source/source prefix/filesystem/real_filename but I do not know where to add.