hallowed-student-25079
11/02/2021, 8:08 AM./pants test ::
only reruns tests needed if I change e.g. a single file. This would then also be true on CI with a cache enabled right? So if I want up to date coverage on the main branch, I would need to remove the test result cache ($HOME/.cache/pants/lmdb_store
) on the main branch so that all tests run? Right now we have some grouping of modules into clearly seperated dependency groups and to save time on the main branch we only run the tests for groups that are changed and then combine coverage to save a bit of execution time on the main branch), would this also be possible with pants?curved-television-6568
11/02/2021, 8:25 AMhallowed-student-25079
11/02/2021, 8:35 AMX/...
never depends on targets in Y/...
or Z/...
but only on targets in X
or in C
. What we currently do, on our main branch to save CI time is that we look if there was a change only in X,Y or Z
we run only the tests for X
and merge coverage with the coverage of the last runs for Y,Z and C
. This can miss coverage in C
only coming from X
- but that is something we would not want to have anyway. So my question was how to do this with pants, and I think the answer would also be using the force flag on the main branch and use change detection to limit to certain targets (e.g X/**
) and keep our current coverage merging logic as pants does not keep or merge coverage in any way, right?curved-television-6568
11/02/2021, 8:40 AM./pants --changed-since=<some tag/sha/branch…> test
and then (hopefully) merge the coverage data from that as you do now..hallowed-student-25079
11/02/2021, 8:44 AMclean-city-64472
11/02/2021, 2:14 PM./pants test ::
would run all tests in the app. Some of those tests may have cached results and Pants will know those cached results remain valid. These tests will have been 'run' but actually just used cached results (--test-force
would override this). ./pants test --changed-since=HEAD^ --changed-dependees=transitive
will run only tests that have changed since the provided git refer (HEAD^
in this case). Any tests that do not depend indirectly on a changed file will not be run at all. It is still possible that some of these test runs will have a cache hit.hallowed-student-25079
11/02/2021, 3:05 PMhundreds-father-404
11/02/2021, 3:15 PM./pants test ::
is like you had run every single test, only some of them use the cached result. And it will only use the cache if none of the inputs for that test have changed, including every transitive dependency of it - so you can be confident the coverage data is accurate
Are you seeing differently, that coverage is not including cached results?hallowed-student-25079
11/02/2021, 3:27 PMhundreds-father-404
11/02/2021, 3:28 PMwitty-crayon-22786
11/02/2021, 4:27 PM