Stryker should abort when no tests found
See original GitHub issueWhen no initial tests found (because of missing nuget package (MSTest.TestAdapter)), stryker should abort the run instead.
For example:
PS C:\Src\Git\Vecozo.Grouper\41-PcsGrAfleiden\Implementation\Vecozo.Grouper.PcsGrAfleiden\05-Implementation.UnitTest> dotnet stryker -tr vstest --reporters "['html', 'consoleprogressbar']" --solution-path ..\Vecozo.Gr
ouper.PcsGrAfleiden.sln --project-file="C:\Src\Git\Vecozo.Grouper\41-PcsGrAfleiden\Implementation\Vecozo.Grouper.PcsGrAfleiden\04-Implementation\04-Implementation.csproj"
_____ _ _ _ _ ______ _______
/ ____| | | | | \ | | ____|__ __|
| (___ | |_ _ __ _ _| | _____ _ __ | \| | |__ | |
\___ \| __| '__| | | | |/ / _ \ '__| | . ` | __| | |
____) | |_| | | |_| | < __/ | | |\ | |____ | |
|_____/ \__|_| \__, |_|\_\___|_| (_)|_| \_|______| |_|
__/ |
|___/
Version 0.9.0 (beta)
[15:06:32 INF] Using C:\Src\Git\Vecozo.Grouper\41-PcsGrAfleiden\Implementation\Vecozo.Grouper.PcsGrAfleiden\05-Implementation.UnitTest\05-Implementation.UnitTest.csproj as project file
[15:06:36 INF] Started initial build using msbuild.exe
[15:06:39 INF] Auto detected msbuild version 15.9.21.664 at: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe
[15:07:37 INF] Initial build successful
[15:07:37 INF] Using C:\Src\Git\Vecozo.Grouper\41-PcsGrAfleiden\Implementation\Vecozo.Grouper.PcsGrAfleiden\05-Implementation.UnitTest\05-Implementation.UnitTest.csproj as project file
[15:07:42 INF] Started initial build using msbuild.exe
[15:07:45 INF] Auto detected msbuild version 15.9.21.664 at: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe
[15:08:48 INF] Initial build successful
[15:08:53 INF] Using testrunner VsTest
[15:08:53 INF] Initial testrun started
[15:08:53 INF] Total number of tests found in initial test run: 0
[15:08:53 INF] Initial testrun successful in 453 ms
[15:08:53 INF] Using 30679 ms as testrun timeout
[15:09:04 INF] 32 mutants could not compile and got status CompileError
[15:09:04 INF] 1908 mutants ready for test
Tests progress | █--------- | 271 / 1908 | 14 % | ~10m 32s |
Killed : 0
Survived: 271
Timeout : 0
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Stryker hangs indefinitely when "No tests were executed. ...
Stryker hangs indefinitely when "No tests were executed. Stryker will exit prematurely" with a configured transpiler #1519.
Read more >Troubleshooting | Stryker Mutator
You might run into issues like this when using the @stryker-mutator/jest-runner : No tests found, exiting with code 1. Run with `--passWithNoTests` to...
Read more >Announcing Stryker.NET 1.0
Stryker will try to make the best of the situation by marking mutants covered by initially failing tests as survived .
Read more >LIFEPAK 15 monitor/defibrillator - Operating instructions
No battery installed or fault detected. No battery is installed in battery well 1, or a fault was detected in the battery in...
Read more >Stryker Corporation Health Center For Employees of Sage, ...
How much will on-site lab tests and prescriptions cost for employees without insurance? There is no cost for medications dispensed from the Health...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That is a bug IMHO. We should be able to parse the lines on all languages. Maybe look for a number in the output, or something a bit stricter, but not exactly text matching. Or at least make the regex configurable, so that people can fix this themselves.
If you know for sure that 0 tests have run, then I would suggest the following:
Mutate like you normally would, but skip the running of the tests. Just directly report that all mutants survived because we couldn’t find any tests. That is the most logical way of handling it, no need for a warning or abort.
This would mean a breaking change. Our “dotnet test” runner parses the console output for the number of tests executed. I’ve seen an example of a run on a franch system where the parser found 0 tests because the language was different in the console output.
If we stop stryker on 0 tests found, users on a non english system could not use stryker anymore.
I’m more fond of a less rigorous solution like logging a warning on no test cases found. For your case we should fix the vstest runner instead I think.