🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Behat code coverage support - #234

Merged
schlessera merged 20 commits into
mainfrom
code-coverage
Mar 6, 2025
Merged

Behat code coverage support#234
schlessera merged 20 commits into
mainfrom
code-coverage

Conversation

@swissspidy

Copy link
Copy Markdown
Member

@swissspidy swissspidy changed the title [WIP] Code coverage support Behat code coverage support Jan 25, 2025
@swissspidy
swissspidy marked this pull request as ready for review January 25, 2025 21:37
@swissspidy
swissspidy requested a review from a team as a code owner January 25, 2025 21:37
@swissspidy

Copy link
Copy Markdown
Member Author

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 :-)

@swissspidy swissspidy added this to the 4.3.7 milestone Jan 29, 2025
@swissspidy

Copy link
Copy Markdown
Member Author

@wp-cli/committers This is ready for review, though it especially needs eyes from @schlessera who wrote the original code for this.

@swissspidy

This comment was marked as resolved.

@swissspidy
swissspidy requested a review from schlessera March 4, 2025 10:44
@@ -35,6 +35,11 @@ public function when_i_launch_in_the_background( $cmd ) {
* @When /^I (run|try) `([^`]+)`$/
*/
public function when_i_run( $mode, $cmd ) {

Copy link
Copy Markdown
Member

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...

Copy link
Copy Markdown
Member Author

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 .

Comment thread utils/generate-coverage.php
Comment thread utils/generate-coverage.php
swissspidy and others added 2 commits March 6, 2025 11:09
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
@codecov

codecov Bot commented Mar 6, 2025

Copy link
Copy Markdown

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 ☂️

@swissspidy
swissspidy requested a review from schlessera March 6, 2025 10:22
@schlessera
schlessera merged commit 16ee1c9 into main Mar 6, 2025
@schlessera
schlessera deleted the code-coverage branch March 6, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants