-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Run only API tests affected by changes in PRs and Upgrade GHA runners #2867
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Uffizzi Ephemeral Environment Deploying☁️ https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/2867 ⚙️ Updating now by workflow run 6644560383. What is Uffizzi? Learn more! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2867 +/- ##
=======================================
Coverage 95.60% 95.60%
=======================================
Files 1009 1009
Lines 28904 28910 +6
=======================================
+ Hits 27634 27640 +6
Misses 1270 1270 ☔ View full report in Codecov by Sentry. |
b231974
to
8e8a2a4
Compare
8e8a2a4
to
269ac23
Compare
269ac23
to
134ec81
Compare
134ec81
to
e03b732
Compare
f06a0de
to
99836da
Compare
99836da
to
0c2575d
Compare
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingChanges
Use
pytest-testmon
to only execute API tests affected by changed files. Also upgrade GHA runners for this specific job.How did you test this code?
API Tests executed as expected. Also testing manually using this PR to ensure that only tests affected by changes are exectured.
Implementation notes
Notice that for retrieving the cache we use
github.event.pull_request.base.sha
as the final part of the cache key, and when we save the tesmon database file to the cache we usegithub.sha
. That is because we restore cache only on PR events while we save the cache only on the push to main event, andgithub.event.pull_request.base.sha
on the PR event context should be the same asgithub.sha
of the base branch on the push event context.Also, notice that we are using absolute paths for storing/retrieving the tesmon database file to/from the cache. We do that because if we use a relative path it will not be relative to the working directory, but to the workspace directory, which can vary depending on the context, so in this particular case I think it is better to stick to the absolute path. For more details refer to the comments below.