Skip to content

Reorganize compatibility test projects under test/Compatibility - #55240

Merged
MichaelSimons merged 1 commit into
mainfrom
michaelsimons-reorg-compat-tests
Jul 21, 2026
Merged

MichaelSimons merged 1 commit into
mainfrom
michaelsimons-reorg-compat-tests

Conversation

@MichaelSimons

Copy link
Copy Markdown
Member

Summary

Groups the compatibility test projects into a dedicated test/Compatibility/ folder that mirrors the existing src/Compatibility/ layout, as a step toward cleaning up the very wide flat top-level test/ directory and giving these tests a clearer, more maintainable home.

Projects are nested by tool to match source: ApiCompat/, ApiDiff/, GenAPI/, with Microsoft.DotNet.ApiSymbolExtensions.Tests at the Compatibility top level (matching where it sits under src).

Motivation

  • The top-level test/ directory has grown very wide (many sibling test assemblies); grouping related projects into subfolders makes it easier to navigate and reason about ownership.
  • Mirroring src/Compatibility/ keeps source and tests structurally aligned.
  • Supports Reduce PR validation time by conditionally filtering tests based on changed files #55203 (conditional PR test filtering): with the projects under one folder, the compatibility test scope can be matched by a single robust test/Compatibility/** glob instead of fragile per-project name patterns that silently miss newly added projects.

Changes

  • Moved the 9 compatibility test projects into test/Compatibility/{ApiCompat,ApiDiff,GenAPI} (+ ApiSymbolExtensions.Tests at top level).
  • Converted cross-project references to $(RepoRoot)test\Compatibility\... for location independence.
  • Updated sdk.slnx, the compatibility solution filters, and test/UnitTests.proj.
  • Consolidated the compat CODEOWNERS entries to /src/Compatibility/ and /test/Compatibility/.
  • Pure move + reference updates — no test logic changes.

Validation

  • build.cmd -projects src\Compatibility\compatibility.slnf — build succeeded; all 9 test projects compile.

Copilot AI review requested due to automatic review settings July 10, 2026 17:13
@MichaelSimons
MichaelSimons requested a review from a team as a code owner July 10, 2026 17:13

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

This PR reorganizes the compatibility-related test projects into a dedicated test/Compatibility/ folder structure that mirrors src/Compatibility/, and updates solution/test orchestration files to reference the new locations. This supports cleaner repo navigation and enables robust path-based test scoping (e.g., test/Compatibility/**) for conditional PR test filtering (#55203).

Changes:

  • Moved the compatibility test projects under test/Compatibility/{ApiCompat,ApiDiff,GenAPI} (with Microsoft.DotNet.ApiSymbolExtensions.Tests at test/Compatibility/).
  • Updated cross-project references and compile-includes to use $(RepoRoot) paths for location independence.
  • Updated sdk.slnx, compatibility *.slnf filters, test/UnitTests.proj, and CODEOWNERS to match the new layout.

Reviewed changes

Copilot reviewed 15 out of 97 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/UnitTests.proj Updates custom test project paths to the new test/Compatibility/... locations.
test/Compatibility/Microsoft.DotNet.ApiSymbolExtensions.Tests/Microsoft.DotNet.ApiSymbolExtensions.Tests.csproj Updates ProjectReference to use $(RepoRoot) for the MSTest framework project.
test/Compatibility/Microsoft.DotNet.ApiSymbolExtensions.Tests/TestLog.cs Relocated test logging helper under test/Compatibility.
test/Compatibility/Microsoft.DotNet.ApiSymbolExtensions.Tests/TempDirectory.cs Relocated temp directory helper under test/Compatibility.
test/Compatibility/Microsoft.DotNet.ApiSymbolExtensions.Tests/SymbolFilterFactoryTests.cs Relocated ApiSymbolExtensions tests under test/Compatibility.
test/Compatibility/Microsoft.DotNet.ApiSymbolExtensions.Tests/SymbolFactory.cs Relocated Roslyn compilation helper for tests under test/Compatibility.
test/Compatibility/GenAPI/Microsoft.DotNet.GenAPI.Tests/Microsoft.DotNet.GenAPI.Tests.csproj Adds/relocates GenAPI unit test project under test/Compatibility/GenAPI.
test/Compatibility/GenAPI/Microsoft.DotNet.GenAPI.Tests/TestAssemblyLoaderFactory.cs Relocated helper used to build/load assemblies for GenAPI-related tests.
test/Compatibility/GenAPI/Microsoft.DotNet.GenAPI.Tests/TempDirectory.cs Relocated temp directory helper used by GenAPI tests.
test/Compatibility/GenAPI/Microsoft.DotNet.GenAPI.Tests/SymbolFactory.cs Relocated Roslyn compilation helper used by GenAPI tests.
test/Compatibility/GenAPI/Microsoft.DotNet.GenAPI.Tests/SyntaxRewriter/CSharpSyntaxRewriterTestBase.cs Relocated GenAPI syntax rewriter test base.
test/Compatibility/GenAPI/Microsoft.DotNet.GenAPI.Tests/SyntaxRewriter/BodyBlockCSharpSyntaxRewriterTests.cs Relocated GenAPI syntax rewriter tests.
test/Compatibility/GenAPI/Microsoft.DotNet.GenAPI.Tests/SyntaxRewriter/SingleLineStatementCSharpSyntaxRewriterTests.cs Relocated GenAPI syntax rewriter tests.
test/Compatibility/GenAPI/Microsoft.DotNet.GenAPI.Tests/SyntaxRewriter/TypeDeclarationCSharpSyntaxRewriterTests.cs Relocated GenAPI syntax rewriter tests.
test/Compatibility/GenAPI/Microsoft.DotNet.GenAPI.IntegrationTests/Microsoft.DotNet.GenAPI.IntegrationTests.csproj Updates ProjectReference to MSTest framework project via $(RepoRoot) after move.
test/Compatibility/GenAPI/Microsoft.DotNet.GenAPI.IntegrationTests/ToolPaths.cs Relocated tool path resolution helper for GenAPI integration tests.
test/Compatibility/GenAPI/Microsoft.DotNet.GenAPI.IntegrationTests/Tool/GenAPIToolIntegrationTests.cs Relocated GenAPI tool end-to-end integration tests.
test/Compatibility/GenAPI/Microsoft.DotNet.GenAPI.IntegrationTests/Task/GenAPITaskIntegrationTests.cs Relocated GenAPI task end-to-end integration tests.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tests/Microsoft.DotNet.ApiDiff.Tests.csproj Updates compile-includes to point at relocated shared test helpers under test/Compatibility.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tests/Diff.Base.Tests.cs Relocated ApiDiff base test harness under test/Compatibility/ApiDiff.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tests/Diff.Assembly.Tests.cs Relocated ApiDiff assembly-level tests.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tests/Diff.Class.Tests.cs Relocated ApiDiff class diff tests.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tests/Diff.Constructor.Tests.cs Relocated ApiDiff constructor diff tests.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tests/Diff.Delegate.Tests.cs Relocated ApiDiff delegate diff tests.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tests/Diff.Destructor.Tests.cs Relocated ApiDiff destructor diff tests.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tests/Diff.Event.Tests.cs Relocated ApiDiff event diff tests.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tests/Diff.Field.Tests.cs Relocated ApiDiff field diff tests.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tests/Diff.Interface.Tests.cs Relocated ApiDiff interface diff tests.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tests/Diff.Method.Tests.cs Relocated ApiDiff method diff tests.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tests/Diff.Record.Tests.cs Relocated ApiDiff record diff tests.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tests/Diff.Struct.Tests.cs Relocated ApiDiff struct diff tests.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.IntegrationTests/Microsoft.DotNet.ApiDiff.IntegrationTests.csproj Updates ProjectReference to MSTest framework project via $(RepoRoot) after move.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.IntegrationTests/ToolPaths.cs Relocated ApiDiff tool path resolution helper.
test/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.IntegrationTests/Tool/ApiDiffToolIntegrationTests.cs Relocated ApiDiff tool end-to-end integration tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Microsoft.DotNet.ApiCompatibility.Tests.csproj Updates compile-includes and MSTest framework reference to $(RepoRoot) paths after move.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/CompatDifferenceTests.cs Relocated ApiCompatibility unit tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/CustomSideNameTests.cs Relocated ApiCompatibility unit tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/SuppressibleTestLog.cs Relocated shared suppressible log helper.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/SymbolFactoryExtensions.cs Relocated shared SymbolFactory extensions used across ApiCompat tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/TestRuleFactory.cs Relocated helper rule factory for tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/TheoryData.cs Relocated helper TheoryData type for DynamicData scenarios.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Mapping/AssemblyMapperTests.cs Relocated mapping tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Mapping/AssemblySetMapperTests.cs Relocated mapping tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Mapping/MemberMapperTests.cs Relocated mapping tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Mapping/NamespaceMapperTests.cs Relocated mapping tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Mapping/TypeMapperTests.cs Relocated mapping tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Runner/ApiCompatOptionsTests.cs Relocated runner tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Runner/ApiCompatRunnerTests.cs Relocated runner tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Runner/ApiCompatWorkItemTests.cs Relocated runner tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Rules/CannotAddMemberToInterfaceTests.cs Relocated rule tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Rules/CannotChangeGenericConstraintsTests.cs Relocated rule tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Rules/EnumsMustMatchTests.cs Relocated rule tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Rules/ParameterNamesCannotChangeTests.cs Relocated rule tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Logging/EmptyTestSuppressionEngine.cs Relocated logging/suppression test helpers.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Logging/SuppressionTests.cs Relocated logging/suppression tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility.Tests/Logging/TestSuppressionEngine.cs Relocated logging/suppression test helpers.
test/Compatibility/ApiCompat/Microsoft.DotNet.PackageValidation.Tests/Microsoft.DotNet.PackageValidation.Tests.csproj Updates shared compile-includes and MSTest framework reference to $(RepoRoot) paths after move.
test/Compatibility/ApiCompat/Microsoft.DotNet.PackageValidation.Tests/CompatibleFrameworkInPackageValidatorTests.cs Relocated package validation tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.PackageValidation.Tests/Filtering/TargetFrameworkFilterTests.cs Relocated package validation filter tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.PackageValidation.Tests/Validators/BaselinePackageValidatorTests.cs Relocated package validation validator tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.PackageValidation.Tests/Validators/CompatibleTFMValidatorTests.cs Relocated package validation validator tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompat.Tests/Microsoft.DotNet.ApiCompat.Tests.csproj Adds/relocates ApiCompat unit test project under test/Compatibility/ApiCompat.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompat.Tests/RegexStringTransformerTests.cs Relocated ApiCompat unit tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompat.IntegrationTests/Microsoft.DotNet.ApiCompat.IntegrationTests.csproj Updates MSTest framework ProjectReference to $(RepoRoot) after move.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompat.IntegrationTests/ToolPaths.cs Relocated ApiCompat tool path resolution helper.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompat.IntegrationTests/Tool/ApiCompatToolIntegrationTests.cs Relocated ApiCompat tool end-to-end integration tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompat.IntegrationTests/Task/ValidateAssembliesTargetIntegrationTests.cs Relocated ApiCompat task integration tests.
test/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompat.IntegrationTests/Task/ValidatePackageTargetIntegrationTests.cs Relocated ApiCompat task integration tests.
src/Tasks/Microsoft.NET.slnf Updates solution filter project paths for moved compatibility test projects.
src/Compatibility/compatibility.slnf Updates compatibility solution filter paths to the new test locations.
src/Compatibility/ApiCompat/apicompat.slnf Updates ApiCompat solution filter to point at relocated tests.
src/Compatibility/ApiDiff/apidiff.slnf Updates ApiDiff solution filter to point at relocated tests.
src/Compatibility/GenAPI/genapi.slnf Updates GenAPI solution filter to point at relocated tests.
sdk.slnx Updates solution folder/project structure under /test/Compatibility to reflect new layout.
CODEOWNERS Consolidates compatibility ownership to /src/Compatibility/ and /test/Compatibility/.

@MichaelSimons
MichaelSimons force-pushed the michaelsimons-reorg-compat-tests branch from c81381a to 62bac03 Compare July 10, 2026 17:23
Reorganize the compatibility test projects to mirror the src/Compatibility
layout, nesting them under test/Compatibility/{ApiCompat,ApiDiff,GenAPI} (with
ApiSymbolExtensions.Tests at the Compatibility top level, matching src). This
groups the compat tests together, reduces the width of the flat test/ directory,
and makes ownership and test-filtering globs robust to newly added projects.

Cross-project references are converted to $(RepoRoot)test\Compatibility\... form
for location independence. Solution (sdk.slnx), solution filters,
test/UnitTests.proj, and CODEOWNERS are updated to the new paths; the compat
CODEOWNERS entries are consolidated to /src/Compatibility/ and /test/Compatibility/.

Co-authored-by: Copilot App <[email protected]>
@MichaelSimons
MichaelSimons force-pushed the michaelsimons-reorg-compat-tests branch from 62bac03 to 81ad5d0 Compare July 20, 2026 16:31
@MichaelSimons

Copy link
Copy Markdown
Member Author

Gentle ping @dotnet/area-infrastructure-libraries for review. TIA

@jeffhandley jeffhandley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Bravo. Thanks for the ping on this, @MichaelSimons!

@MichaelSimons
MichaelSimons merged commit 90a1ecd into main Jul 21, 2026
29 checks passed
@MichaelSimons
MichaelSimons deleted the michaelsimons-reorg-compat-tests branch July 21, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants