Skip to content

feat: support for solution level configuration#3511

Open
dupdob wants to merge 75 commits into
masterfrom
fix_3424
Open

feat: support for solution level configuration#3511
dupdob wants to merge 75 commits into
masterfrom
fix_3424

Conversation

@dupdob

@dupdob dupdob commented Mar 31, 2026

Copy link
Copy Markdown
Member

Massive refactor of initialization/project discovery/project analysis phase.
So that

  • classes have clearer responsibilities
  • ensure consistency between solution & project mode
  • ensure consistency in configuration/platform/framework handling
  • reduce number of edge cases
  • simplify problems' diagnosis

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

Copilot AI review requested due to automatic review settings March 31, 2026 05:42
# Conflicts:
#	src/Stryker.TestRunner.MicrosoftTestPlatform.UnitTest/MicrosoftTestPlatformRunnerPoolTests.cs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 InputFileResolver to 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 path as the parameter name, but it should use nameof(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.");
        }

Comment thread src/Stryker.Solutions/SolutionFile.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/ProjectAnalyzerContext.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/ProjectSimulatedBuildHandler.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/MutableProjectTree.cs Outdated
Copilot AI review requested due to automatic review settings March 31, 2026 09:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 17 changed files in this pull request and generated 4 comments.

Comment thread src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs
Comment thread src/Stryker.Solutions/SolutionFile.cs Outdated
Comment thread src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs
Copilot AI review requested due to automatic review settings March 31, 2026 12:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 3 comments.

Comment thread src/Stryker.Core/Stryker.Core/Initialisation/MutableProjectTree.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/ProjectAnalyzerContext.cs Outdated
Copilot AI review requested due to automatic review settings March 31, 2026 21:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 7 comments.

Comment thread src/Stryker.Core/Stryker.Core/Initialisation/TargetsForMutation.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/TargetsForMutation.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/ProjectAnalyzerContext.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/MutableProjectTarget.cs Outdated
Comment thread src/Stryker.Solutions/SolutionFile.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/ProjectAnalyzerContext.cs Outdated
Comment thread src/Stryker.Solutions/SolutionFile.cs Outdated
Copilot AI review requested due to automatic review settings April 1, 2026 05:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.

Comment thread src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/TargetsForMutation.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 46 out of 46 changed files in this pull request and generated 5 comments.

Comment thread src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs Outdated
Comment thread src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Compiling/CSharpRollbackProcess.cs Outdated
Comment thread src/Stryker.Utilities/Buildalyzer/Buildalyzer.cs
Comment thread src/Stryker.Utilities/Buildalyzer/Buildalyzer.cs
dupdob added 3 commits June 5, 2026 22:49
# 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
Copilot AI review requested due to automatic review settings June 7, 2026 21:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated 10 comments.

Comment thread src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs Outdated
Comment thread src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs Outdated
Comment thread src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs Outdated
Comment thread src/Stryker.Solutions/packages.lock.json
Comment thread src/Stryker.Solutions/packages.lock.json
Comment thread src/Stryker.Solutions/packages.lock.json
Comment thread src/Stryker.Solutions.Test/packages.lock.json
Comment thread src/Stryker.Solutions.Test/packages.lock.json
Comment thread src/Stryker.Solutions.Test/packages.lock.json
Comment thread src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs
Copilot AI review requested due to automatic review settings June 8, 2026 12:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 48 out of 48 changed files in this pull request and generated 5 comments.

Comment thread src/Stryker.Solutions/SolutionFile.cs Outdated
Comment thread src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Compiling/CSharpRollbackProcess.cs Outdated
@dupdob dupdob marked this pull request as ready for review June 8, 2026 13:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated 1 comment.

Comment thread src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs
dupdob added 2 commits June 16, 2026 08:16
# 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated 4 comments.

Comment thread src/Stryker.Core/Stryker.Core/Initialisation/ProjectsTracker.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated 1 comment.

Comment thread src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated 4 comments.

Comment thread src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs
Comment thread src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/ProjectsTracker.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core/Initialisation/ProjectsTracker.cs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated 3 comments.

Comment thread src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs
Comment thread src/Stryker.Core/Stryker.Core.UnitTest/StrykerRunnerTests.cs Outdated
Comment thread src/Stryker.Core/Stryker.Core.UnitTest/StrykerRunnerTests.cs Outdated
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Initialization projects identification and analysis Feat: Solution run Priority: Medium Issues that have a workaround or but should be fixed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project Analysis fails on a project using MTP

2 participants