-
Notifications
You must be signed in to change notification settings - Fork 252
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(core): simple mutation switching process #2269
feat(core): simple mutation switching process #2269
Conversation
Implement a simple mutation testing process using mutation switching. BREAKING CHANGE: * Transpilers are no longer supported, please use build command instead * Custom mutators are no longer supported, Stryker now brings it's own mutator
Todo:
|
So yeah the PR turned out to be pretty massive. I've revamped the entire core of Stryker. I also had to break the reporter api in some places, we might need to break it more later. I'll update the PR's description to reflect the current state. |
return this.options.coverageAnalysis === 'perTest'; | ||
} | ||
} | ||
// import { Mutant, StrykerOptions } from '@stryker-mutator/api/core'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, one of the ones that need to go. Probably best if I remove it indeed. I do want to keep some of it for now. For example, the new Checker
code can be loosely based on the Transpiler
code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I think it is better to remove it, since we could forget about it later, ok. We just need to keep it in mind :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you're right. Classes that are already refactored/replaced should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, all dead code is gone now.
* Remove test runner v1 stuff * Remove mutator plugin stuff * Remove test framework plugin stuff * Remove `SandboxPool` (was reimagined as `TestRunnerPool`) * Remove `MutantTestMatcher` (was reimagined as `findMutantTestCoverage`)
Implement a simple mutation testing process using mutation switching. It represents a new way of running mutation testing, where we place all mutants in the code at the same time. This is only the first step and lacks support for more advanced use cases.
This is a non-exhaustive list of changes:
Location
to theMutant
API, for ease of reportingTestRunner2
factoryExecutor
classes. AnExecutor
is responsible for managing a part of the process. I think this helps enormously to understand the general process of mutation testing.PrepareExecutor
: Responsible to read configuration and input files from disk.MutantInstrumenterExecutor
: Responsible for instrumenting the source code and generating mutantsDryRunExecutor
: Responsible for performing the initial test run.MutationTestExecutor
: Responsible for running actual mutation testing.Sandbox
class. It is now only responsible for filling a sandbox with files. It no longer manages mutants inside the sandbox or the test runner instance.SandboxPool
->TestRunnerPool
, which now manages only test runner instances.TestFramework
andMutator
plugins, see breaking changesBREAKING CHANGES:
Most of these changes are related to internals of Stryker plugins.
@stryker-mutator/instrumenter
. It uses babel and an HTML parser under the hood so it has support for all the usual suspects.