-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add regression E2E test for the bug that caused some wp_options to get corrupted data #32797
Add regression E2E test for the bug that caused some wp_options to get corrupted data #32797
Conversation
Size Change: +6.07 kB (+1%) Total Size: 1.05 MB
ℹ️ View Unchanged
|
The flow being tested here also ends up testing the issue for the flow described in the issue above, as the underlying cause is the same. I reckon that it'd probably be better to test this at a lower level (see questions in the PR description), but maybe this test is good enough for now. |
a16f0b5
to
eefbff7
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.
Assuming the changes in lib/rest-api.php
get reverted and this PR eventually only includes the packages/e2e-tests/specs/misc/settings.test.js
file, the code looks good and makes sense.
Thank you for this PR, if we had this test earlier, we(I) never would have made that error in v10.7.x 👍
It's great to cover against this regression from re-surfacing 👍 My only concern here is that strictly speaking, the e2e test doesn't really cover any Gutenberg-specific behavior; one could argue that it really should live in https://github.com/WordPress/wordpress-develop instead (and GB could arguably run those tests to make sure that it doesn't break any of Core's expected behavior, see #26418). It's also a fair point that we might be able to cover this with a unit test, if we find the function that updates the relevant option, and check the resulting changes 🤔 However, on a practical level, I agree that it's better to cover this behavior somehow in GB for now, since implementing #26418 is non-trivial, and not even without controversy. Furthermore, Maybe we can:
cc/ @desrosj, since you're my go-to person for Core e2e tests 😬 |
As a post-scriptum to my previous comment, I noticed that there is some unit test coverage in |
@ockham Thanks for the thorough review and experiments!
I can help with 3 now, I just don't know how to file an issue in |
… the wp_option data corruption bug
…eproduce the wp_option data corruption bug" This reverts commit 17eb33b.
b8a11ed
to
9ffad29
Compare
Ah right, it's kind of a mix 😬 It's on GH (https://github.com/WordPress/wordpress-develop/); however, it's not actually possible to file issues there (only PRs); you'd have to use Core Trac for that, https://core.trac.wordpress.org/. Apologies for my misleading earlier instructions! 😅
Yep, works for me! 👍 |
Trac ticket created here: https://core.trac.wordpress.org/ticket/53520#ticket. |
I agree that this test doesn't cover any functionality specific to the Gutenberg plugin so it should be moved to a proper place. |
Description
Gutenberg v10.7.x introduced a bug that caused some
wp_option
s to get blank or corrupted data after (any) settings were updated in theoptions-general.php
page. This was eventually fixed in v10.7.4, with this PR: https://github.com/WordPress/gutenberg/releases/v10.7.4. See Automattic/wp-calypso#53447 and Automattic/wp-calypso#53431.This test doesn't check only for the fields mentioned in the issues above, but tries to see if other attributes had any changes after the settings were updated when they shouldn't have. I'm excluding some options that seem to change automatically (matching
_transient
in the id: I don't know anything about those and didn't find specific docs about them) and of course, the option for the setting we updated in order to test, or it would always make the test fail :)How has this been tested?
It's been a while since v10.7.4, and I couldn't automatically revert #32229 in order to reproduce the change. I then did that manually in this commit that's part of this changeset. This commit will be removed before this PR is merged.
Negative scenario (default in this PR as of now):
specs/misc/settings.test.js
and watch it fail, like this:Positive scenario
17eb33b3c1
;specs/misc/settings.test.js
and it should pass:Questions
Checklist:
*.native.js
files for terms that need renaming or removal).