Please cover reporting incomplete information (from istanbul report)
I found two issues trying to use please cover on a big internal project. I have set up a minimal reproduction repo here: https://github.com/fvanderveen/please-cover-repro
For some background; our main please build step (installing npm dependencies and building our sources) requires many files, more than the (standard) linux command line allows in one command (i.e. using a glob to include all .ts files will fail please). As such, we have a filegroup containing multiple source folders (similar to the single srcs = ["src"] in the repo above).
When running please cover on our tests, we do not get any coverage data, no matter how we format the istanbul report. Diving a bit into the please sources, I found that please attempts to filter the coverage report based on files deduced by non-test dependencies.
This happens in coverage.go using collectCoverageFiles and collectAllFiles. The latter will, however, in our case get a list of folders; which (obviously) does not match the hasCoverageExtension, resulting in a list of coverage files that only includes some of the global setup files but none of the actually covered files. This results in all our actual coverage data being filtered out, and nothing reported.
Using the repo above, trying to display it actually works when using a glob, I found there is actually a second issue in istanbul_coverage.go where sanitiseFileName actually matches the paths against target.TmpDir() successfully first (resulting in the report containing run_1/src/utils.ts and still not matching the collected coverage files). If I move the target.TestDir(run) match above the tmp dir one, it does work as expected.
In our case, it would be preferable if a setup like srcs = ["src"] actually would match and include coverage for anything under the src directory.
This issue has been automatically marked as stale because it has not had any recent activity in the past 90 days. It will be closed if no further activity occurs. If you require additional support, please reply to this message. Thank you for your contributions.