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 an --exclude=<plugin>
argument to wp plugin verify-checksums
#104
Add an --exclude=<plugin>
argument to wp plugin verify-checksums
#104
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.
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). | ||
""" |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the assertion you've mentioned and also improved the previous Scenario a bit
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.