-
Notifications
You must be signed in to change notification settings - Fork 380
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
chore: multiple measures to make e2e tests more reliable #4637
Conversation
📊 Benchmark resultsComparing with 9240a0f Package size: 294 MB(no change)
Legend
|
2e1ef4e
to
a9dcf11
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.
I recall that I had used the verdaccio in memory plugin and it was slower on consecutive runs (as it always needed to download all node_modules) therefore I switched to a disk based solution as the artifacts (node_modules) can be cached by circlecis disk cache and persisted:
The evolution of this is in the ocean project [internal url]: https://github.com/netlify/ocean/blob/main/.circleci/config.yml#L126
- save_cache:
key: e2e-{{ arch }}-v1-{{ checksum "package.json" }}
paths:
- .verdaccio-cache
Instead of leveraging the in memory version I would persist the cache as this is way faster on consecutive or similar runs
74def75
to
2c4a8bc
Compare
Okay I reworked it, it is now caching the verdaccio storage between builds. |
await rmdirRecursiveAsync(workspace) | ||
} | ||
|
||
env.npm_config_registry = url |
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.
This replaces the writing of the npmrc file.
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.
Does this work on linux as well? Had some issues on windows and linux when I recall correctly?
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.
execa
which we use to call the package managers, does automatically inherit all environment variables.
the weird part is: as we call the e2e tests through an npm script this environment variable is already set, but with the proper npmjs registry. This is why I guess in the past we had to use --registry
when calling the package managers, as the environment variable always takes precedence over any other config format besides cli options.
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.
Thanks for reworking looks good to me! 🐳
increase timeout to 10min cache verdaccio storage in github actions only write .npmrc during publish cache packages in verdaccio up to 1 day
@@ -4,7 +4,6 @@ on: | |||
push: | |||
branches: [main] | |||
pull_request: | |||
types: [synchronize, opened, reopened, edited] |
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.
I changed this, as the e2e tests would run whenever the main body or title was edited, which I don't think makes sense. I saw that edited
is also triggered when the base branch changes, but I guess that is a less common scenario and in that case kodiak would merge anyway and rerun stuff.
The other 3 types are default anyway.
Summary
Refs #4625
.npmrc
file during publishing to verdaccio. For the installation this is not needed and the registry can be set by an environment variable.