Skip to content

[4.x] Add --only-changed option for coverage #1708

Open
JonPurvis wants to merge 1 commit into
pestphp:4.xfrom
JonPurvis:git-diff-coverage
Open

[4.x] Add --only-changed option for coverage #1708
JonPurvis wants to merge 1 commit into
pestphp:4.xfrom
JonPurvis:git-diff-coverage

Conversation

@JonPurvis
Copy link
Copy Markdown
Contributor

@JonPurvis JonPurvis commented May 16, 2026

What:

  • New Feature

Description:

This PR adds a new --only-changed option to Pest's existing coverage reporting.

When enabled, coverage is calculated only for files changed in the current Git branch, rather than the entire application.

Example:

./vendor/bin/pest --coverage --only-changed

This makes coverage feedback more relevant during development, especially in larger or legacy applications where overall coverage may already be low.

For example, if a developer adds a new Laravel command and fully tests it, they would see coverage for the code introduced in their branch instead of the overall application coverage percentage.

This also makes it easier for teams to enforce coverage standards for new code in CI without being affected by existing coverage debt.

@JonPurvis JonPurvis changed the title Add --only-changed option for coverage [4.x] Add --only-changed option for coverage May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant