Skip to content
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

Remove test_global_styles_user_cpt_change_invalidates_cached_stylesheet #45993

Merged
merged 1 commit into from
Nov 24, 2022

Conversation

mmtr
Copy link
Contributor

@mmtr mmtr commented Nov 23, 2022

Follows up #45679

What?

Removes the test_global_styles_user_cpt_change_invalidates_cached_stylesheet test that was added in #45679.

Why?

Because the test was added to check that the cached global stylesheet is cleared up after changing the Global Styles CPT. But after removing the filter that short-circuits the cache (see #45679 (comment)), the test is unable to check such behavior anymore, given that the cache is never used when test runs because WP_DEBUG is enabled.

@mmtr mmtr added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Nov 23, 2022
@mmtr mmtr self-assigned this Nov 23, 2022
@codesandbox
Copy link

codesandbox bot commented Nov 23, 2022

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@felixarntz
Copy link
Member

@mmtr Is this test causing failures in trunk?

It's of course not great to remove tests, so I want to make sure we bring this test back once we can (for example as part of #45912, since then there likely will be some filter again).

@mmtr
Copy link
Contributor Author

mmtr commented Nov 24, 2022

@felixarntz It is not! But the test is not checking anything since it was intended for verifying that gutenberg_get_global_stylesheet wasn't returning a cached value after updating the wp_global_styles CPT. Since the cache is not used when WP_DEBUG is enabled, and given that the test environment has WP_DEBUG enabled, the test is pointless (gutenberg_get_global_stylesheet won't return a cached value ever) – hence why I opted for removing it.

I agree we should add it back as part of #45912 once we have a way for the tests to use the cache.

Copy link
Member

@oandregal oandregal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unfortunate, but I don't see another way forward at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Performance Related to performance efforts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants