Skip to content

[Experiment] Browser WebAssembly support for dotnet test - #56305

Draft
Evangelink wants to merge 25 commits into
dotnet:mainfrom
Evangelink:dev/amauryleve/browser-wasm-dotnet-test-poc
Draft

Evangelink wants to merge 25 commits into
dotnet:mainfrom
Evangelink:dev/amauryleve/browser-wasm-dotnet-test-poc

Conversation

@Evangelink

@Evangelink Evangelink commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Important

Fresh Windows composed acceptance passes11/11, zero skips, at SDK f7edbfedcb5319fd006078d1f9516f4a27442ddf + TestFX 11b0d39f9079e5ead7b91ae5ab5161b5dcd8a147. This includes the producer's tested cross-platform satellite-path correction. The PR remains draft: fresh Linux/reverse-direction/current-head CI still gates readiness. The tested layout is explicitly runtime-augmented, not an unmodified shipping SDK or an officially signed/published browser-testing product.

Related: design RFC #55906 and producer/launcher microsoft/testfx#11305.

Experiment and preserved behavior

  • Complete ComputeRunArguments and its providers, then invoke optional ComputeTestingPlatformRunArguments. Separate test-only command, arguments and working-directory properties inherit canonical values only when absent; explicit empties remain empty. Configured dependencies without their target fail. TestingPlatformRunArgumentsVersion=1 advertises compatibility; ordinary dotnet run is unchanged.
  • MTP sends results directly to the SDK over authenticated loopback HTTP. Independently negotiated control uses existing MTP messages; concurrent requests keep results moving during finite polls. Cooperative cancellation preserves forced-exit behavior and lets final reporting finish.
  • Stream the managed VFS in bounded chunks; validate identity/names/ordering/lengths/quotas; stage isolated transfers; commit complete files without overwriting; clean partials; report only exported paths with known provenance. Requested transfer failures cannot silently report success.
  • The optional TestFX browser package owns its boot page, private Playwright/Node runtime, supervisor/worker barrier and process-tree cleanup. Consumer tests remain pure C#: Framework + Adapter + optional Browser, generated Main, no authored JS/HTML/JSImport or integration targets.

Transfer defaults remain 1MiB/chunk,1GiB/file,4GiB and10,000files/module. Positive integer overrides are DOTNET_CLI_TEST_ARTIFACT_MAX_FILE_BYTES, DOTNET_CLI_TEST_ARTIFACT_MAX_MODULE_BYTES and DOTNET_CLI_TEST_ARTIFACT_MAX_FILE_COUNT. Browser/WASI hosts retain exported originals rather than promising browser-side host-file processing.

Reconciled upstream contract

The branch incorporates SDK main 652269386d3c0702de4e6c9a6b8495e7eef5cfbc and preserves its coverage contract. Both owners inventoried SDK/TestFX main and both experimental heads before agreeing the unused block:

Contract Allocation
Upstream coverage Serializer 15, capability 20=1, artifact metadata 9, coverage payload fields 1–8
Artifact transfer Request 17, response 18; payload 1–8 / reply 1–3 unchanged
Browser capabilities HTTP control 26=http; transfer 27=chunked-v1; limits 28–31
Reserved slots Serializer 4 remains reserved; experimental 16 and properties 21–25 stay unassigned

There is no legacy artifact alias for15. Protocol1.5 support is retained, but version negotiation alone does not activate browser capabilities. Mixed experiment peers lacking the new block retain the warning/suppressed-HTTP-artifact fallback and disabled HTTP control. Coverage negotiates independently; named pipes remain intact. All26 object-ID classes, complete handshake IDs and independent version values match the immutable producer wire source.

Final source-matched stock proof

The stock entry point ran with no skip-build flags from clean SDK source and a task-owned restored counterpart whose actual HEAD was independently verified as11b0. Its older folder label is not used as identity:

.\eng\browser-testing\RunBrowserTests.ps1 -TestFxRoot artifacts\btf-dd63a33d -BrowserExecutable 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe' -Configuration Debug -ResultsDirectory artifacts\log\browser-wire-composed-11b0
  • SDK f7edbfe, selected 12.0.100-dev; product build including NativeAOT publication 0warnings/0errors.
  • TestFX 11b0d39f9079e5ead7b91ae5ab5161b5dcd8a147; fresh shipping-filter pack and evaluated net12 acceptance-host build 0warnings/0errors.
  • Eight staged packages, all with that exact producer commit: Browser 0.1.0-dev, MTP/MTP.MSBuild/Telemetry/TRX abstractions 2.6.0-dev, MSTest Framework/Adapter/Analyzers 4.6.0-dev. Restored SHA-512 identities are compared against staged bytes; staged SHA-256 values were independently rechecked after acceptance. Browser SHA-256: 73272744AC68618B59EAF8FA6283A8F9AB714DD5A9696F4E4B9D77691C88FAB8.
  • Windows x64, installed Edge 156.0.4314.58; parent exit0, all7 logged commands exit0, 11executed/11passed/0skipped. Both source checkouts remained clean.
Required BrowserPackage_ case Outcome
DotnetTestRunsAndListsTestsThroughSdkHttpGateway Passed
DefinesDedicatedBrowserRunArguments Passed
SdkCancellationStopsManagedBrowserRun Passed
ArtifactQuotaFailureFailsRun Passed
HostAssetsAreBuildOnlyConsumerAssets Passed
DesktopTestApplicationIsUnaffected Passed
ContainsPrivateCrossPlatformPlaywrightRuntime Passed
PackNoBuildPreservesRuntimePayload Passed
PackWithoutBundledNodePreservesPrivateDriverAndLicenses Passed
InvalidExplicitBrowserPathFails Passed
EvaluatedPropertyIgnoresTelemetryBanner Passed

Exact commands/exits, all8 package hashes, runtime hashes and TRX are retained under artifacts/log/browser-wire-composed-11b0/: evidence.json, packages/manifest.json, runtime-manifest.json, composed-runtimes.log, test-results/browser.trx, build logs/binlog. Result/manifests are also retained as session deliverables. Earlier d463/dd63 Windows evidence is preserved separately, not silently relabeled.

Explicit runtime prerequisite

The producer's net11 desktop consumer requires Microsoft.NETCore.App11.0.0-rc.2.26504.105; an older redist otherwise exits150 with zero child tests. The shared gate stages the exact Core runtime versions declared by the immutable producer global.json from its already-restored private bootstrap into versioned task-owned SDK directories. It does not replace SDK/muxer/hostfxr, lower the target, weaken exit/zero-result assertions, set major roll-forward or modify global tooling/PATH.

Evidence records runtimeLayoutAugmented=true and separately verifies 756files across Core 8.0.32,9.0.21,10.0.13,11.0.0-rc.2.26504.105. Core11rc2 has197files; Windows coreclr.dll is4,888,360bytes with SHA-256 013A0DDCF0751EE6880CB175BD2F95FF3F9AA8B82A37AE4D17ED63A647F14E4C. Source directories and every file hash are recorded. Missing/invalid inputs fail; retries repair partial copies. This is an augmented test composition, not evidence the SDK originally shipped11rc2.

Actual Linux failure and narrow correction

SDK build1659746 Linux browser job was independently investigated through timeline, actual log82 and downloaded Browser_Linux_x64_Attempt1 evidence/TRX. CI merge 3f2ee527ad31c648120b8c2decd14efa29d68c70 has exact SDK source parentd463 and pins producerdd63. It executes 11:8pass/3fail/0skip; only browser-acceptance exits2.

All3 failures are preserved exact satellite assertions: default archive has13 tools/net8.0/any//<culture>/... entries instead of canonical single separators, and no-build/system-Node variants cannot find canonical tr/...resources.dll. Run/export, quota, cancellation, desktop and launcher cases pass. The runtime manifest actually contains Core11rc2; desktop passes, so this is not inferred to be an unprovisioned-runtime or wire failure.

Producer11b0 changes only that production PackagePath expression using the established Replace/TrimStart pattern and adds a focused test evaluating the actual expression. Exact package assertions, wire models and runtime requirements remain unchanged. The producer's executed four-case metadata red/green proof is not represented as a Linux runtime pass. Fresh Linux CI with this pin is still required. Downloaded prior-job evidence remains under artifacts/log/ci1659746-linux/.

SDK regression evidence

  • Focused protocol/HTTP/launcher/handler/coverage 261/261, legacy serializers/coverage-artifact metadata 41/41, fresh NativeAOT executable 8/8: all execute/pass, zero skipped. Product native library and dn host publish. Existing native-test dump advisories/IL3053 dependency rollups remain; no suppression added.
  • Executed sensitivity: changing only artifact request17 back to15 builds but fails exactly the selected regression with duplicate key15 (1failed, exit2). Restoring17 returns the full261 selection to green (exit0) and source is clean.
  • Strict TRX positive case and all11 negative shapes pass; preflight/evidence-write failure restores process state. Runtime tests verify exact bytes, unchanged SDK marker, interrupted-copy repair and missing/invalid-input rejection.
  • Existing _CopyDirectoryBuildTestDependencies;WriteNugetConfigFile prepares the SDK test root; no fixture bypass. All219 local documentation/memory links validate.

Continuous gate and readiness limits

Both repositories use this SDK-owned entry point in mandatory public Windows/Linux CI. Missing inputs, duplicate/zero results, skipped or inconclusive cases fail; neither direction uses an optional green-skipping job. Counterpart pins remain immutable, with separate caller/package-source roles rather than a mutual-HEAD pin cycle. Reverse-direction producer pin flow and fresh required CI on the final heads remain merge-readiness gates; no Linux-current or unmodified-shipping claim is made from the Windows result.

The SDK product-only solution filter is project selection, not source-build mode. Windows retains desktop MSBuild for MSTest UWP assets; Linux uses the existing build pool and signed/fingerprint-verified Chrome setup. SDK intermediates/system tools are not deleted to fit an undersized agent. WasmAppHost's App url: line remains an explicit exercised compatibility dependency, not a claimed structured upstream API. See poc/browser-wasm-unit-tests/README.md for source-matched contracts and reproduction.

This is still an experiment. Official signing/notarization/publication, third-party license/SBOM/source-build approval, supported RID/release-branch validation, dependency flow and assigned long-term servicing ownership remain release gates. Host configuration-file transfer, browser-side artifact merging, native relinking and trimming are not established. Do not enable downstream or extend platform claims merely because a feature flag, repository-local tests or Windows-only composition is green.

@Evangelink Evangelink changed the title [Experiment] Prove browser WebAssembly support in dotnet test [Experiment] Prove pure managed browser WebAssembly support in dotnet test Sep 16, 2026
@Evangelink
Evangelink force-pushed the dev/amauryleve/browser-wasm-dotnet-test-poc branch from a1a2047 to 5aefe6e Compare September 16, 2026 16:45
@Evangelink Evangelink changed the title [Experiment] Prove pure managed browser WebAssembly support in dotnet test [Experiment] Minimal browser WebAssembly dotnet test PoC Sep 16, 2026
@Evangelink
Evangelink force-pushed the dev/amauryleve/browser-wasm-dotnet-test-poc branch 3 times, most recently from 5be7775 to 9341575 Compare September 16, 2026 18:33
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
@Evangelink
Evangelink force-pushed the dev/amauryleve/browser-wasm-dotnet-test-poc branch from 9341575 to f0ed2c3 Compare September 16, 2026 18:33
Evangelink and others added 18 commits October 11, 2026 14:59
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Preserve and disable MSBUILDDISABLENODEREUSE so mixed-module runs cannot retain task assemblies in the disposable NuGet cache.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Keep long-running control requests from blocking test results and cancel in-flight gateway waits during shutdown.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Select test-only launch properties after canonical providers, negotiate HTTP cancellation, and receive bounded isolated artifact transfers. Preserve legacy transports and add protocol, file-system and end-to-end HTTP regressions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Reject incomplete test-launcher providers, add focused native protocol coverage, and synchronize shared-contract tracking and contributor guidance.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Build pinned SDK/TestFX sources together through one cross-platform entry point, validate package provenance and required test execution, and fail on missing or skipped cases rather than treating them as green.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Use the full upstream PR head read back from GitHub after validating the counterpart fetch.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Pin the verified TestFX build-driver correction and avoid MAX_PATH failures in legacy Windows MSBuild task loading.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Pass verified SDK version and commit to browser acceptance, reject source drift, restore process state even if evidence writing fails, and include the browser sample in CI triggers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Use the TestFX acceptance harness that selects the exact SDK among side-by-side installations and verifies all eight restored package hashes in isolated fixture caches.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Avoid unrelated SDK test outputs and dependencies on disk-limited hosted agents while building the complete redist project dependency closure.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Reuse the existing product-only solution filter with an absolute path and pin short fixture-owned package caches without weakening restore identity checks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Consume the counterpart-owned package filter and use its bootstrap MSBuild on Windows, avoiding unrelated test outputs and dependence on hosted Visual Studio versions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Use the verified TestFX build-driver mt switch to support hosted MSBuild without omitting UWP package targets.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Use the existing VS2026 preview pool for complete MSTest package assets and pin the package filter including its analyzer configuration generator.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Keep the complete shipping layout and diagnostics while explicitly discarding only guarded SDK obj and evaluated staging directories in CI. Validate path/link safety on Windows and Linux, and pin lazy acceptance package lookup.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
Provision the existing Chrome prerequisite through its fingerprint-verified signed repository on disposable workers. Remove intermediate-deletion logic rather than retaining cleanup complexity that cannot make hosted disks sufficient.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1c54e99e-de18-4bcd-a5c4-6163e4aeb78c
@Evangelink

Copy link
Copy Markdown
Member Author

/azp run dotnet-sdk-public-ci

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@Evangelink Evangelink changed the title [Experiment] Minimal browser WebAssembly dotnet test PoC [Experiment] Browser WebAssembly support for dotnet test Oct 12, 2026
Evangelink and others added 6 commits November 2, 2026 10:14
Preserve coverage serializer 15 and capability 20. Move the browser experiment to serializers 17/18 and capabilities 26-31, retire its old slots, and cover combined coverage, transfer, and control negotiation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Avoid capturing the primary-constructor parameter after initializing the browser artifact manager field. Keep expected wire-limit formatting culture invariant.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use independently verified TestFX source c22e5fd7b54c25e11ba8915dcf0f77d29b011487 and its exact wire blobs for composed validation. Follow the existing fluent assertions for fixed byte IDs so the current MSTest analyzer can compile the regression suite.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Pin the clean published counterpart 5a29bc728bd39a2ad1f1666f209a5c35002b436a. Its only change from the previous source corrects the coverage acceptance protocol-version expectation; product and wire blobs are unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Pin the consolidated verified producer dd63a33d17766eceb0b709d0e74201eb30424f3d. Copy and hash-check its declared restored Core runtimes into the isolated SDK test composition so the net11 rc2 desktop case cannot fail with exit150 or be hidden by major roll-forward. Record the augmented runtime provenance separately and exercise rejection/repair in the existing preflight.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use remotely verified producer 11b0d39f9079e5ead7b91ae5ab5161b5dcd8a147. Its sole production change normalizes the satellite PackagePath using the existing Replace/TrimStart pattern, preserving exact package assertions, wire contracts and runtime requirements.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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