Improving testmon cache #3870
ver217
started this conversation in
Development | Developer Experience
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
CI uses single shared testmon cache now, and it stores testmon cache when unit tests finish, so PRs will affect each other.
E.g. PR 1 changes
src/a.py
and it's testmon cache is stored. PR 2 is created before PR 1 is merged, and it changessrc/b.py
. PR 2 will restore the latest testmon cache, which cachessrc/a.py
changed in PR 1, thus PR 2 will run tests related tosrc/a.py
andsrc/b.py
. In fact, PR 2 does not need to run tests related tosrc/a.py
. This is how PRs affect each other.Possible solution
We can manage cache for every branch and every PR.
cache/main/.testmondata*
tocache/<branch>/
.cache/<base_ref>/.testmondata*
tocache/_pull/<pr_number>/
.cache/_pull/<pr_number>/
.cache/_pull/<pr_number>/.testmondata*
tocache/<base_ref>/
. Otherwise, we just removecache/_pull/<pr_number>
.cache/<ref>
.In this way, unmerged PRs won't affect each other anymore. And to avoid store outdated testmon cache, we force each branch is up-to-date before merging.
Beta Was this translation helpful? Give feedback.
All reactions