Closed alexanderkozlenko closed 5 years ago
Hey! Stryker currently needs to be run from the context of the unit test project (we have plans to change this in the future). Could you try running stryker from https://github.com/alexanderkozlenko/json-rpc/tree/master/src/Anemonis.JsonRpc.UnitTests ?
Also the solution file path is not required for dotnet core.
@Mobrockers, thank for the quick response! I managed to run Stryker, however, faced another issue, could you please take a look?
[20:13:47 INF] Using C:\git\json-rpc\src\Anemonis.JsonRpc.UnitTests\Anemonis.JsonRpc.UnitTests.csproj as project file
[20:14:00 INF] Started initial build using dotnet build
[20:14:04 INF] Initial build successful
[20:14:12 INF] Using testrunner VsTest
[20:14:12 INF] Initial testrun started
[20:14:13 INF] Total number of tests found in initial test run: 381
[20:14:13 INF] Time Elapsed 00:00:26.1349482
Stryker.NET failed to mutate your project. For more information see the logs below:
Initial testrun was not successful.
Assert.AreEqual failed. Expected:<1.1>. Actual:<1,1>.
It seems like one of your unit tests is locale specific so the unit test fails on my system. It also fails for me in visual studio. We require all unit tests work for stryker to run to avoid unreliable results.
Another issue I found was the following:
Stryker uses Environment.GetEnvironmentVarible() to detect which mutation is enabled for this testrun. It seems like this method is actually not available in netstandard 1.1. When we find multiple TargetFrameworks in project we simply choose to take the first in the list. The first in the list in your project is 1.1 so this method that stryker injects into your project is not available :|
You can work around this be swapping <TargetFrameworks>netstandard1.1;netstandard2.0</TargetFrameworks>
with <TargetFrameworks>netstandard2.0;netstandard1.1</TargetFrameworks>
@alexanderkozlenko I ran your project for you. I got it working by commenting out the one unit test that was failing for me, then changing the order of the targetframeworks in the csproj.
C:\git\json-rpc\src\Anemonis.JsonRpc.UnitTests> dotnet stryker -tr vstest -r "['ConsoleProgressBar', 'Html']"
Here's your result, pretty good! mutation-report.zip
@Mobrockers, thank you for very detailed response and a found issue in unit tests! I assume the issue can be closed, since I have good instructions how to run Stryker.NET on my project.
FYI: I suppose there is a small issue with navigation in HTML report (at least with Google Chrome and Mozilla Firefox): navigation fails if source file name contains 0x60 ASCII character. There are two such entries in the attached report.
Could you create an issue for the html report here: https://github.com/stryker-mutator/mutation-testing-elements
Summary
Stryker failed to analyse a solution with the message
No .csproj file found
. Command line used:Logs
Expected behavior
Stryker succeeded to analyse a solution.
Environment
Additional context
The example project: https://github.com/alexanderkozlenko/json-rpc