-
Notifications
You must be signed in to change notification settings - Fork 250
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(checker): add checker api #2240
Conversation
EDIT: I've included the We can choose to remove |
So far looks good. Definitely looks like an interface that I could use to implement a checker for #1980, but I am curious about precedence of Status. If I've got two checkers ( Also, when would a checker return a |
Great question. The idea I now have is that they would be chained. So the first status !=
A great observation. The only valid results I can think of right now are
Should we limit the mutant state in the check result to one of these 3 states? We can always add more later if people need it. |
Yeah, I think limiting it to those three are a good idea, it makes it a lot more clear when implementing as an outsider to only have those options |
Oh, I noticed that |
Yes, good observation once more :). It will be able to let a bunch of stuff be injected. Like all plugins. See https://www.github.com/stryker-mutator/stryker-handbook/tree/master/stryker%2Fapi%2Fplugins.md |
I've renamed the enum CheckStatus {
Ok = 'ok',
Ignore = 'ignore',
CompileError = 'compileError',
} We'll probably remove @Garethp what do you think of the |
Perhaps |
Yes. That might be better. One passes a check. |
|
Removed Ignored status for now
Sure you can! We can also add the specific line number and column number location to the mutant. Right now it only contains |
Move the `Mutant` interface from from `api/mutant` to `api/core`. It is now also used in the new checker api.
The reason is |
I've renamed Ready for review @simondel |
I haven't investigated the stryker's source code yet, but this feature looks very good. Filtering mutants would solve my problem for sure. Thank you for your hard work! |
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.
I like it! Simple yet powerful feature.
Adds
Checker
plugin type, to be used in #1514 (and can later be used to filter mutants in #1980).The
Checker
interface looks like this:Init
The idea is that, before mutation testing (or even before files are instrumented), we initialize the checker. It can be used as a sanity check. The
TypescriptChecker
can use this to load all files and compile once (with--no-emit
) to make sure errors don't occur under normal circumstances.Check
Each mutant is checked, one by one. A checker can decide to assign any of the
CheckStatus
's we've. If we agree we should move stuff used by both thechecker
api andreport
api tocore
.@simondel @vitaly-rudenko do you agree with this api?