-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(ci): isolate smoke tests, introduce caching #8449
Conversation
uses: ./.github/actions/set-up-yarn-cache | ||
|
||
- name: 🐈 Yarn install | ||
run: yarn install --inline-builds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline builds will let us debug linking errors. They're not as common as they used to be, but we used to have with @vscode/ripgrep
14f73ea
to
fc76694
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of trying to add caching to the test-project
script, I pulled out the relevant steps here. This isn't ideal as we don't want things to get out of sync, but I don't want to make that script any more complicated than it already is. Plus all we ever do here in CI is copy and link the fixture
3 replays were recorded for e06a5fa. |
@jtoar re:
Is there a TTL equivalent for the cache mechanism... e.g. could we make sure we're invalidating every 12 or 24 hours? |
@thedavidprice it doesn't seem like I can make the caching for the test project even "cleaner" per PR by adding the PR's branch to the key so that it doesn't even benefit from other PRs. But we already don't include a lock file in the test project, so every PR's test project gets a completely different lock file (which is part of the reason why it takes so long to generate on Windows). But once a PR gets a test project, it seems reasonable to keep it and it's node_modules state unless you install new packages in the PR, in which case, everything is re-done. |
This is a great insight and addresses a primary concern I was thinking about (i.e. lockfile). And if a PR goes dormant for a while (even as little as a few days), it's most likely there have been changes in This reasoning is good enough for me to negate the need to add any custom time-based invalidation. Well done 🚀 |
@thedavidprice, after reviewing with @Tobbe, we made the test project cache stricter by scoping it to the PR for now. We have an idea about how to safely widen it, but till then, if any PR can rewrite the cached test project used by any other PR, there's definitely going to be some edge cases we could get into. So for now, things will be faster, but the first run will always take a while. Still better than what we had before. |
👍 |
Sometimes it feels like our CI leaves a lot to be desired, specifically the Windows smoke tests. It's not that our CI isn't thorough, but that it takes anywhere from twenty to forty minutes to run. Most of this time is spent setting up the test project fixture for the smoke tests.
The test project fixture doesn't change on every commit, but we rebuild it from scratch on every commit. We can start caching it more to speed things up. This PR introduces...
yarn rwfw project:deps
andyarn install
run, and one that has the rest of the steps run. The first cache is invalidated when we install new modules, the second, when we change@redwoodjs/*
packages' source code (far more common)node_modules
I think we'd benefit from faster CI at the cost of the drawbacks. But here they are:
node_modules
is a little dangerous since some packages have a postinstall step and configure things outside the framework, like Cypress and Playwright. But I feel like it's worth trying to figure out what these problematic packages areIf we like this strategy, I can do the same for the e2e test, and split the smoke-tests workflow into multiple jobs.
Working todos