Closed CzBuCHi closed 1 year ago
Running Stryker.Net from the solution folder triggers the so called 'solution mode; Stryker then identifies test projects in the solution and mutate the others. In solution mode, the tp
parameter is ignored.
To put it another way: Stryker is expected to perform everything automatically in solution mode. But this feature was limited to simple solutions pre V3.9, when we massively rewrote the initialization phase to bring solution mode to full maturity.
Here it appears that Project.Tests
is not identified as a test project.
To be identified as a test project, a project must either has been created as one in VS, it then bears a specific project type guid -3AC096D0-A1C2-E12C-1390-A8335801FDAB
- recognized by Stryker. Or it must have the property IsTestProject
set to true, which is usually set by the unit test frameworks.
We have identified that older testprojects may be missing both characteristics, so we added detection of known test frameworks (xUnit, NUnit and MsTest) as another criteria.
To work around this, you can either:
1) change the ProjectTypeGuids
property of Project.Tests
to 3AC096D0-A1C2-E12C-1390-A8335801FDAB
(by manually editing the csproj file).
2) try V3.9, which should work in solution mode
3) add the IsTestProject
property to Project.Tests.csproj
file
added both <ProjectTypeGuids>3AC096D0-A1C2-E12C-1390-A8335801FDAB</ProjectTypeGuids>
and <IsTestProject>True</IsTestProject>
to test projects and ran dotnet stryker
from solution dir and stryker found all test projects and now is mutating ...
PS: my original idea was to generate reports for each test/tested [project and then merge them into one, but now i discovered that stryker can run multiple tests in solution (didnt found any mention of this in doc) so i dont need to use -p + -tp at all ...
Describe the bug Calling stryker with
-s C:\Path\To\Solution.sln -p Project.csproj -tp C:\Path\To\Project.Tests\Projects.Tests.csproj
fromC:\Path\To\
directory will fail to find test project.Logs (reduced)
Expected behavior Same behavior as when calling stryker with
-s C:\Path\To\Solution.sln -p Project.csproj
fromC:\Path\To\Project.Tests\
directoryC:\Path\To\Project.Tests\Project.Tests.csproj
as test project andC:\Path\To\Project\Project.csproj
as project under testDesktop (please complete the following information):
Additional context Cannot upgrade to 3.9.0 because of #2528