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

Feature: Align report Reporter api with mutation-testing-elements #2766

Closed
Tracked by #2721
nicojs opened this issue Feb 25, 2021 · 2 comments · Fixed by #2755
Closed
Tracked by #2721

Feature: Align report Reporter api with mutation-testing-elements #2766

nicojs opened this issue Feb 25, 2021 · 2 comments · Fixed by #2755
Labels
🚀 Feature request New feature request
Milestone

Comments

@nicojs
Copy link
Member

nicojs commented Feb 25, 2021

Is your feature request related to a problem? Please describe.
When we first started with Stryker there was no mutation-testing-elements.

There is a lot of overlap with the mutation-testing-report-schema field names, but subtle differences. See differences below.

Stryker mutation-testing-elements
MutantStatus.TimedOut MutantStatus.Timeout
estimatedNetTime duration
coveredByTests (boolean) coveredBy (array, an empty array means not covered)
testFilter (array) coveredBy
testFilter (undefined) static (true/false)
runAllTests (boolean) static (true/false)
errorMessage, ignoreReason statusReason
nrOfTestsRan testsCompleted
id (number) id (string)

We also have a lot of types that represent a mutant in different states of execution:

  • Mutant -- a mutant generated and placed, but coverage is not yet measured.
  • MutantTestCoverage -- internal type in Stryker core. A mutant of which coverage is measured, ready to be tested.
  • MatchedMutant -- Like MutantTestCoverage but it's reporter API equivalent.
  • MutantResult -- The final state of a mutant.
  • MutantResult (mutation testing elements) -- The final state of a mutant (mutation testing elements variant).

Describe the solution you'd like

End up with 3 interfaces of mutants: Mutant, MutantTestCoverage, MutantResult. All of them are based on the mutation testing elements naming scheme.

Describe alternatives you've considered

Additional context
This is a breaking change because it will hit the Reporter API.

@nicojs nicojs added the 🚀 Feature request New feature request label Feb 25, 2021
@nicojs nicojs changed the title Feature: Allign report Reporter api with mutation-testing-elements Feature: Align report Reporter api with mutation-testing-elements Feb 25, 2021
@nicojs
Copy link
Member Author

nicojs commented Feb 25, 2021

@Garethp please take a look as well, since you will be hit by this issue

@nicojs nicojs mentioned this issue Feb 25, 2021
6 tasks
@nicojs nicojs added this to the 5.0 milestone Feb 25, 2021
nicojs added a commit that referenced this issue Mar 11, 2021
…#2798)

This change brings the `Reporter` API more in line with the schema of [`mutation-testing-elements`](https://github.com/stryker-mutator/mutation-testing-elements). It also adds the metrics result to the `onMutationTestReportReady` for convenience.

| Old | New |
|-|-|
| `MutantStatus.TimedOut` | `MutantStatus.Timeout` |
| `mutant.coveredByTests` (boolean) | `mutant.coveredBy` (array, an empty array means not covered) |
| `mutant.testFilter` (array) | `mutant.coveredBy` |
| `mutant.testFilter` (undefined) | `mutant.static` (true/false) |
| `mutant.runAllTests` (boolean) | `mutant.static` (true/false) |
| `mutant.errorMessage`, `mutant.ignoreReason` | `mutant.statusReason` |
| `mutant.nrOfTestsRan` | `mutant.testsCompleted` |
| `mutant.id` (number) | `mutant.id` (string) |
| `MatchedMutant` | `MutantTestCoverage` (name change) |

This has also a small impact on the `TestRunner` API, because the `Mutant` is used there as well.

BREAKING CHANGE: Changes to `Reporter` and `TestRunner` plugin API of Stryker

Fixes #2766
@nicojs
Copy link
Member Author

nicojs commented Mar 25, 2021

Closed with #2798

@nicojs nicojs closed this as completed Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 Feature request New feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant