-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Skip Gutenberg plugin activation test on older WP versions #6396
Skip Gutenberg plugin activation test on older WP versions #6396
Conversation
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 Core Committers: Use this line as a base for the props when committing in SVN:
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Hmm I don't like using Why is it even possible to install an incompatible version in the first place? Also, doesn't |
We can try 🙂 (But FWIW, it's only used to compare versions; and AFAICT, the WP version found in
The original error (on the 6.2 branch) is here: https://github.com/WordPress/wordpress-develop/actions/runs/8617843489/job/23619026501 This was still with Puppeteer, i.e. using the
Possibly! I don't see it covered here. With Playwright, we now use this helper; we might get an HTTP error code back from that I'll dig a bit. |
Gutenberg PR to bump the "Required WP Version" field to 6.4: WordPress/gutenberg#60780 |
If I do a
We should be able to work with that. |
Nice! |
Thank you! I had to tweak it a bit since it didn't seem to throw upon plugin install, but only upon activation. |
4b877a0
to
a83cefc
Compare
Thank you @swissspidy! Committed to Core in https://core.trac.wordpress.org/changeset/58046. |
The purpose of
tests/e2e/specs/gutenberg-plugin.test.js
is to ensure that running the Gutenberg plugin (stable version) on a WordPresstrunk
install doesn't produce any fatals.The test has been around since WP 6.2. It makes sense to have it present on older branches, as the Gutenberg plugin not only supports
trunk
, but also the current stable version of WordPress (i.e. currently 6.5), and one version below (6.4). However, it is not expected to work on any earlier versions beyond that; in practice, it has produced errors on some of those.This changeset compares the WordPress version of the current branch (found inpackage.json
) to the Gutenberg plugin'srequired_wp
field. If the WordPress version is lower than the requirement, the test is skipped.This changeset checks the REST API response from the plugin activation requests. If it returns an error with error code
plugin_wp_incompatible
, it skips the test.Testing instructions
trunk
.6.5.
and6.4
branches, temporarily cherry-pick the latest commit from this PR to the relevant branch, and runnpm run test:e2e -- tests/e2e/specs/gutenberg-plugin.test.js
. It should pass.$wp_version
variable insrc/wp-includes/version.php
to e.g.6.2.0
. Run the test again; it should be skipped.6.3
and prior as the test was refactored (from Puppeteer to Playwright) after 6.3. Per https://wordpress.org/plugins/gutenberg/, 6.3 is still supported, so it is currently expected to pass there. However, this is probably best solved by bumping theRequired WP Version
field (Plugin: Bump minimum required WordPress version to 6.4 gutenberg#60780), and deleting the test file from the6.3
branch (Tests: Remove Gutenberg plugin activation e2e test #6397).Trac ticket: https://core.trac.wordpress.org/ticket/60971
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.