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

feat: add only diff run flag #215

Merged
merged 6 commits into from
Dec 19, 2023
Merged

feat: add only diff run flag #215

merged 6 commits into from
Dec 19, 2023

Conversation

rusinikita
Copy link
Contributor

@rusinikita rusinikita commented Dec 10, 2023

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

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes (make all)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

@pull-request-size pull-request-size bot added the s/L Size: Denotes a Pull Request that changes 100-499 lines label Dec 10, 2023
@k3rn31
Copy link
Member

k3rn31 commented Dec 11, 2023

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
Copy link
Contributor Author

rusinikita commented Dec 11, 2023

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

@pull-request-size pull-request-size bot added s/XL Size: Denotes a PR that changes 500-999 lines and removed s/L Size: Denotes a Pull Request that changes 100-499 lines labels Dec 11, 2023
@rusinikita
Copy link
Contributor Author

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

@rusinikita
Copy link
Contributor Author

@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
Copy link
Member

k3rn31 commented Dec 18, 2023

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
Copy link
Contributor Author

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
Copy link
Member

k3rn31 commented Dec 18, 2023

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
Copy link
Contributor Author

rusinikita commented Dec 19, 2023

I combined a coverage and diff into CodeData. So it can be extended in future for solving #167

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

Copy link

codecov bot commented Dec 19, 2023

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 ⚠️
internal/engine/engine.go 70.00% 2 Missing and 1 partial ⚠️
internal/diff/parse.go 90.00% 2 Missing ⚠️
internal/mutator/mutator.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            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 Coverage Δ
unittests 88.02% <79.26%> (-0.56%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@k3rn31 k3rn31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your implementation is sound.
I would have taken a slightly different approach: instead of marking a mutator as "skipped", you could mark it as runnable or not (if the diff flag is active) in the same spot where it checks if it has coverage. This way no changes would have been necessary in the executor.

@k3rn31 k3rn31 merged commit 84488fa into go-gremlins:main Dec 19, 2023
14 checks passed
@rusinikita rusinikita deleted the diff-flag branch December 30, 2023 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s/XL Size: Denotes a PR that changes 500-999 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants