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

Additional/fixed tests for 58962. #5588

Conversation

peterwilsoncc
Copy link
Contributor

@peterwilsoncc peterwilsoncc commented Oct 30, 2023

See https://core.trac.wordpress.org/ticket/58962

Some additional tests that already pass.

These can be committed and back-ported during the release candidate phase as they do not touch source code.

Commit message draft:

Options, Meta APIs: Improve tests for option cache priming.

Improves a number of tests for the `wp_prime_option_caches()` function to ensure:

* `get_option()` does not prime the cache while testing the function has primed the cache
* it handles a mix of primed, unprimed and non-existent options
* passing an empty array doesn't trigger a DB query
* `get_option()` returns the same value regardless of how the cache is primed
* re-priming the cache does not trigger additional DB calls (at present this only tests truthy values pending #59738)
* re-priming items primed by `wp_load_alloptions()` does not trigger additional DB calls

Additionally, ensures  `get_option()` does not prime the cache while testing `wp_prime_option_caches()` has primed the cache.

Props peterwilsoncc, costdev, 🔢🔢🔢🔢🔢 
See #58962, #59738.

@peterwilsoncc peterwilsoncc force-pushed the do/58962-additional-passing-tests branch from 793cab3 to 154a2bc Compare October 30, 2023 01:37
@peterwilsoncc peterwilsoncc marked this pull request as ready for review October 30, 2023 01:46
…memcached implimentaion used in the test suite.
Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

@peterwilsoncc Is there anything in here that's not in #5576? I'm asking since I think we should rather commit that PR with the fixes and backport it, per my response on the ticket.

@peterwilsoncc
Copy link
Contributor Author

peterwilsoncc commented Oct 30, 2023 via email

@peterwilsoncc
Copy link
Contributor Author

Closing without merge, PR #5576 to be committed to include src fixes.

@peterwilsoncc peterwilsoncc deleted the do/58962-additional-passing-tests branch October 30, 2023 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants