Repository navigation
Convert WasiPlayground sample into MTP acceptance tests - #9828
Conversation
Promote the raw-platform wasi-wasm scenario from samples/WasiPlayground into acceptance tests (RawPlatform_BuildsForWasi + RawPlatform_RunsUnderWasmtime) alongside the existing MSTest wasm tests, sharing the wasmtime/publish/ICU helpers. Delete the sample and update solution files and restore-toolset comments accordingly. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR promotes the former samples/WasiPlayground scenario (hosting raw Microsoft.Testing.Platform on wasi-wasm) into Microsoft.Testing.Platform.Acceptance.IntegrationTests acceptance coverage, and removes the now-redundant sample from the repo/solutions. This helps ensure WASI build/execution behaviors stay regression-tested alongside the existing MSTest-on-MTP WASI acceptance test.
Changes:
- Add new “raw MTP” WASI acceptance tests and refactor shared WASI helpers (
LocateWasmtime,StageIcuData, publish/run helpers) inWasmExecutionTests.cs. - Remove
samples/WasiPlaygroundand drop it fromTestFx.slnxandMicrosoft.Testing.Platform.slnf. - Update restore-toolset script comments to point to the new acceptance test coverage as the
wasi-experimental-net10workload consumer.
Show a summary per file
| File | Description |
|---|---|
| TestFx.slnx | Removes the deleted WASI playground sample from the full solution. |
| test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/WasmExecutionTests.cs | Adds raw-MTP WASI build/run acceptance tests and refactors shared WASI helpers. |
| samples/WasiPlayground/WasiPlayground.csproj | Deleted (sample promoted into acceptance tests). |
| samples/WasiPlayground/README.md | Deleted (documentation folded into test XML docs / comments). |
| samples/WasiPlayground/Program.cs | Deleted (raw platform host logic now generated in acceptance test asset). |
| Microsoft.Testing.Platform.slnf | Removes the deleted WASI playground sample from the platform solution filter. |
| eng/restore-toolset.sh | Updates comments to reference acceptance tests as the workload consumer. |
| eng/restore-toolset.ps1 | Updates comments to reference acceptance tests as the workload consumer. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 2
- Review effort level: Low
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Note
🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.
✅ 22/22 dimensions clean — no findings.
Summary: Clean promotion of the samples/WasiPlayground into acceptance tests with good refactoring discipline:
- Shared helpers (
LocateWasmtime,StageIcuData,TryPublishForWasiAsync,RunUnderWasmtimeAsync) properly extracted and reused across both raw-platform and MSTest test methods. - Proper
usingonTestAsset(disposable management). - Graceful inconclusive skipping when toolchain is unavailable — no flakiness risk.
- No duration assertions, no shared mutable state, no timing-dependent logic.
eng/script changes are comment-only (no behavioral change).- Solution filter updates are consistent with the sample deletion.
This comment has been minimized.
This comment has been minimized.
Split the wasi-wasm acceptance coverage per product: the raw-platform tests stay in Microsoft.Testing.Platform.Acceptance.IntegrationTests and the MSTest-adapter tests move to MSTest.Acceptance.IntegrationTests. Shared wasmtime/publish/ICU plumbing is extracted into a WasmRuntime helper in Microsoft.Testing.TestInfrastructure to avoid duplication across the two projects. Also add the wasm-tools-net10 workload to eng/restore-toolset so 'dotnet publish -r wasi-wasm' works in CI (execution still self-skips unless wasmtime is on PATH). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🤖 Automated content by GitHub Copilot. Generated by the Build Failure Analysis workflow. · 48.5 AIC · ⌖ 5.81 AIC · ⊞ 7.3K · ◷
…es, add BOM - Reorder both execution tests to publish for wasi-wasm first (so the publish path is exercised in CI where wasm-tools is installed but wasmtime is not), then gate only the wasmtime invocation. - Add WasmRuntime.IsMissingWasmToolsWorkload so only the known NETSDK1147/'wasm-tools' missing-workload signature is an inconclusive skip; any other publish failure now fails the test. - Check the combined STDOUT+STDERR for PlatformNotSupportedException and drop the unused stderr local. - Fix the MSTest asset comment (two passing + one failing test). - Add the UTF-8 BOM required by .editorconfig to the three new/rewritten C# files. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
🧪 Test quality grade — PR #98284 new test methods graded across 2 files. Three tests earn an A with strong multi-assertion coverage of exit codes, output content, and artifact existence.
This advisory comment was generated automatically. Grades are heuristic
|
🔍 Build Failure AnalysisSummary — The build fails with 4 × Root cause:
|
| Code | Project | File:Line | Message |
|---|---|---|---|
CA1416 |
Microsoft.Testing.Platform.UnitTests |
FileLoggerTests.cs:465 |
ITask.RunLongRunning(...) is unsupported on: 'browser' |
CA1416 |
Microsoft.Testing.Platform.UnitTests |
FileLoggerTests.cs:490 |
ITask.RunLongRunning(...) is unsupported on: 'browser' |
CA1416 |
Microsoft.Testing.Platform.UnitTests |
FileLoggerTests.cs:465 |
(duplicate, second TFM) |
CA1416 |
Microsoft.Testing.Platform.UnitTests |
FileLoggerTests.cs:490 |
(duplicate, second TFM) |
| — | — | — | Build failed. |
🤖 Generated by the Build Failure Analysis workflow using (a href="(dev.azure.com/redacted) · commit 1f66751
🤖 Automated content by GitHub Copilot. Generated by the Build Failure Analysis workflow. · 143.7 AIC · ⌖ 5.98 AIC · ⊞ 7.3K · [◷]( · ◷)
What
samples/WasiPlayground(raw Microsoft.Testing.Platform onwasi-wasm) into acceptance tests and deletes the sample.wasm-toolsworkload in CI so the publish step works.Structure (product separation)
Microsoft.Testing.Platform.Acceptance.IntegrationTests/WasmExecutionTests.cs:RawPlatform_BuildsForWasi(always-on) +RawPlatform_RunsUnderWasmtime(gated). Generates a project referencing theMicrosoft.Testing.Platformpackage with aDummyFramework(one passing test).MSTest.Acceptance.IntegrationTests/WasmExecutionTests.cs:WasmBuild_GeneratesTestingPlatformEntryPoint(always-on) +WasmExecution_RunsTestsUnderWasmtime(gated). Real MSTest project (two passing + one failing test) on MTP via the generated entry point.wasmtime/publish/ICU-staging plumbing extracted intoWasmRuntimeinMicrosoft.Testing.TestInfrastructureso the two projects don't duplicate it.Build / CI
eng/restore-toolset.ps1+.shnow installwasm-tools-net10in addition towasi-experimental-net10, sodotnet publish -r wasi-wasmworks in CI (needed by the gated execution tests).wasmtimeonPATH. Without it the two execution tests mark themselves inconclusive (self-skip). Wiring a pinned wasmtime install into the pipeline legs is intentionally left out of this PR as a separate decision — happy to add it if we want the execution tests to run green in CI.Note on MSTest support
MSTest-on-wasi already works (shipped in #9781 / issue #2196). The original blocker was single-threaded wasm (no thread pool); the platform and adapter detect it (
RuntimeFeatureHelper.IsMultiThreaded/RuntimeContext.IsMultiThreaded) and fall back to inline execution. Remaining gaps are extension-specific and unrelated to MSTest: HangDump (System.Diagnostics.Process, #8557) and AzureDevOpsReport (HttpClientAutomaticDecompression).Verification
Both
Microsoft.Testing.Platform.Acceptance.IntegrationTestsandMSTest.Acceptance.IntegrationTestsbuild clean (0 warnings, 0 errors). Thewasm-tools-net10workload install was exercised locally viarestore-toolset.