Closed ChrisHines closed 6 months ago
Hi Chris, test files are filtered out during the Determine changed files
step here:
I did this to provide a clean table of coverage changes per file (i.e. the "Coverage by file" table in the coverage comment which shows number of covered statements per changed file etc). However, I didn't think about coverage changes that only result from changes to the unit tests.
As a fix, I will remove the **_test.go
from the ignored files. I'm not certain though, what I want to do with the "Coverage by file" table. Mixing unit tests and other Go files in the same table seems a bit confusing to me so maybe two separate tables would be best? The table for unit tests wouldn't really contain more information than the name of the changed file though :thinking: Any thoughts on this?
This is how such a table would currently look like in the case of only a single unit test file being changed:
Changed File | Coverage Δ | Total | Covered | Missed | :robot: |
---|---|---|---|---|---|
github.com/fgrosse/prioqueue/min_heap_test.go | 0.00% (ø) | 0 | 0 | 0 |
I decided to go ahead with this format: https://github.com/fgrosse/go-coverage-report/pull/20#issuecomment-2079113007 which simply displays test files as a separate list below the existing table.
The issue is fixed via v1.0.1 :tada:
Thanks for the quick fix! 🥇
I agree with splitting the test files into a separate section. My team was a little confused why they were included in the Coverage by file section since test files don't get test coverage themselves.
We're using this action on several private repositories and it is working great so far. Thanks.
However, I made a PR today that only changed a single
_test.go
file and no coverage report was added to the PR. The changed test file was noticed by the first steps of the action but seems to get filtered away sometime later. Here are the logs (somewhat redacted).