-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(reporter api): unify reporter api with mutation-testing-elements (…
…#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
- Loading branch information
Showing
107 changed files
with
2,672 additions
and
2,817 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,43 @@ | ||
import * as schema from 'mutation-testing-report-schema'; | ||
|
||
import { Range } from './range'; | ||
import { Location } from './location'; | ||
|
||
export { MutantStatus } from 'mutation-testing-report-schema'; | ||
|
||
// We're reusing the `MutantResult` interface here to acquire uniformity. | ||
|
||
/** | ||
* Represents a mutant | ||
* Represents a mutant in its initial state. | ||
*/ | ||
export interface Mutant { | ||
/** | ||
* The id of the mutant. Unique within a run. | ||
*/ | ||
id: number; | ||
/** | ||
* The name of the mutator that generated this mutant. | ||
*/ | ||
mutatorName: string; | ||
export interface Mutant extends Pick<schema.MutantResult, 'id' | 'location' | 'mutatorName' | 'replacement' | 'statusReason'> { | ||
/** | ||
* The file name from which this mutant originated | ||
*/ | ||
fileName: string; | ||
/** | ||
* The range of this mutant (from/to within the file) | ||
* deprecate? | ||
*/ | ||
range: Range; | ||
/** | ||
* The line number/column location of this mutant | ||
*/ | ||
location: Location; | ||
/** | ||
* The replacement (actual mutated code) | ||
* Actual mutation that has been applied. | ||
*/ | ||
replacement: string; | ||
/** | ||
* If the mutant was ignored during generation, the reason for ignoring it, otherwise `undefined` | ||
* The status if a mutant if known. This should be undefined for a mutant that still needs testing. | ||
*/ | ||
ignoreReason?: string; | ||
status?: schema.MutantStatus; | ||
} | ||
|
||
/** | ||
* Represents a mutant in its matched-with-the-tests state, ready to be tested. | ||
*/ | ||
export type MutantTestCoverage = Mutant & | ||
Pick<schema.MutantResult, 'coveredBy' | 'static'> & { | ||
estimatedNetTime: number; | ||
}; | ||
|
||
/** | ||
* Represents a mutant in its final state, ready to be reported. | ||
*/ | ||
export type MutantResult = Mutant & schema.MutantResult; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,2 @@ | ||
import * as mutationTestReportSchema from 'mutation-testing-report-schema'; | ||
|
||
export { Reporter } from './reporter'; | ||
export * from './mutant-result'; | ||
export { MutantStatus } from './mutant-status'; | ||
export { SourceFile } from './source-file'; | ||
export { MatchedMutant } from './matched-mutant'; | ||
export { | ||
/** | ||
* Types exported directly from mutation-testing-schema | ||
* @see https://github.com/stryker-mutator/mutation-testing-elements/tree/master/packages/mutation-testing-report-schema | ||
*/ | ||
mutationTestReportSchema, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.