-
Notifications
You must be signed in to change notification settings - Fork 339
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
Reduce GitHub workflow runs (including Percy screenshot uploads) #2878
Conversation
1a00454
to
57f07fa
Compare
da06036
to
6cd237a
Compare
6cd237a
to
f36e812
Compare
f36e812
to
2694631
Compare
2694631
to
fb25ee2
Compare
fb25ee2
to
4c2142c
Compare
4c2142c
to
dc34836
Compare
dc34836
to
ad9dfa0
Compare
ad9dfa0
to
f5135a2
Compare
f5135a2
to
fba630d
Compare
@36degrees Morning! This commit for “JavaScript disabled” screenshots follows your idea in #2871 I've added a |
Prevents duplicate runs as `pull_request` event already fires for PR pushes
By removing `push` events we’ve lost the abilty to run tests without a PR being open, not any more
When tests were run with the Node.js or jsdom test environment, we were including helper code that tried to access the Puppeteer `page` object
Makes sure we’re also testing the default environment for all components
Previously the Sass rendering tests were combined with the screenshot generation `describe()` block
34dad96
to
f1182b3
Compare
f1182b3
to
de727f2
Compare
Morning @36degrees I've gone through and split out all the commits, explaining what's happening and why If you can take another look please 😊 |
Reloads the page (without JavaScript) for second capture
…test.js` These tests don’t need a Chromium browser window (Puppeteer environment) This change brings Nunjucks HTML render + validation together
These tests don’t need a Chromium browser window (Puppeteer environment)
We’ve configured Jest + Puppeteer with `browserPerWorker: true` to open multiple browsers and speed up our tests: https://github.com/smooth-code/jest-puppeteer#jest-puppeteerconfigjs This stops Node.js warning us about potential memory leaks
…isting()` Preparation for tests that need to filter components by certain files, for example “All components with `${component}.mjs`”
This change reduces our Percy screenshots down from 64 to 42 as we don’t need to capture identical screenshots for components that lack JavaScript functionality
de727f2
to
83736b7
Compare
Just adding some GitHub Action workflow tweaks here
Ideas so far
Cancel in-progress GitHub workflows when pushed again
Forgot a change? Pushing up a second time with cancel the 1st test run
Remove
push
event from GitHub Actions branch workflowsPrevents duplicate runs as
pull_request
event already fires for PR pushesSkip tests for documentation changesDon't need to run JavaScript tests when onlydocs/**/*.md
files have changed (??)Move “All components” template tests out of Puppeteer environment
Don't lose time spinning up Chromium (headless) to run HTML validation checks etc
Only take “JavaScript disabled” screenshots for components with JS
Skip "JavaScript disabled" tests for components lacking
*.mjs
files as screenshots will be identicalBefore
[pull_request, push]
events for PRsGitHub Workflow: 14 checks total (7 checks per run)
Screenshots (JavaScript enabled): 64 images (32 per run)
Screenshots (JavaScript disabled): 64 images (32 per run)
Time: 89.322 s, estimated 96 s
After
pull_request
events for PRsGitHub Workflow: 7 checks total
Percy screenshots (JavaScript enabled): 32 images
Percy screenshots (JavaScript disabled): 11 images
Time: 58.233 s, estimated 96 s