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
Stryker run succeeds when something goes wrong in the initial test run #1996
Comments
Yeah, it would be nice to fail out with something along the lines of "Mutation Coverage Testing requires a green suite" an an exit code of NOT SUCCESS. |
Agreed. It is not helpful to have a passing message with error indicators. This is misleading. |
I run into this issue a lot. Stryker will throw an error during the initial run and my build will pass because it exits successfully. This means you have to look at the logs to know it failed. |
Looks like the Stryker CLI tries to kill its own process with 1, but something is ignoring that: https://github.com/stryker-mutator/stryker/blob/master/packages/core/src/StrykerCli.ts#L155-L160 |
I believe this can be fixed by replacing lines 159 and 160 of the StrykerCli ts file with process.exit(1) |
What are your thoughts @nicojs ? |
Simply killing the process sounds like a good plan. Would one of you be willing to add this? I’m actually a bit surprised that this issue is found by so many people so suddenly 🤨 since it’s been in the code for quite a while I think |
@simondel It might be some other change that just let this issue happen. |
Willing to add this but my employment requires approval before I can contribute to open source projects. I'll open a PR once that gets through (mid next week?) unless one of y'all adds it first. |
@simondel I've actually been experiencing this issue for a while, but kept forgetting to report it until a couple days ago. |
Great find! Thanks for all the reactions here. Please don't kill the process with It's also described in the nodejs docs: https://nodejs.org/api/process.html#process_process_exit_code
|
We all experienced the same issue on our own projects throughout the last year. Recently, I made a change to all of our projects and it happened to everyone. Once I submitted the issue, I shared it with every team that may be interested in supporting the fix. |
@nicojs You're right, I forgot that was the reason we do it that way! We should add that as a comment. @anthony-telljohann Since your teams are using the same process, I assume they're also using similar hardware (i.e. macOS). Could you try to reproduce your problem using this demo-app? Reproduction:
This will run mutation testing, which will fail and then Stryker should exit. If the demo-app reproduces your problem (i.e. it keeps on going), it should open a browser with the app which should look like: https://stryker-mutator.io/robobar-example/#!/ |
We certainly can and will do that 👍. That being said, we've replicated this issue on macOS, Windows, and Linux. |
@simondel are you the mole? 🙈 Your I found the issue: Don't know why we're using |
I've pushed the fix to master by accident 🙈 (I've restricted the master branch to prevent this from now on) Anyway, fixed with 49c5162 |
Thank you Nico! I am sorry I wasn't able to find the time to fix this myself. We appreciate the help. |
Hi! This has been released with @stryker-mutator version 3! You can read all about it here: https://stryker-mutator.io/blog/2020-03-11/stryker-version-3 |
Scenario: The one where something went wrong in the initial test run
Given something went wrong in the initial test run
When running mutation tests with
stryker run
Then ...
Personally, I would expect
stryker run
to fail but to my surprise it succeeds.stryker.conf.js
jest.config.js
Stryker environment
Test command
Environment
stryker.log
The text was updated successfully, but these errors were encountered: