I have a number of "integration tests" where I hav...
# general
e
I have a number of "integration tests" where I have to bring up a docker stack outside of pants, before running
pants test
. Since the stack can be slow to set up, I want to add a step in my CI where I use
pants --changed-since=origin/main --changed-dependents=transitive list
to check if there even are any tests to run. If not, I can skip even bothering to bring up the stack. The only problem: I would still like to have my coverage report (there's a CI step where it writes it out to the PR), just to help all the devs keep track of it, even if there wouldn't have been any changes. I suppose one option would be to just run
pants test src/integration/::
and assume the tests will all "pass" due to caching, and then I'll have my coverage report. But I wanted to ask: is there some more straightforward way to get the coverage report
w
You could probably look through the pants test code to see if there is some way to hijack this - but as far as I know, the coverage report comes out of pytest, so getting a coverage report without running pytest seems..... weird
e
Hopefully there might have been some way of pulling the cached coverage report or something
w
In your CI, I'd assume you could - as in, reach into a previous artifact and copy forward the coverage report. Or export it as an artifact, and do that. For it to be cached in that way, I think the daemon might need to be running, which is not always the case between CI runs
I think pants uses coveragepy - so maybe if that has some mechanism to do this?
Orrr, maybe it's also persisted somewhere in the pants cache, and you could copy it out of there - but yeah, feels like hacks all around - not sure if there is a nice way to do this
e
Thanks for the advice! I'll see if I can get something figured out
w
👍