Skip to content

Backport metadata-first fixture discovery to rel/4.5 - #12291

Merged
Amaury Levé (Evangelink) merged 1 commit into
rel/4.5from
evangelink-rel-4-5-fixture-discovery
Nov 9, 2026
Merged

Amaury Levé (Evangelink) merged 1 commit into
rel/4.5from
evangelink-rel-4-5-fixture-discovery

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Backports metadata-first assembly fixture provider discovery from #12269 to rel/4.5. Relates to #12287: this independently squashable PR contains only its fixture-discovery slice, not its Retry, cleanup, or IPC changes.

Inspect PE metadata before loading unmarked dependencies, while preserving runtime binding/load-context authority, passive/transitive providers, diagnosed fallback, local-hook precedence, and duplicate-provider diagnostics. Retains the release's targets and public/shipped API baselines, with explicit System.Reflection.Metadata 8.0.0 dependency wiring.

Provenance

  • Upstream: 127798de9bd5c3f7204dc8932cddf043bf4bd6c6.
  • Exact split-source commit: 039c61b6c880b7a54b9bafb5cf9c6d67ab7005d0 from Backport MSTest and MTP servicing fixes to rel/4.5 #12287 head 826ef0f11a51e59861ceeb6e994917587add82d5.
  • Standalone commit: 27c7271d8c8b50283e0cbbe16b953b6b45d25760; sole parent: a39964ce2cf09c4abcbaa7bb8f4e5818638a9de3.
  • Exactly 10 files; prepared tree equals the independently verified source tree fb75cb075594600f191233eaf31a2181575c5fc7. All five affected C# files retain their UTF-8 BOMs.

Standalone validation

Executed on this standalone commit on Windows x64, using repository-pinned SDK 12.0.100-alpha.1.26480.103. The build finished with the initially authorized borrowed SDK; subsequent test tooling used a private copy in this checkout. The existing net11.0 acceptance host uses its generated, pinned .NET 12 runtime configuration; no retargeting or .NET 11 runtime installation was needed.

.\build.cmd -pack -c Release -msbuildEngine vs "/bl:$binaryLog"

Passed, exit 0, 0 warnings / 0 errors. $binaryLog was the unique artifacts\log\Release\fixture-standalone\full-pack-c4538f12cdcd45df8b367ef934aa51d0.binlog. Full release assets, including classic/modern UWP and WinUI, compiled and packed; repository package-content/metadata validation passed. An initial scoped pack did not satisfy the repository-wide expected-package gate; this full pack resolved that setup failure without source changes.

Focused provider unit execution used the following commands for all five existing targets:

$root = (Get-Location).Path
$sdk = Join-Path $root '.dotnet'
foreach ($tfm in @('net8.0', 'net9.0', 'net462', 'net48', 'net8.0-windows10.0.18362.0')) {
    $results = Join-Path $root "artifacts\fixture-results\unit-$tfm"
    $binaryRoot = Join-Path $root "artifacts\bin\MSTestAdapter.PlatformServices.UnitTests\Release\$tfm"
    $arguments = @('--no-ansi', '--progress', 'off', '--treenode-filter',
        '/*/*/TypeCacheAssemblyFixtureProviderTests/*', '--report-trx',
        '--report-trx-filename', 'unit.trx', '--results-directory', $results)
    if ($tfm -like 'net4*') {
        & (Join-Path $binaryRoot 'MSTestAdapter.PlatformServices.UnitTests.exe') @arguments
    } else {
        & "$sdk\dotnet.exe" (Join-Path $binaryRoot 'MSTestAdapter.PlatformServices.UnitTests.dll') @arguments
    }
}

Passed, all five exits 0: 13 per target, 65 executed/passed, 0 skipped. Fresh TRX results matched the exact source-derived method identities and counters.

Packaged-consumer discovery and execution:

$root = (Get-Location).Path
$sdk = Join-Path $root '.dotnet'
$env:DOTNET_INSTALL_DIR = $sdk
$env:DOTNET_ROOT = $sdk
$env:PATH = "$sdk;C:\Windows\System32\WindowsPowerShell\v1.0;$env:PATH"
$filter = 'FullyQualifiedName~AssemblyFixtureProviderDiscoveryTests|FullyQualifiedName~AssemblyFixtureProvider_FromReferencedLibrary_RunsAssemblyInitializeAndCleanup'
$hostDll = Join-Path $root 'artifacts\bin\MSTest.Acceptance.IntegrationTests\Release\net11.0\MSTest.Acceptance.IntegrationTests.dll'
& "$sdk\dotnet.exe" $hostDll --list-tests --filter $filter --no-ansi --progress off
$env:DOTNET_PROCESSOR_COUNT = '4'
$results = Join-Path $root 'artifacts\fixture-results\acceptance'
& "$sdk\dotnet.exe" $hostDll --filter $filter --report-trx --report-trx-filename fixture-standalone.trx --results-directory $results --no-ansi --progress off --show-test-results failed

Passed, discovery and execution exits 0. The independent source plan, discovery, and fresh outer TRX agree on 82 identities: 82 executed/passed, 0 skipped, including existing provider controls and real net8.0/net10.0/.NET Framework MTP/VSTest consumers. The execution verifier checked fresh timestamps, unique execution IDs, exact names, and report counters.

The 79 new consumer cases verified the restored PlatformServices payload against this checkout's freshly packed adapter; all 67 executing children also verified their loaded DLL bytes. Retained canonical attachments contain 79 resolved-assets reports and 79 child reports: 67 passing one-test children and 12 expected duplicate-provider failures with zero executed child results, not empty successes. All 316 retained package-content SHA-512 entries for the four packages below match the standalone nupkgs. The net10.0 consumer correctly selects the release's net9.0 adapter asset.

Standalone package SHA-256
MSTest.TestAdapter 4.5.3-dev B6D4210BF719C3C19E9E25658B07DC74053C0455BD923ACC710D318C0E8673F5
MSTest.TestFramework 4.5.3-dev 981D4FCDB2F72979C97A960612720DCC75CC1384ED21C499217F6CEDF0538266
Microsoft.Testing.Platform 2.5.3-dev F3084D9A7B290C8DABFED705A9A51A6ED0336C593074A91B38E27C880E0EFB8D
Microsoft.Testing.Extensions.TrxReport 2.5.3-dev 53A703E48AEA7A1F14680A464D892B58C330516C36314AEF397441B92B7797EF

Raw TRX, attachments, source-plan identities, build logs/binlogs, and hash manifests are retained locally in the session's fixture-standalone-proof.zip (SHA-256 00BBF8CEE914BB8471172EE9C6828EAB87A4EBE79AEE01DC6B52CDA15E85226C). Normal assembly cleanup reclaimed the per-run package cache; only this checkout's 38 private-SDK workers were stopped, without a shared-server shutdown or cache clearing.

Limits

The versioned decision record retains the original source-revision counterfactual evidence; that counterfactual was not rerun for this split PR. Real AppX/UWP activation, hosted UI/IDE behavior, and CI were not executed or validated here.

Adapt #12269 (127798d) while retaining release target assets and package dependencies. Include the same binding/loading regressions and verified release red/green evidence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Evangelink
Amaury Levé (Evangelink) merged commit 2882ebc into rel/4.5 Nov 9, 2026
22 of 23 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the evangelink-rel-4-5-fixture-discovery branch November 9, 2026 18:39
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.

1 participant