Add an --exclude=<plugin> argument to wp plugin verify-checksums#104
Conversation
danielbachhuber
left a comment
There was a problem hiding this comment.
Thanks for the pull request!
Can you include some functional tests for this change? Here is some guidance on our pull request best practices, if it's helpful.
|
@danielbachhuber, sure thing! Will do them! |
|
@stoyan-g Still planning to add some tests here? |
|
Hey there @danielbachhuber, |
Fix some formatting Add feature test Fix issues after tests
fe97228 to
cb9fe73
Compare
|
Hey there @danielbachhuber , did some changes and rebased the branch since it was a bit behind main and there were some issues with the behat tests. Hope everything runs smooth now. |
features/checksum-plugin.feature
Outdated
| Then STDOUT should contain: | ||
| """ | ||
| Verified 0 of 1 plugins (1 skipped). | ||
| """ No newline at end of file |
There was a problem hiding this comment.
Given the test failures, I think I'd recommend testing against akismet instead of hello-dolly.
Can we also include an assertion that the plugin is verified when the --exclude= argument isn't included?
There was a problem hiding this comment.
I've added the assertion you've mentioned and also improved the previous Scenario a bit
There was a problem hiding this comment.
@stoyan-g Looks better!
It looks like the tests aren't yet passing, and there's a PHPCS failure. Can you make sure everything passes as expected?
I think I'd recommend deleting hello-dolly at the beginning of each Scenario, so your test is running directly against akismet.
There was a problem hiding this comment.
@danielbachhuber, yup I will fix the PHPCSS... I cannot believe I missed that... I've noticed that in the previous Scenarios, the plugins installed with a command for example:
Scenario: Verify plugin checksums
Given a WP install
When I run `wp plugin install duplicate-post --version=3.2.1`
Then STDOUT should not be empty
And STDERR should be empty
and from the test result I see that mine fail with the following
Scenario: Plugin is verified when the --exclude argument isn't included # features/checksum-plugin.feature:189
And these installed and active plugins: # features/checksum-plugin.feature:191
$ wp plugin install akismet --activate
Installing Akismet Anti-Spam: Spam Protection (5.1)
Downloading install package from https://downloads.wordpress.org/plugin/akismet.5.1.zip...
Using cached file '/tmp/wp-cli-home/.wp-cli/cache/plugin/akismet-5.1.zip'...
Unpacking the package...
Installing the plugin...
Plugin install failed.
Is it better to do it with the command or rely on the environment to install it for me?
There was a problem hiding this comment.
@stoyan-g akismet is bundled with WordPress, and it's safe to assume it's available.
--exclude=<plugin> argument to wp plugin verify-checksums
|
Nice work on this, @stoyan-g ! |
|
Hello, |
|
@kanlukasz It's unreleased, but you can use it in the nightly: |
I've added an exclude option flag to the wp plugin verify-checksums cli command. This will skip the verification and increase the skipped count and also will not show the "Could not retrieve the version for" warning inside the console.