Skip to content

Commit 141e605

Browse files
EvangelinkCopilot
andauthored
Reorganize src into MTP, MSTest, and Polyfills folders (#12533)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 0e4f08f commit 141e605

2,784 files changed

Lines changed: 1734 additions & 1727 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/agents/expert-reviewer.agent.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ files outside the specialist workflow's scope.
495495

496496
**Severity: MAJOR**
497497

498-
Applies only to changes in `src/Analyzers/`.
498+
Applies only to changes in `src/MSTest/MSTest.Analyzers*/`, `src/MSTest/MSTest.GlobalConfigsGenerator/`, `src/MSTest/MSTest.SourceGeneration/`, and their shared analyzer sources in `src/MSTest/Shared/`.
499499

500500
**Rules:**
501501
1. Analyzers must not throw or crash on any syntactically valid input.
@@ -543,7 +543,7 @@ Applies only to changes in `src/Analyzers/`.
543543

544544
**Severity: MAJOR**
545545

546-
Applies to changes in `src/Platform/` involving serialization/deserialization.
546+
Applies to changes in `src/MTP/` involving serialization/deserialization.
547547

548548
**Rules:**
549549
1. Changes to serialized types must not break wire compatibility with older clients.
@@ -698,8 +698,8 @@ Applies to changes in `eng/**/*.ps1`, `.github/scripts/**/*.ps1`, and any `*.ps1
698698
| 2 | **No `init` on Public API** | New public API MUST NOT use `init` accessors. Existing MTP `init` accessors are grandfathered. | `.github/copilot-instructions.md` |
699699
| 3 | **Localization** | `.resx` for user-facing strings. Never edit `.xlf` — build generates them. `{Locked="…"}` is a substring match: prefer bare invariant tokens and add punctuation only to prevent collisions (`'const'` when the message also contains `constant`). | `src/*/Strings.resx` |
700700
| 4 | **Test Architecture** | MSTest unit tests use `TestFramework.ForTestingMSTest`. MTP/analyzer tests use MSTest. Follow test project's assertion library policy (check `BannedSymbols.txt`). | `test/Utilities/TestFramework.ForTestingMSTest` |
701-
| 5 | **IPC Protocol** | Named pipes, JSON-RPC between test platform and runners. Wire format backward-compatible. | `src/Platform/` |
702-
| 6 | **Analyzer IDs** | `MSTEST0001`+ for MSTest analyzers. Unique across codebase. | `src/Analyzers/` |
701+
| 5 | **IPC Protocol** | Named pipes, JSON-RPC between test platform and runners. Wire format backward-compatible. | `src/MTP/` |
702+
| 6 | **Analyzer IDs** | `MSTEST0001`+ for MSTest analyzers. Unique across codebase. | `src/MSTest/MSTest.Analyzers/` |
703703
| 7 | **Multi-TFM Targeting** | Derive actual targets and language versions from owning projects/imports and linked consumers; verify polyfills per compiled path. | Project files, `Directory.Build.*`, `src/Polyfills/` |
704704
| 8 | **Arcade Build System** | `build.cmd`/`build.sh`. `eng/build.ps1` with `-build`, `-test`, `-integrationTest`, `-pack`. | `eng/build.ps1` |
705705
| 9 | **Acceptance Tests** | Must run `./build.sh -pack` before running acceptance tests. | `.github/copilot-instructions.md` |
@@ -745,12 +745,12 @@ Use this to prioritize dimensions based on changed files.
745745

746746
| Folder | Priority Dimensions | Hot Files |
747747
|--------|---------------------|-----------|
748-
| `src/Platform/` | Threading, Performance, IPC Wire, Security, API Surface | Message pipeline, server/client, serialization |
749-
| `src/TestFramework/` | API Compat, Correctness, Performance, Cross-TFM | Assert classes, attributes, test lifecycle |
750-
| `src/Adapter/` | Correctness, Threading, Resource Mgmt, Defensive Coding | VSTest bridge, discovery, execution |
751-
| `src/Analyzers/` | Analyzer Quality, Correctness, API Surface | Analyzer/code-fix implementations |
748+
| `src/MTP/` | Threading, Performance, IPC Wire, Security, API Surface | Message pipeline, server/client, serialization |
749+
| `src/MSTest/TestFramework*/` | API Compat, Correctness, Performance, Cross-TFM | Assert classes, attributes, test lifecycle |
750+
| `src/MSTest/MSTest.TestAdapter/`, `src/MSTest/MSTestAdapter.PlatformServices/`, `src/MSTest/MSTest.Extensions.Hosting/` | Correctness, Threading, Resource Mgmt, Defensive Coding | VSTest bridge, discovery, execution |
751+
| `src/MSTest/MSTest.Analyzers*/` | Analyzer Quality, Correctness, API Surface | Analyzer/code-fix implementations |
752752
| `src/Polyfills/` | Cross-TFM, Correctness | Polyfill implementations |
753-
| `src/Package/` | Build Infrastructure, Compatibility, **MSBuild Authoring** | NuGet packaging definitions, `build/`, `buildTransitive/`, `buildMultiTargeting/` |
753+
| `src/MSTest/MSTest/`, `src/MSTest/MSTest.Sdk/` | Build Infrastructure, Compatibility, **MSBuild Authoring** | NuGet packaging definitions, `build/`, `buildTransitive/`, `buildMultiTargeting/` |
754754
| `test/UnitTests/` | Test Isolation, Assertions, Flakiness, Data-Driven | All test files |
755755
| `test/IntegrationTests/` | Flakiness, Resource Mgmt, Test Isolation | Acceptance tests |
756756
| `eng/` | Build Infrastructure, Dependencies, **MSBuild Authoring**, **PowerShell Scripting Hygiene** | `Versions.props`, build scripts, shared `.props`/`.targets` |
@@ -1067,7 +1067,7 @@ If the PR only changes `.md`, `.txt`, `.resx`, `.xlf`, or other non-code files,
10671067
### Large PRs (> 15 files)
10681068

10691069
- Focus on `src/` changes over `test/` changes.
1070-
- Prioritize files in `Platform/` and `TestFramework/` (runtime code) over `Analyzers/` (design-time).
1070+
- Prioritize files in `src/MTP/` and `src/MSTest/TestFramework/` (runtime code) over `src/MSTest/MSTest.Analyzers*/` (design-time).
10711071
- Flag if the PR is too large to review effectively.
10721072

10731073
### PRs with no test files

‎.github/copilot-instructions.md‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ This is a .NET based repository that contains the MSTest testing framework and M
66

77
The codebase ships several distinct (but related) products. Knowing which product a change belongs to is essential because they have different conventions, target frameworks, and public API surfaces:
88

9-
- `src/Platform/Microsoft.Testing.Platform` — Microsoft.Testing.Platform (MTP), a lightweight, in-process test host that replaces VSTest. Most other folders under `src/Platform/` are MTP extensions (`TrxReport`, `CrashDump`, `HangDump`, `HotReload`, `Retry`, `Telemetry`, `HtmlReport`, `AzureDevOpsReport`, `MSBuild`, `VSTestBridge`, …).
10-
- `src/TestFramework` — MSTest itself: the public `Microsoft.VisualStudio.TestTools.UnitTesting` API (attributes, `Assert`, `TestContext`, …) plus `TestFramework.Extensions`.
11-
- `src/Adapter` — bridges MSTest to test hosts: `MSTest.TestAdapter` (VSTest adapter) and `MSTestAdapter.PlatformServices` (platform-services abstraction shared by both hosts).
12-
- `src/Analyzers` — Roslyn analyzers and code fixes shipped as `MSTest.Analyzers`.
13-
- `src/Package/MSTest.Sdk` — the MSBuild project SDK that wires the pieces together for consumers.
9+
The only source subfolders are `MTP`, `MSTest`, and `Polyfills`. MSTest projects sit directly under `src/MSTest`, without adapter, analyzer, framework, or package grouping folders. `Shared`, `PlatformPackage`, and `APIHistory` hold shared sources, packaging support, and archived API records; `Polyfills` contains compatibility sources shared across both products.
10+
11+
- `src/MTP/Microsoft.Testing.Platform` — Microsoft.Testing.Platform (MTP), a lightweight, in-process test host that replaces VSTest. Most other folders under `src/MTP/` are MTP extensions (`TrxReport`, `CrashDump`, `HangDump`, `HotReload`, `Retry`, `Telemetry`, `HtmlReport`, `AzureDevOpsReport`, `MSBuild`, `VSTestBridge`, …).
12+
- `src/MSTest/TestFramework` — MSTest itself: the public `Microsoft.VisualStudio.TestTools.UnitTesting` API (attributes, `Assert`, `TestContext`, …). The sibling `TestFramework.Compatibility` project provides the `TestFramework.Extensions` compatibility facade.
13+
- `src/MSTest/MSTest.TestAdapter` and `src/MSTest/MSTestAdapter.PlatformServices` — bridge MSTest to test hosts (the VSTest adapter and platform-services abstraction shared by both hosts).
14+
- `src/MSTest/MSTest.Analyzers*` — Roslyn analyzers and code fixes shipped as `MSTest.Analyzers`.
15+
- `src/MSTest/MSTest.Sdk` — the MSBuild project SDK that wires the pieces together for consumers.
1416
- `test/UnitTests/<Project>.UnitTests` — fast unit tests for each project.
1517
- `test/IntegrationTests/<Project>.IntegrationTests` or `<Package>.Acceptance.IntegrationTests` — file-system / process-level tests; acceptance tests consume the packed NuGets from `artifacts/packages/<Configuration>/Shipping`.
1618
- `test/Utilities/TestFramework.ForTestingMSTest` — the internal `TestContainer`-based framework used to unit-test MSTest itself (any public parameterless method on a `TestContainer` subclass is a test; no `[TestMethod]` needed).
@@ -91,7 +93,7 @@ You MUST minimize adding public API surface area but any newly added public API
9193

9294
Every packable project must carry the metadata that nuget.org renders on the package page. This is enforced at pack time by the `_ValidatePackageMetadata` target in the root [`Directory.Build.targets`](../Directory.Build.targets), which fails the build when a packable project is missing either piece — including packages that are `IsShipping=false`, because those still reach nuget.org.
9395

94-
- Write `<PackageDescription>` so it **leads with what the package does**, and close it with `$(CommonProductDescription)` — the shared product sentence, defaulted per product area in [`src/Directory.Build.props`](../src/Directory.Build.props) (MSTest) and [`src/Platform/Directory.Build.props`](../src/Platform/Directory.Build.props) (Microsoft.Testing.Platform). nuget.org truncates the description in search results, so the package-specific sentence has to come first.
96+
- Write `<PackageDescription>` so it **leads with what the package does**, and close it with `$(CommonProductDescription)` — the shared product sentence, defaulted per product area in [`src/Directory.Build.props`](../src/Directory.Build.props) (MSTest) and [`src/MTP/Directory.Build.props`](../src/MTP/Directory.Build.props) (Microsoft.Testing.Platform). nuget.org truncates the description in search results, so the package-specific sentence has to come first.
9597
- Wrap the value in `<![CDATA[ ... ]]>` and keep its continuation lines unindented. MSBuild trims a property value but not the indentation of its inner lines, so an indented multi-line description leaks the .csproj whitespace into the published text. Property references such as `$(CommonProductDescription)` are still expanded inside CDATA.
9698
- NEVER leave the description unset. NuGet's pack targets substitute the literal placeholder `Package Description` during evaluation, which is why Arcade's own "PackageDescription must be specified" check cannot catch it and why the repo-level guard exists.
9799
- Add a `PACKAGE.md` next to the project file. It is picked up automatically as `PackageReadmeFile` and packed into the root of the `.nupkg`.
@@ -101,7 +103,7 @@ Every packable project must carry the metadata that nuget.org renders on the pac
101103
When making change to resource files, you MUST:
102104

103105
- Add a corresponding entry in the resource file (`.resx`).
104-
- NEVER manually modify `*.xlf` files. Instead, regenerate them by running `dotnet msbuild <project>.csproj /t:UpdateXlf` on the owning project (e.g. `src/Platform/Microsoft.Testing.Platform/Microsoft.Testing.Platform.csproj`, `src/TestFramework/TestFramework/TestFramework.csproj`, or the matching analyzer project). A full repo build also regenerates them but is slower.
106+
- NEVER manually modify `*.xlf` files. Instead, regenerate them by running `dotnet msbuild <project>.csproj /t:UpdateXlf` on the owning project (e.g. `src/MTP/Microsoft.Testing.Platform/Microsoft.Testing.Platform.csproj`, `src/MSTest/TestFramework/TestFramework.csproj`, or the matching analyzer project). A full repo build also regenerates them but is slower.
105107
- A few resource accessors are hand-maintained — notably `PlatformResources.cs` has an `IS_MTP_UNIT_TESTS` block that must be updated when a unit test needs to read a newly added string.
106108
- `{Locked="…"}` markers in a resource `<comment>` are matched as **substrings, not whole words**. A short locked token therefore also freezes every longer word that contains it, which blocks a legitimately translatable word. For example, `{Locked="const"}` on a message that also contains the English word *constant* locks `const` inside `constant`, so translators cannot localize it. Make each locked token unambiguous:
107109
- Every locked token MUST occur verbatim in the corresponding `<value>`. Do not lock an option name or other contextual identifier that the user-facing string does not actually contain.

‎.github/scripts/scan-duplicates.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
2525
.EXAMPLE
2626
.\.github\scripts\scan-duplicates.ps1
27-
.\.github\scripts\scan-duplicates.ps1 -Path "src/Platform/Microsoft.Testing.Platform" -MinLines 10
27+
.\.github\scripts\scan-duplicates.ps1 -Path "src/MTP/Microsoft.Testing.Platform" -MinLines 10
2828
.\.github\scripts\scan-duplicates.ps1 -TopN 20
2929
#>
3030
param(

‎.github/scripts/test_buildxl_pipeline.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def test_unit_test_runner_rejects_build_output_narrower_than_the_workload(self)
473473
capture_output=True, text=True, check=True,
474474
).stdout.strip()
475475
cases = {
476-
"project": ("src\\TestFramework\\TestFramework\\TestFramework.csproj", "Project defaults"),
476+
"project": ("src\\MSTest\\TestFramework\\TestFramework.csproj", "Project defaults"),
477477
"framework": ("TestFx.slnx", "netstandard2.0"),
478478
}
479479
for case, (project, framework) in cases.items():
@@ -1125,7 +1125,7 @@ def normalized(element: ET.Element | None, attribute: str) -> str:
11251125

11261126
overrides = ET.parse(ROOT / "eng" / "buildxl" / "pack.targets").getroot()
11271127
analyzers = ET.parse(
1128-
ROOT / "src" / "Analyzers" / "MSTest.Analyzers.Package" / "MSTest.Analyzers.Package.csproj"
1128+
ROOT / "src" / "MSTest" / "MSTest.Analyzers.Package" / "MSTest.Analyzers.Package.csproj"
11291129
).getroot()
11301130
product = analyzers.find("Target[@Name='_GenerateGlobalConfigs']/Exec")
11311131
override = overrides.find("Target[@Name='_GenerateGlobalConfigs']")
@@ -1142,23 +1142,23 @@ def normalized(element: ET.Element | None, attribute: str) -> str:
11421142
generator.text,
11431143
)
11441144
generator_project = ET.parse(
1145-
ROOT / "src" / "Analyzers" / "MSTest.GlobalConfigsGenerator" / "MSTest.GlobalConfigsGenerator.csproj"
1145+
ROOT / "src" / "MSTest" / "MSTest.GlobalConfigsGenerator" / "MSTest.GlobalConfigsGenerator.csproj"
11461146
).getroot()
11471147
self.assertEqual("$(NetCurrent)", generator_project.findtext("PropertyGroup/TargetFramework"))
11481148
solution = ET.parse(ROOT / "TestFx.slnx").getroot()
11491149
self.assertEqual(
1150-
["src/Analyzers/MSTest.GlobalConfigsGenerator/MSTest.GlobalConfigsGenerator.csproj"],
1150+
["src/MSTest/MSTest.GlobalConfigsGenerator/MSTest.GlobalConfigsGenerator.csproj"],
11511151
[
11521152
dependency.get("Project")
11531153
for dependency in solution.findall(
1154-
".//Project[@Path='src/Analyzers/MSTest.Analyzers.Package/MSTest.Analyzers.Package.csproj']"
1154+
".//Project[@Path='src/MSTest/MSTest.Analyzers.Package/MSTest.Analyzers.Package.csproj']"
11551155
"/BuildDependency"
11561156
)
11571157
],
11581158
)
11591159

11601160
packaged_app = ET.parse(
1161-
ROOT / "src" / "Platform" / "Microsoft.Testing.Extensions.PackagedApp.MSBuild"
1161+
ROOT / "src" / "MTP" / "Microsoft.Testing.Extensions.PackagedApp.MSBuild"
11621162
/ "Microsoft.Testing.Extensions.PackagedApp.MSBuild.csproj"
11631163
).getroot()
11641164
product = packaged_app.find("Target[@Name='_AddPackagedAppControllerToPackage']")

‎.github/scripts/test_mutation_testing.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,20 @@ def test_repository_manifest_onboards_every_mtp_extension(self) -> None:
9090
for target in target_manifest["modules"]
9191
if target["enabled"]
9292
and target["project"].startswith(
93-
"src/Platform/Microsoft.Testing.Extensions."
93+
"src/MTP/Microsoft.Testing.Extensions."
9494
)
9595
}
9696
extension_projects = {
9797
project.relative_to(REPOSITORY_ROOT).as_posix()
9898
for project in REPOSITORY_ROOT.glob(
99-
"src/Platform/Microsoft.Testing.Extensions.*/*.csproj"
99+
"src/MTP/Microsoft.Testing.Extensions.*/*.csproj"
100100
)
101101
}
102102
excluded_projects = {
103103
excluded["project"]
104104
for excluded in target_manifest.get("excludedProjects", [])
105105
if excluded["project"].startswith(
106-
"src/Platform/Microsoft.Testing.Extensions."
106+
"src/MTP/Microsoft.Testing.Extensions."
107107
)
108108
}
109109

@@ -316,7 +316,7 @@ def test_mutation_build_uses_module_target_framework(self) -> None:
316316
def test_mutation_build_retains_mstest_analyzers_from_source(self) -> None:
317317
project = ET.parse(REPOSITORY_ROOT / "test" / "Directory.Build.targets").getroot()
318318
analyzer_project = (
319-
"$(RepoRoot)src\\Analyzers\\MSTest.Analyzers\\MSTest.Analyzers.csproj"
319+
"$(RepoRoot)src\\MSTest\\MSTest.Analyzers\\MSTest.Analyzers.csproj"
320320
)
321321
references = [
322322
reference.attrib

‎.github/skills/code-review/SKILL.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ tests to understand the changed behavior before commenting.
1616
## Review process
1717

1818
1. Identify the product area from the changed paths:
19-
- `src/Platform` and related tests: Microsoft.Testing.Platform and extensions.
20-
- `src/TestFramework`: the public MSTest framework API.
21-
- `src/Adapter`: MSTest adapters and platform services.
22-
- `src/Analyzers`: Roslyn analyzers and code fixes.
23-
- `src/Package/MSTest.Sdk`, `eng`, and MSBuild files: build and packaging.
19+
- `src/MTP` and related tests: Microsoft.Testing.Platform and extensions.
20+
- `src/MSTest/TestFramework`: the public MSTest framework API.
21+
- `src/MSTest/MSTest.TestAdapter` and `src/MSTest/MSTestAdapter.PlatformServices`: MSTest adapters and platform services.
22+
- `src/MSTest/MSTest.Analyzers*`: Roslyn analyzers and code fixes.
23+
- `src/MSTest/MSTest.Sdk`, `eng`, and MSBuild files: build and packaging.
2424
2. Trace each behavior change through its callers, tests, target frameworks,
2525
shipped packages, and linked source files. Apply the context checks below
2626
before treating a checklist match as a finding.

‎.github/skills/post-release-activities/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Open a PR to the main branch to update the product versions of public samples to
5555
### Step 8: Mark APIs and analyzers as shipped
5656

5757
1. Run `eng/mark-shipped.ps1` (requires PowerShell 7.0).
58-
2. Move the contents of `src/Analyzers/MSTest.Analyzers/AnalyzerReleases.Unshipped.md` (except the first two lines that start with `;`) to `src/Analyzers/MSTest.Analyzers/AnalyzerReleases.Shipped.md`.
59-
3. In `src/Analyzers/MSTest.Analyzers/SuppressionReleases.md`, move the rows for suppressors shipped in the release branch from `## Unshipped` to `## Release {version}` (using the full MSTest version found in Step 1). Create the release section with the existing table format if it does not exist, preserving each suppression ID, suppressed diagnostic ID, and notes. Leave suppressors not included in this release under `## Unshipped`, and remove that section if it becomes empty. If no suppressors were shipped from `## Unshipped`, leave the catalog unchanged.
58+
2. Move the contents of `src/MSTest/MSTest.Analyzers/AnalyzerReleases.Unshipped.md` (except the first two lines that start with `;`) to `src/MSTest/MSTest.Analyzers/AnalyzerReleases.Shipped.md`.
59+
3. In `src/MSTest/MSTest.Analyzers/SuppressionReleases.md`, move the rows for suppressors shipped in the release branch from `## Unshipped` to `## Release {version}` (using the full MSTest version found in Step 1). Create the release section with the existing table format if it does not exist, preserving each suppression ID, suppressed diagnostic ID, and notes. Leave suppressors not included in this release under `## Unshipped`, and remove that section if it becomes empty. If no suppressors were shipped from `## Unshipped`, leave the catalog unchanged.
6060

6161
Create a PR to main with these changes.

‎.github/skills/testfx-localization-validation/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ repository SDK initialized by the build scripts. For example, on Windows:
101101

102102
```powershell
103103
.\build.cmd
104-
.\.dotnet\dotnet.exe msbuild src\Platform\Microsoft.Testing.Platform\Microsoft.Testing.Platform.csproj /t:UpdateXlf -bl:artifacts\log\localization-update.binlog
104+
.\.dotnet\dotnet.exe msbuild src\MTP\Microsoft.Testing.Platform\Microsoft.Testing.Platform.csproj /t:UpdateXlf -bl:artifacts\log\localization-update.binlog
105105
python .github\scripts\check_localization.py
106106
```
107107

0 commit comments

Comments
 (0)