-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Workflows: Performance: Run suite atop latest stable major WordPress version #32244
Conversation
Size Change: +427 B (0%) Total Size: 1.03 MB
ℹ️ View Unchanged
|
(thanks to @priethor for spotting typos in my Bash-inside-JS snippet!) |
I'm not sure we need this 😬 I don't think that the Core version set in As @youknowriad said in Slack,
Aside, setting the Core version to |
1831ec7
to
ef363d0
Compare
I like the current approach of this PR (an option to define the base WP to use) |
In that case, and also based on your comment in #32277, I've marked it ready for review. :) |
ef363d0
to
8836392
Compare
... by patching the temporary test environment's `.wp-env.json` config.
35ef36e
to
9d58030
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.
Thanks, the new option works like a charm 🙌
bin/plugin/commands/performance.js
Outdated
// Only use the major version, i.e. 5.7.2 becomes 5.7. | ||
const major = options.wpVersion.split( '.' ).slice( 0, 2 ).join( '.' ); |
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.
How about leaving this to the caller? I think it's arguably not this script's responsibility (plus we're not really documenting it in bin/plugin/cli.js
).
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.
This was me taking a shortcut because of how ZIP files are named on the server. See 1217cff, in which I did things correctly. :)
bin/plugin/commands/performance.js
Outdated
await runShellScript( | ||
`sed -I '' -e '/"core":/s/WordPress\\/WordPress/${ zipUrl }/' "${ environmentDirectory }/.wp-env.json"` | ||
); |
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.
We could use jq
-- or just plain JS -- to modify the JSON file here 😬
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.
or just plain JS
True, true. 😅 How about now?
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.
Looking great overall, thanks! Left a few minor notes, and one that I believe is relevant 😄
// In order to match the topology of ZIP files at wp.org, remap .0 | ||
// patch versions to major versions: | ||
// | ||
// 5.7 -> 5.7 (unchanged) | ||
// 5.7.0 -> 5.7 (changed) | ||
// 5.7.2 -> 5.7.2 (unchanged) | ||
const zipVersion = options.wpVersion.replace( /^(\d+\.\d+).0/, '$1' ); |
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.
IMO, we could drop this altogether and make it the caller's concern to choose the right version format (mostly thinking YAGNI here, since our only use case is guaranteed to use the correct format). Not a big deal tho, I don't mind having it here.
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.
True, though in this case I feel it would open the door for mistakes, because someone operating the --wp-version
flag doesn't need to know that the flag results in a specific ZIP file being pulled later by wp-env. --wp-version 5.7.0
should be an accepted value, so let's ensure it doesn't break.
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.
One very minor note, but looking good to go now! Thanks!
Thanks for the feedback! |
Potential alternative to #32277
Description
Right now our Run performance test GitHub Action is failing, presumably because it is trying to run Gutenberg's performance test suite on top of WordPress trunk. Since we have just ported all WP5.8-related pieces to WordPress trunk (#31322), the Gutenberg plugin is temporarily in a state of conflict with WordPress trunk.
This PR simply changes the default setting in our.wp-env.json
configuration so that it will prefer to run on whichever is the latest stable release of WordPress (as of today,5.7.x
). I thought this might be a saner and more stable configuration anyway, regardless of performance testing.This PR:
--wp-version
option to theperformance-tests
CLI command--wp-version
.How has this been tested?
Checklist:
*.native.js
files for terms that need renaming or removal).