You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
usingcollectCoverageFiles
andcollectAllFiles
. The latter will, however, in our case get a list of folders; which (obviously) does not match thehasCoverageExtension
, 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
wheresanitiseFileName
actually matches the paths againsttarget.TmpDir()
successfully first (resulting in the report containingrun_1/src/utils.ts
and still not matching the collected coverage files). If I move thetarget.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 thesrc
directory.The text was updated successfully, but these errors were encountered: