-
Notifications
You must be signed in to change notification settings - Fork 24
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
Behat code coverage support #234
Conversation
I successfully tested this with wp-cli/i18n-command#426, see https://github.com/wp-cli/i18n-command/actions/runs/13017636318/job/36341408448?pr=426 wp-cli/.github#119 is now merged too. Now all that's missing is a code review on this PR :-) |
@wp-cli/committers This is ready for review, though it especially needs eyes from @schlessera who wrote the original code for this. |
This comment was marked as resolved.
This comment was marked as resolved.
@@ -35,6 +35,11 @@ public function when_i_launch_in_the_background( $cmd ) { | |||
* @When /^I (run|try) `([^`]+)`$/ | |||
*/ | |||
public function when_i_run( $mode, $cmd ) { |
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.
This is not the only step that triggers a WP-CLI command. For proper coverage, we'll need to cover all instances that trigger WP-CLI commands, like (for example) the below when_i_run_from_a_subfolder()
and when_i_run_the_previous_command_again()
. There might be others as well...
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.
It's only when_i_run_from_a_subfolder
AFAICT, because when_i_run_the_previous_command_again
just re-runs the previous command without any substitutions.
I don't think there are any others.
when_i_launch_in_the_background
is used for launching wp server
in the background, but it doesn't make sense to invoke coverage collection there. That means no code coverage for server-command but I think we can live with that .
Co-authored-by: Alain Schlesser <alain.schlesser@gmail.com>
The expected output changed because there are new table columns. Figured just changing it to CSV output makes the test more stable
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
See wp-cli/wp-cli#6035