-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Tests: Ensure block support tests are resilient to equivalent HTML changes #72934
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
Conversation
|
Flaky tests detected in 3d624fb. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19041545962
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| ), | ||
| ), | ||
| 'expected_wrapper' => '<div class="has-background" style="background-image:url(' . $apos . 'https://example.com/image.jpg' . $apos . ');background-size:cover;">Content</div>', | ||
| 'expected_wrapper' => '<div class="has-background" style="background-image:url('https://example.com/image.jpg');background-size:cover;">Content</div>', |
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.
These could become the ' character for more legible tests:
| 'expected_wrapper' => '<div class="has-background" style="background-image:url('https://example.com/image.jpg');background-size:cover;">Content</div>', | |
| 'expected_wrapper' => '<div class="has-background" style="background-image:url(\'https://example.com/image.jpg\');background-size:cover;">Content</div>', |
This reverts commit 7e69ee6.
3d624fb to
558893d
Compare
|
Thanks for the PR! I thought we had tried that before when investigating and the CI didn't pass. Wasn't that the case?
The difference between now and back then is that the previous failures were from |
Thank you for noticing that! Indeed, the test method was unavailable in the previous version and we see an error:
This change would be good to make but unfortunately we'll have to wait 🙂 |
This PR must wait until the previous WordPress version is 6.9.
What?
Instead of using fragile string equality comparisons, this relies on HTML comparisons with Core's
assertEqualHTML. This is a semantic comparison of the HTML that is resilient to syntactic differences between equivalent text like&vs'(which caused problems in the tests).This prevents the issue that appeared in Gutenberg tests after WordPress/wordpress-develop#10143 was merged.
This reverts commit 7e69ee6 from PR #72236 and implements an alternate approach.
Testing Instructions
CI passes.