Is there a way to check if all of my tests can be ...
# general
e
Is there a way to check if all of my tests can be resolved from cache without attempting to run them? details in 🧵
I have a number of integration tests that can only run if I bring up external systems and a database and kafka and stuff (I'd love to break this down into smaller dependency sets, but that's a long way off). For right now, I have to bring up a docker compose stack (which takes about 15 minutes) before I can run the tests. I'd like to be able to check if it is actually necessary to bring up the stack before bothering to do that work, only to see that my tests all pulled from cache anyways.
A midway solution is to use
pants list --changed-since=origin/main --changed-dependents=transitive
and inspect the output for any files in the integration test directory, which will cover many cases (eg. that don't trigger this set of integration tests). This does miss a big use case though, which is the use of
merge_group
in github actions (or
merge_train
in gitlab CI). These features require your PR to pass CI as is, and then to also pass CI again in its merged state, before confirming/completing the merge. These are good, because they catch if anything has been merged to main in between your CI run and the time you actually click the "Merge" button. However, it is not uncommon for there to be no other changes merged, meaning you're just forced to run through the exact same CI twice. This kind of second run would not be caught by using
--changed-since
, even though the needed results are already in the cache.