Conversation
# Conflicts: # src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs
…nsibility to new class 'ProjectAnalyzerContext' (WIP)
# Conflicts: # src/Stryker.TestRunner.MicrosoftTestPlatform.UnitTest/MicrosoftTestPlatformRunnerPoolTests.cs
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors project analysis/initialisation to streamline Buildalyzer usage and improve how Stryker identifies mutable projects + their associated test projects (especially across solution/project modes and target frameworks).
Changes:
- Introduces
TargetsForMutation,ProjectAnalyzerContext, and mutable project/target tracking types to centralize analysis state and framework/platform selection. - Refactors
InputFileResolverto use the new analysis context and to map test projects to source projects via assembly/project references. - Updates solution/platform handling (“AnyCPU” vs “Any CPU”), logging behavior, and adjusts unit tests accordingly.
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs | Adds helper extensions for validating overall analysis results across frameworks. |
| src/Stryker.TestRunner.MicrosoftTestPlatform.UnitTest/MicrosoftTestPlatformRunnerPoolTests.cs | Makes runner creation synchronization explicit to reduce flakiness in disposal tests. |
| src/Stryker.Solutions/SolutionFile.cs | Adjusts solution/platform normalization and adds per-project configuration lookup helper. |
| src/Stryker.Solutions.Test/SolutionFileShould.cs | Updates assertions for normalized solution platform naming (“Any CPU”). |
| src/Stryker.Core/Stryker.Core/ProjectComponents/SourceProjects/SourceProjectInfo.cs | Replaces SolutionInfo with TargetsForMutation on source project metadata. |
| src/Stryker.Core/Stryker.Core/Initialisation/TargetsForMutation.cs | New: encapsulates chosen config/platform, selected projects, and restore-at-solution-level behavior. |
| src/Stryker.Core/Stryker.Core/Initialisation/ProjectAnalyzerContext.cs | New: wraps Buildalyzer project analysis, framework selection, and detailed logging. |
| src/Stryker.Core/Stryker.Core/Initialisation/MutableProjectTree.cs | New: tracks a project’s candidate targets and their validity for mutation. |
| src/Stryker.Core/Stryker.Core/Initialisation/MutableProjectTarget.cs | New: links a mutable target to the test-project analysis results that cover it. |
| src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs | Major refactor: drives analysis via contexts and builds a test↔source mapping using the new tree types. |
| src/Stryker.Core/Stryker.Core/Initialisation/InitialisationProcess.cs | Switches build step to read config/platform from TargetsForMutation. |
| src/Stryker.Core/Stryker.Core.UnitTest/Mutators/CollectionExpressionMutatorTests.cs | Whitespace-only test fixture cleanup. |
| src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/ProjectOrchestratorTests.cs | Updates mocks/verifications to assert EnvironmentOptions passed into Buildalyzer builds. |
| src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/InputFileResolverTests.cs | Updates expected framework selection behavior and Buildalyzer invocation assertions. |
| src/Stryker.CLI/Stryker.CLI/Logging/LoggingInitializer.cs | Tweaks diagnostic-mode console log level selection (at least Debug). |
| src/.run/FullFrameworkApp.Test.run.xml | Updates IDE run configuration working directory. |
Comments suppressed due to low confidence (1)
src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs:499
- ArgumentNullException is constructed with
pathas the parameter name, but it should usenameof(path)so tooling reports the correct parameter name regardless of runtime value.
private string FindProjectFile(string path)
{
if (string.IsNullOrEmpty(path))
{
throw new ArgumentNullException(path, "Project path cannot be null or empty.");
}
# Conflicts: # src/Stryker.Core/Stryker.Core.UnitTest/Compiling/CSharpCompilingProcessTests.cs # src/Stryker.Core/Stryker.Core.UnitTest/Compiling/CSharpRollbackProcessTests.cs # src/Stryker.Core/Stryker.Core.UnitTest/Mutators/CollectionExpressionMutatorTests.cs # src/Stryker.Core/Stryker.Core.UnitTest/StrykerRunnerTests.cs # src/Stryker.Core/Stryker.Core/Compiling/CsharpCompilingProcess.cs # src/Stryker.Core/Stryker.Core/Initialisation/CsharpProjectComponentsBuilder.cs # src/Stryker.Core/Stryker.Core/Initialisation/InitialisationProcess.cs # src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs # src/Stryker.Core/Stryker.Core/MutationTest/CsharpMutationProcess.cs
# Conflicts: # src/Stryker.CLI/Stryker.CLI.UnitTest/packages.lock.json # src/Stryker.CLI/Stryker.CLI/packages.lock.json # src/Stryker.Core/Stryker.Core.UnitTest/packages.lock.json # src/Stryker.Core/Stryker.Core/packages.lock.json # src/Stryker.TestRunner.VsTest.UnitTest/packages.lock.json
|
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Massive refactor of initialization/project discovery/project analysis phase.
So that
Benefits:
Improve support for solution with better cross project dependency analysis, especially for multi targeting projects.
Better feedback when project analysis phase failed.
Priority
I tagged it medium priority due to being unsure if it fixes existing blocking problems, but merging should not being delayed too much as this PR alters the design for initialization phase classes