-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Backport block template resolution algorithm unit tests #1920
Backport block template resolution algorithm unit tests #1920
Conversation
Can't remove wordpress-develop/src/wp-includes/class-wp-theme.php Lines 341 to 348 in 3442f77
Are we going to relax this to accept |
3 unit test failures to go -- 1 from the newly backported tests, 2 from what seems to be a side effect of the theme switching (?):
|
For the remaining failure |
That's a bit concerning though. The test has a note that specifically points at a regression fix: https://github.com/WordPress/wordpress-develop/pull/1920/files#diff-12e215aaa7e67637d3de9eae20536f56ac9248727dcdca0b6f87c09e3f256166R101-R108 The reasoning of that PR makes sense to me; and I think I thought to preserve that functionality when refactoring the template resolution algorithm, and added the test to cover against further regressions. I'll look a bit more into this. |
I think I've tracked it down: You're right that the algorithm is working as expected here. In Gutenberg OTOH, something isn't quite working with test theme directory registration, and thus, we're not detecting that This will require a number of different fixes:
|
@ockham I think to avoid delaying the switch to "templates" and "parts", we should comment this test for now while we work on it separately. In parallel, I can start the "folders" patch in Core that way it will unblock the Gutenberg PR. |
This was punted to 6.0: |
Thanks for clarifying @carolinan! |
Okay, I'll do that now 👍 |
Done: 6d63d8f. Should pass now & be ready for review. |
Multisite tests are failing. I'll try a rebase for starters. |
Multisite tests are still failing. Specifically, tests affected are in the sidebars and widgets controller test suites ( I've double-checked that this is not affecting cc/ @adamziel @TimothyBJacobs @desrosj in case the above seems familiar to any of you, since AFAICS, y'all have worked on the sidebar and widget controllers. |
Trying to revert the theme switch, and restoring the |
No, multisite tests are still failing 😕 (It's the same ones as before, plus a bunch more in |
The next thing I'll try will be to copy the theme switching strategy from wordpress-develop/tests/phpunit/tests/theme/wpThemeJsonResolver.php Lines 15 to 37 in e7c8bf8
|
Having another look at the test matrix, not all multisite tests are failing. The ones that are passing are:
|
Uh, but the 8.1 jobs have The 5.6 ones do seem to pass, tho. |
This got a bit messy upon first attempt (more failures in other tests). New/alternative hypothesis: Since we've been doing the theme switching in the static |
Hmm, looking at the test failures, it seems like the data might be coming from |
This could be relevant: #1331 |
Seems like the sidebar/widgets data we're seeing if written by |
@jorgefilipecosta gave me the decisive tip: 5087aeb 😄 |
Great, going to commit this. |
committed in https://core.trac.wordpress.org/changeset/52246 |
These tests have now been backported to Core, see WordPress/wordpress-develop#1920, so they're no longer needed here.
I've filed an issue for the failing unit test that we had to disable in Core Trac: https://core.trac.wordpress.org/ticket/54515 |
These tests have now been backported to Core, see WordPress/wordpress-develop#1920, so they're no longer needed here.
It seems like we missed backporting these as part of #1796. Doing it now since they will give us better confidence when we need to modify the algorithm.
Prompted by this discussion.
I opted to integrated test fixture files into existing block theme test fixtures in
wordpress-develop
to keep the number of fixtures and files down. AFAICS, they've been used for testingtheme.json
related features so far, so I don't think there should be any collisions.Trac ticket: https://core.trac.wordpress.org/ticket/54478
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.