go-gremlins / gremlins

A mutation testing tool for Go.
https://gremlins.dev
Apache License 2.0
187 stars 17 forks source link

feat: add only diff run flag #215

Closed rusinikita closed 9 months ago

rusinikita commented 9 months ago

Proposed changes

Running mutations only for changes. A new flag diff runs git diff with reference and skip mutants outside of changes.

Killed: 16, Lived: 0, Not covered: 1
Timed out: 0, Not viable: 0, Skipped: 168
Test efficacy: 100.00%
Mutator coverage: 94.12%

Look at docs change for details.

Types of changes

Checklist

Further comments

k3rn31 commented 9 months ago

Hello and thanks for the PR. We'll do a review ASAP. In the mean time can you pleas check the failing CI checks?

rusinikita commented 9 months ago

Hi! Yes, of course. I just want to get approve of solution design. Is it good for you?

rusinikita commented 9 months ago

Fixed. But I need advice about engine.New has 5 arguments (exceeds 4 allowed) codeclimate issue.

rusinikita commented 9 months ago

@k3rn31 Hi! I'm thinking about adding this to my work projects.

How much time will a review take?

If it's not long I'll wait for a merge.

k3rn31 commented 9 months ago

Hi! we're doing the review today, it looks promising (except for one Codeclimate linting error). I believe I'll merge soon on develop, but I'm not sure when we'll make a new release. This is a good change we'll make an extra release earlier to let this feature available right away.

rusinikita commented 9 months ago

Ok, thanks!

It looks promising (except for one Codeclimate linting error)

About that. I want be in sync with your vision and wanna know a way that you prefer:

I need advice about engine.New has 5 arguments (exceeds 4 allowed) codeclimate issue.

  • I can pass Diff with Option
  • I can create params struct
  • Or something else
k3rn31 commented 9 months ago

I think the struct param is better, since we don't use it as a library and the option doesn't make sense to me.

rusinikita commented 9 months ago

I combined a coverage and diff into CodeData. So it can be extended in future for solving https://github.com/go-gremlins/gremlins/issues/167

Let me know if you want to rename it or squash/rename some commits.

codecov[bot] commented 9 months ago

Codecov Report

Attention: 17 lines in your changes are missing coverage. Please review.

Comparison is base (b62af32) 88.57% compared to head (e8cedb3) 88.02%. Report is 1 commits behind head on main.

Files Patch % Lines
cmd/unleash.go 9.09% 10 Missing :warning:
internal/engine/engine.go 70.00% 2 Missing and 1 partial :warning:
internal/diff/parse.go 90.00% 2 Missing :warning:
internal/mutator/mutator.go 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #215 +/- ## ========================================== - Coverage 88.57% 88.02% -0.56% ========================================== Files 18 20 +2 Lines 1322 1394 +72 ========================================== + Hits 1171 1227 +56 - Misses 126 141 +15 - Partials 25 26 +1 ``` | [Flag](https://app.codecov.io/gh/go-gremlins/gremlins/pull/215/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-gremlins) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/go-gremlins/gremlins/pull/215/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-gremlins) | `88.02% <79.26%> (-0.56%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-gremlins#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.