-
Notifications
You must be signed in to change notification settings - Fork 24
Add wp cache supports <feature>
command
#84
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 wp cache supports <feature>
command
#84
Conversation
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.
Can we WP_CLI::error( 'Checking cache features is only available in WordPress 6.1 and higher' );
if the function doesn't exist?
wp cache supports <feature>
command
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.
Thanks @janw-me ! I made a few changes you might enjoy reading through.
@@ -41,6 +41,7 @@ | |||
"cache incr", | |||
"cache replace", | |||
"cache set", | |||
"cache supports", |
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.
@danielbachhuber I'm guessing that you add this line, run some command and it updates the README.
Can you show me how to do this?
Might come in handy next time.
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.
After adding that line README.md
regeneration can be even skipped and Github Actions will create a separate PR after the main PR is merged - see https://github.com/wp-cli/.github/blob/main/.github/workflows/reusable-regenerate-readme.yml
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.
After adding that line
README.md
regeneration can be even skipped and Github Actions will create a separate PR after the main PR is merged - see https://github.com/wp-cli/.github/blob/main/.github/workflows/reusable-regenerate-readme.yml
Correct. However, to avoid the separate PR (which was unnecessary because I was already in the code), I simply ran wp scaffold package-readme ./
in the repository directory.
@require-wp-6.1 | ||
Scenario: Checking if the cache supports a feature | ||
Given a WP install | ||
|
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.
@danielbachhuber I don't understand what use this has.
non_existing
doesn't exist by default.
Wouldn't it be better to run a test on 6.1 for a feature that is defined (in 6.2)
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 don't understand what use this has.
@janw-me @require-wp-6.1
means the test will only run on WordPress 6.1 and higher. WordPress 3.7 is a part of the testing matrix, so an earlier test on this branch failed: https://github.com/wp-cli/cache-command/actions/runs/4620028330/jobs/8169572449
non_existing
doesn't exist by default.
Wouldn't it be better to run a test on 6.1 for a feature that is defined (in 6.2)
I think the test is fine as it is. It doesn't need to be overly complex.
Fixes #79