-
Notifications
You must be signed in to change notification settings - Fork 808
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 ability to run block tests against specific Gutenberg versions #20239
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
|
bd9a0d5
to
9d8763d
Compare
@glendaviesnz Is there any info where I can learn more about the motivation behind this PR? |
p1HpG7-cuI-p2 Very open to ideas about other ways of approaching this. |
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.
I think the idea of being able to run against a different version of Gutenberg is a good idea, but I don't like the amount of hackery going on in the script you're adding here.
I have to wonder how this even works given the failures in #19328 where renovate is trying to update the same pacakges.
Unfortunately I don't know enough about how all this stuff works to be able to suggest a better way to do things.
@@ -38,6 +38,7 @@ | |||
"fixtures:regenerate": "REGENERATE_FIXTURES=y GENERATE_MISSING_FIXTURES=y pnpx jest", | |||
"fixtures:generate": "GENERATE_MISSING_FIXTURES=y pnpx jest", | |||
"fixtures:test": "jest validate.js", | |||
"fixtures:test:gbv": "node tests/test-gutenberg-version.mjs", |
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 should probably add .mjs
to the set of files that are linted, like we just did for .cjs
as part of PR 20085 (see 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.
Good idea, will do that if we decide to go ahead with this PR based on outcome of discussions at p1HpG7-cuI-p2
'showdown', | ||
'simple-html-tokenizer', | ||
'hpq', | ||
'react-autosize-textarea', | ||
'traverse', | ||
'css-mediaquery', | ||
'@emotion/styled', | ||
'@emotion/react', |
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.
What's going on here? Are all of these going to have to be added someday when we get around to making #19328 happen?
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 is just temporarily adding some additional dependencies that the latest Gutenberg needs to successfully build - I assume that these could be removed when #19328 happens, although there is always the potential that the cutting edge Gutenberg is going to have some dependencies that the Jetpack repo doesn't.
Not the ideal setup in my view either, but I couldn't find any other way of making this happen without a temporary adjustment of the current dependencies - and the only way to automate that is a temporary hack of the package.json files as far as I can see. If the issues with #19328 are resolved would the plan be to try and keep the Jetpack repo more in-sync with the latest @WordPress package releases? If that was the case maybe this approach isn't necessary?
It probably works because we aren't trying to build the whole project with the new dependencies, it is only the Jetpack block code that is being compiled against them on the fly via the jasmine test runner |
It'd be good to keep better on top of the renovate backlog, yes. Part of the problem is that we don't have anyone really familiar with all this React code on Crew, so if something breaks in an update it's hard for us to fix on our own.
But even |
Yeh, because of changes in the Gutenberg packages a few of the tests were failing, I had to update quite a few of the tests to get them to run against the different dependency trees. In theory, if I get this PR finalised and merged, and #19328 is rebased, the test-extensions issues should be resolved there. |
Maybe it'd make more sense to fix #19328 so it can be merged, then see if the controversial parts of this approach are still necessary? That might also simplify the necessary changes, as when doing it in #19328 you wouldn't need to continue to support the old versions of the packages too. |
Yeh, good idea, I will take another look at it from that angle. |
Changes proposed in this Pull Request:
Does this pull request change what data or activity we track or use?
No
Testing instructions:
pnpm fixtures:test:gbv trunk 3774b1489f17de1da53a96a2066ce9a8f996293c
pnpm fixtures:test:gbv test-validation
to just run the tests againpnpm fixtures:test:gbv reset
and check that./packages
and./tests/temp-gutenberg-checkout
dirs have been removed and the./package.json
changes have been reverted andpnpm test-extensions
completes successfullypnpm fixtures:test:gbv trunk
and make sure all the tests complete successfullyTodo: