wp-cli / cache-command

Manages object and transient caches.
MIT License
15 stars 25 forks source link

Update trunk tests to accommodate for new transient in core #95

Closed swissspidy closed 6 months ago

swissspidy commented 6 months ago

Bug Report

Describe the current, buggy behavior

https://core.trac.wordpress.org/changeset/58025 was merged last week, which added a new transient.

That now causes some tests to fail, see https://github.com/wp-cli/cache-command/actions/runs/8845496490/job/24289764622?pr=89#step:11:88

Describe how other contributors can replicate this bug

Run Behat tests with WP_VERSION=trunk

Describe what you would expect as the correct outcome

Passing tests :)

Let us know what environment you are running this on

Any environment

Provide a possible solution

We could force-delete wp_theme_files_patterns in the tests, or add some new tests specifically targeting 6.6+, and only run the existing ones on <= 6.5. We could also modify the tests a little bit to be less strict (e.g. use "contain" vs "be")

Provide additional context/Screenshots

See link above

petitphp commented 6 months ago

Will take a look at this.

petitphp commented 6 months ago

@swissspidy I've pushed a fix for this issue.

Looking at the code which set the new transient, there is a way to disable the cache entirely base on the current development mode. We could use the constant WP_DEVELOPMENT_MODE during the tests to disable WP core caching mecanisms.