Skip to content

Commit

Permalink
fix(initialization): allow running stryker on the project under test …
Browse files Browse the repository at this point in the history
…from an unrelated working directory (#1708)

If the test projects are defined in the stryker-config.json file (under stryker-config.test-projects), it becomes impossible to find the project under test unless it is in the current working directory since `FindProjectFile` is used instead of `FindProjectUnderTest`.

It used to work before #1039 where a behavioural change was introduced. @richardwerkman do you remember what was the intention behind that change?

Co-authored-by: Rouke Broersma <mobrockers@gmail.com>
  • Loading branch information
0xced and rouke-broersma authored Oct 15, 2021
1 parent e2523e4 commit b7884f8
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public ProjectInfo ResolveInput(StrykerOptions options)
var projectInfo = new ProjectInfo(_fileSystem);
// Determine test projects
var testProjectFiles = new List<string>();
string projectUnderTest = null;
if (options.TestProjects != null && options.TestProjects.Any())
{
testProjectFiles = options.TestProjects.Select(FindTestProject).ToList();
Expand All @@ -67,14 +66,7 @@ public ProjectInfo ResolveInput(StrykerOptions options)
projectInfo.TestProjectAnalyzerResults = testProjectAnalyzerResults;

// Determine project under test
if (options.TestProjects != null && options.TestProjects.Any())
{
projectUnderTest = FindProjectFile(options.BasePath);
}
else
{
projectUnderTest = FindProjectUnderTest(projectInfo.TestProjectAnalyzerResults, options.ProjectUnderTestName);
}
var projectUnderTest = FindProjectUnderTest(projectInfo.TestProjectAnalyzerResults, options.ProjectUnderTestName);

_logger.LogInformation("The project {0} will be mutated.", projectUnderTest);

Expand Down

0 comments on commit b7884f8

Please sign in to comment.