-
Notifications
You must be signed in to change notification settings - Fork 841
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
Bump Node to v18.18.1
; Remove puppeteer
#7274
Conversation
Buildkite test this |
@@ -32,7 +32,6 @@ | |||
"test": "yarn lint && yarn test-unit", | |||
"test-ci": "yarn test && yarn test-cypress", | |||
"test-unit": "node ./scripts/test-unit", | |||
"test-a11y": "node ./scripts/a11y-testing", |
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 removed the command to call our older Puppeteer tests to run a11y checks against the docs pages. I haven't removed the script because it'll be repurposed with Cypress at some point in the future.
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 would strongly rather see us rip it all out now (the script file, the start-test-server-and-a11y-test
script, and the @axe-core/puppeteer
+puppeteer
dependencies.
There's honestly very little chance we'll end up using Puppeteer in the future. We'll likely either use Cypress E2E testing directly to test our docs, or we'll use Playwright instead (since Playwright is more lightweight and actually supports M1 machines).
There's virtually no upside to keeping Puppeteer in our dependencies - it causes issues for devs on arm64 machines and it increases CI load times installing a dependency we're not even using.
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.
Puppeteer, script, and deps should be removed now. I wasn't 💯 that the start-test-server
command in the package.json file was specific to Puppeteer, so it stayed in. Happy to remove it if it seems unnecessary.
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.
start-test-server
is specific to puppeteer/the a11y script, please nuke it!
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'm also fairly sure we can rip out the webpack-dev-server
dependency as well once that's gone; the script is the only thing using it. The wins just keep on coming 🎉 💥
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.
Yes on start-test-server
but we'll need to keep webpack-dev-server
to run yarn start
. Adding it back now as I bump the .nvmrc
.
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.
Lol fuck I totally missed that webpack serve
is powered by webpack-dev-server
, I just did a basic grep for the package name 🤦 Sorry!!
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.
Hey, I missed it too. Adding it back in a jiffy.
&& chown -R pptruser:pptruser /home/pptruser \ | ||
&& chown -R pptruser:pptruser /node_modules \ | ||
&& chown -R pptruser:pptruser /cypress |
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'm not confident this change is 1:1 - in particular -G audio,video
seems potentially odd that we've lost it. Do you mind explaining how/why this works, and also pushing up a Cypress test change to fail deliberately so we can ensure that screenshots/artifacts are still captured?
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 pulled the commands apart this morning with some help from the Linux man pages. To the best of my understanding we're safe to remove the commands as are. the -G audio,video
was being used to assign the pptruser
to the audio and video groups to enable audio and video recordings.
Cypress does allow video recordings, but the feature is turned off by default. If we want to start video recording in the future, we'd need to add back the -G audio,video
to the node
user.
I've pushed a commit d606b47 that purposely fails a Cypress test. The should output a screenshot Docker image captures screenshots and they're uploaded by the Buildkite runner under the Artifacts
tab.
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.
Cypress does allow video recordings, but the feature is turned off by default. If we want to start video recording in the future, we'd need to add back the
-G audio,video
to the node user.
Let's do that pre-emptively please. I'd like the ability to quickly set Cypress in CI to emit videos for easier debugging if necessary via cypress.json
without having to know linux/docker settings or getting confused as to why no videos are being output.
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.
Done!
This reverts commit d606b47.
node-18.18.0-slim
base image..nvmrc
to use Node v18.18.0
🎉 🎉 This is looking really fantastic - thank you Trevor! Really excited for this cleanup. Can we do one more thing to test the video behavior:
Once the above steps are complete, let's go ahead and merge away on this PR! |
.nvmrc
to use Node v18.18.0
.nvmrc
to use Node v18.18.1
I ran a quick test with a failing spec and verified the video is being created and added to Buildkite artifacts. That's the good news. The bad news is Cypress 12 doesn't allow me to only keep videos of failing tests, so we had a lot of MP4s in that last run. Cypress 13 has an official solution for only keeping failing test runs, so I'll be sure to include that change with work to bump us to |
…de` instead - answer found in https://stackoverflow.com/a/76733478
- pretty basic/expected, there are other instances in EUI where we've had to do this
- one less dependency to keep up to date
.nvmrc
to use Node v18.18.1
v18.18.1
; Remove puppeteer
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 bearing with me on feedback rounds Trevor - this is an enormously wonderful cleanup!
Preview staging links for this PR:
|
💚 Build Succeeded
History
cc @1Copenut |
Summary
PR captures a few streams of work that are related and easier to consolidate in one changeset:
node-18-18.0-slim
node-18-18.1-slim
as the base image. This matches the current downloadable version of Node for general use. A second PR will follow promptly to update EUI to use Nodev18.18.0v18.18.1 for daily work as well.yarn add global cypress
from our Docker image. This will make upgrading to Cypress 13 easier.puppeteer
user from our Docker image. Remove the Puppeteer script to check document pages for accessibility. We're using Cypress component tests and will roll new doc page checks using Cypress or Playwright..nvmrc
to use Node v18.18.0 for day to day activities.PR closes #7022
QA
Docker container QA
QA will be verified manually on the Buildkite UI to ensure all tests pass with this new Docker image.
.nvmrc
Node QAThis is a two-part process that shouldn't take more than 15-20 minutes.
Part I
Pull the branch locally, then enter the following commands on your terminal:
nvm install 18.18.0
yarn
you may see a Node warning aboutfsevents
optional dependency error. This is b/c of our older Jest dep.yarn lint
yarn test-unit
yarn test-cypress
Part II
When all of the following tests complete successfully:
nvm alias default 18.18.0
nvm uninstall 18.17.1