I’m having an odd problem with not being able to g...
# general
r
I’m having an odd problem with not being able to get coverage info out when I use
pants test ::
Config:
Copy code
# pants.ci.toml
[test]
use_coverage = true
report = true

[coverage-py]
report = ["lcov", "xml"]
global_report = true
And the log for the ci job show:
Wrote xml coverage report to dist/coverage/python
But there’s no xml file in that directory when I run
ls -lR dist
immediately after it in the ci job. No error, just no xml. I’m able to get json or lcov files, but not xml. I have no .coverage or anything, just the settings in pants.toml Any suggestions where to look or how to debug?
l
drats, that is odd. when I add the same lines to the example-python repo it dutifully writes out xml to
dist/coverage/python/coverage.xml
h
Are you sure pants.ci.toml is being used?
r
Yup, I’m using Coverals as my coverage tool, and I was able to work around the issue by adding the ‘lcov’ export to the list, and it started generating the proper coverage file in lcov. (Which luckily is another format Coverals can read.)
I suspect the issue is somehow to do with how I’m selecting the targets to test. When I was first running tests, I had a workflow file (Github) that was running
pants test ::
, but now I’m trying to take advantage of the GIT-awareness, and the test script calls
pants --changed-since=origin/main --changed-dependents=transitive check test
It seems like this may be triggering whatever bug I’m hitting.
The PR involved changed only one of the test targets, and did run the one set of tests, and generated a lcov, bot not xml, coverage.