Skip to content
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

Coveralls-style reporting on PRs #1687

Closed
danepowell opened this issue May 2, 2022 · 3 comments
Closed

Coveralls-style reporting on PRs #1687

danepowell opened this issue May 2, 2022 · 3 comments
Labels
DX Developer Experience Feature Request

Comments

@danepowell
Copy link

danepowell commented May 2, 2022

Is your feature request related to a problem? Please describe.

MSI is a great metric to complement code coverage, but mutation tests take so long to run (at least on our project) that we can only run a full suite after a pull request is merged. We get a nice badge with our MSI via Stryker integration, but that doesn't help us to gauge the quality of a pull request before merging.

Describe the solution you'd like

I love the way that Coveralls reports changes in code coverage on a pull request, and I'd love something similar for MSI reporting:
Screen Shot 2022-05-02 at 10 27 31 AM

The two obstacles I see are, again, the time required to run the full test suite, and the lack of any system to surface the MSI on the PR. Stryker doesn't integrate with PRs AFAICT.

To speed up tests: #1085

To report MSI on the PR: maybe Infection could call the GitHub Status API to report MSI? Something like this should work, but it lacks the additional context (i.e. % change from base branch) of Coveralls: gh api /repos/{owner}/{repo}/statuses/{sha} -f state="success" -f description="23%" -f context="MSI"

@maks-rafalko
Copy link
Member

IMO to produce such report, we will still need to run the whole MT on a PR, so I can't see how it will speed up your particular case, while I agree that this feature can be still implemented.

but mutation tests take so long to run (at least on our project) that we can only run a full suite after a pull request is merged

did you consider using --git-diff-lines?

@danepowell
Copy link
Author

danepowell commented May 4, 2022

Thanks, I'll definitely use --git-diff-lines. Though that's still only half of the use case: it can tell you when a PR introduces new mutations, but it can't tell you if it fixes existing mutations.

Maybe this is satisfactory for now. I'm happy to close this unless other people voice interest. Fundamentally, the limitation will be the time required to run the full test suite, it can never work on PRs.

@maks-rafalko
Copy link
Member

If you use --git-diff-lines together with --min-covered-msi=100, that would work like a baseline feature in PHPStan/Psalm - you will not have any new escaped mutations in a touched code, but you agree with already existing ones (in not touched code).

I'm happy to close this unless other people voice interest

Let's close for now. We can always reopen if there will be any interest in it. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Developer Experience Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants