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

Rename InfectionCommand to RunCommand #1188

Merged
merged 1 commit into from Mar 21, 2020

Conversation

theofidry
Copy link
Member

  • Rename InfectionCommand to RunCommand
  • Re-order the methods by usage

@theofidry theofidry merged commit c5881ef into infection:master Mar 21, 2020
@theofidry theofidry deleted the refactor/command-1 branch March 21, 2020 20:41
theofidry added a commit that referenced this pull request Mar 23, 2020
Depends on #1188 

- Rename `TestRunConstraintChecker` to `MinMsiChecker`
- Move metrics related classes under the `Metrics` namespace together
- Change the pattern of usage of the `MinMsiChecker`: instead of returning a boolean with failuretype, and let the `Engine` log accordingly and return a boolean, we do nothing & return nothing when everything is fine and throw on failure.

Why this change? There is several reasons:

- Reduce dependency in shared mutable state (`MetricsCalculator`, `TestRunConstraintChecker#failureType`
- Simplify the code: rather than using a boolean return value which requires additional mutable state to provide context, it is easier to let the callee instead of the caller do the logging appropriately

Note that although I plan to change more, I sticked to the above which is already quite a big change IMO. So I did not change the error messages or when they should be displayed for example.

One more thing: I now throw `MinMsiCheckFailed` exception instead of logging with an `error` block, so the result is now like this:

<img width="820" alt="Screen Shot 2020-03-20 at 14 47 04" src="https://user-images.githubusercontent.com/5175937/77169492-d861bf00-6ab9-11ea-907e-aa429f4a7561.png">
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.

None yet

2 participants