-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Build: Fix E2E and chromatic inconsistencies #23051
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48abd77
to
b2d03d5
Compare
kasperpeulen
approved these changes
Jun 14, 2023
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.
Nice work man!
b2ccb65
to
8e239f1
Compare
shilman
approved these changes
Jun 14, 2023
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.
Nice one @yannbf 👏
This was referenced Jun 14, 2023
Merged
shilman
added a commit
that referenced
this pull request
Jun 14, 2023
Build: Fix E2E and chromatic inconsistencies (cherry picked from commit d00fe88)
kasperpeulen
pushed a commit
that referenced
this pull request
Jun 14, 2023
Build: Fix E2E and chromatic inconsistencies (cherry picked from commit d00fe88)
kasperpeulen
pushed a commit
that referenced
this pull request
Jun 14, 2023
Build: Fix E2E and chromatic inconsistencies (cherry picked from commit d00fe88)
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
build
Internal-facing build tooling & test updates
ci:daily
Run the CI jobs that normally run in the daily job.
patch:done
Patch/release PRs already cherry-picked to main/release branch
patch:yes
Bugfix & documentation PR that need to be picked to main branch
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #
What I did
This PR solves a few sources of flakiness.
Viewports E2E test
It seemed to be testing the wrong element, which playwright assumed had the same dimensions either without or with viewports enabled:
Chromatic
The "Desktop" component stories had a counter which was causing inconsistencies, and now it has chromatic ignore regions to avoid it:
![image](https://private-user-images.githubusercontent.com/1671563/245709482-0a5600a0-75ae-4285-9a85-c7971c6f5c3c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MjExMTcsIm5iZiI6MTczOTUyMDgxNywicGF0aCI6Ii8xNjcxNTYzLzI0NTcwOTQ4Mi0wYTU2MDBhMC03NWFlLTQyODUtOWE4NS1jNzk3MWM2ZjVjM2MucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTRUMDgxMzM3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2FiMjkwZDc3NDc1ZWI3YzA2ZTA5ZTJjOTc2MzRhMGM5Y2JmOTQ1OTAzYWM5OGYyZTNhZTE4NDhhYjA1Yjk5ZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.lHgzXcDr4vJUeSmtYVj0OV1p3FzenUDmLhDKMLpsr5k)
The "DocsPage" story has a very inconsistent args table row which keeps changing in order, therefore I added a play function which injects a chromatic ignore region to it. I did it in the play function and not in the component so that we don't always ignore snapshots for the argstable component, and we really just ignore in the place we know is inconsistent.
Additionally I made the "play function banner" (we display only when snapshotting stories in Chromatic that have play function) more prominent and explanatory
The "TS Argtypes" suffers a similar issue, where a minified function name keeps changing, so I added a similar mechanism using the play function.
How to test
Tests should work correctly
Checklist
MIGRATION.MD
Maintainers
make sure to add the
ci:merged
orci:daily
GH label to it.["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]