Skip to content

Surface test results in the Aspire dashboard - #21646

Closed
Mitch Denny (mitchdenny) wants to merge 31 commits into
mitchdenny-java-testing-integrationfrom
mitchdenny-dashboard-testing-indicators
Closed

Mitch Denny (mitchdenny) wants to merge 31 commits into
mitchdenny-java-testing-integrationfrom
mitchdenny-dashboard-testing-indicators

Conversation

@mitchdenny

@mitchdenny Mitch Denny (mitchdenny) commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Description

Make test resources and their results visible in the dashboard without introducing a separate execution workflow. This layer targets #21675 (Maven Surefire/JUnit testing integration), not main. Native stack #21676 runs bottom-to-top: #21527, #21559, #21580, #21585, #21587, #21675, #21646.

A top-level Testing page, alongside Metrics, displays real published results grouped by resource. Resources that publish no individual results, including Cargo, get exactly one resource-outcome row. Passing tests do not conceal execution failures or collector errors. Pending, running and unknown resource states are represented without inventing per-test running events or inferring success from missing results.

All seven terminal outcomes retain their localized labels: Passed, Failed, Skipped, Inconclusive, Error, Timed out and Cancelled. Only Passed and Skipped are non-failing. Other outcomes fail their resource group even when execution succeeds. Unsuccessful statuses use the existing semantic error color with readable text labels. Published Timed out/Cancelled results are not command timeout/cancellation events. Unknown wire values are explicitly invalid; exact timedOut casing is preserved.

Live publication, late connections, reload and reconnect/replay retain finalized results under --keep-alive. Logical replicas share one result set while execution outcomes aggregate across expected instances. Ordinary runs show resource outcomes without activating callbacks. Modern and legacy navigation share the same table, localization and selection behavior.

The beaker resource-kind category and automatic, immutable Testing tags are annotation-backed, not inferred from user-defined tags. Tags remain additive and case-insensitively deduplicated; Project/Executable/Container kinds and icons remain unchanged. Picker counts count testing resources, not invented test cases.

Hosting retains testing results through existing resource snapshots and recording/replay infrastructure. Updates target observed instances rather than creating logical placeholder resources. The runtime callback is WithTesting(Func<ResourceTestingContext, Task>?): it runs only during testing, not model construction. ResourceTestingContext.TestingContext is the containing TestingContext; context.TestingContext.OutputPath is the whole invocation root and context.OutputPath is the logical resource directory. Repeated callback replacement preserves that private context/path; marker-only replacement clears collection. The dashboard retains results on the current annotation without changing these semantics.

Java's actual JUnit results use the same generic dashboard metadata and retained snapshots; no Java-specific UI or execution path is added. Collector-to-dashboard coverage checks fresh/replayed results, additive tags and independent process failure. The cumulative source playground preserves Java and all other framework declarations, source dashboard, shared service and probe cleanup.

Current synchronization provenance

Current dashboard head 07d0855e9dc538a7586116a3e22fb1f6bfd8040f is rebased onto exact Java snapshot 0b45856c614c4132e63a1dfe54e651edec34a5e4, including foundation 8554a7755ab0a241fc10bd3ffb37ff1c9814ba45. All seven owning dashboard patches rebased identically without conflicts or new edits. Compared with the preceding c3 parent, the sole inherited source delta is the test-only disconnect-race correction: await ServerRpc.Completion, with its rationale, before asserting disconnection in JsonRpcCallbackInvokerTests. No production behavior changed in this follow-up.

The preceding c3 snapshot includes foundation discovery after the complete before-start pipeline and remote collector timeout policy tied to test-run cancellation. Those production changes and all dashboard behaviors are unchanged. There is no owning RunCommand or cumulative AppHost diff, no declined README fix, and no global configuration change. Stack bases, readiness and metadata remain unchanged.

The inherited preview CLI command is disabled by default. Scope features__testCommandEnabled=true to each CLI testing invocation, including JSON, failure scenarios, keep-alive and dashboard-selection opt-outs. This gates CLI command registration only, not hosting APIs, dashboard categorization or ordinary runs.

No new public testing API, compatibility aliases, history browser, execution controls, lifecycle changes or separate protocol are introduced by this layer.

Fixes # (issue)

User-facing usage

builder.AddExecutable("tests", "test-runner", ".")
    .WithTags("Backend")
    .WithTesting();

The resource retains its executable kind and receives Backend and Testing tags. Use the beaker picker to focus the list, then open Testing to inspect outcomes. Custom runtime callbacks can publish new TestResult { Name = "probe", Outcome = TestOutcome.Inconclusive }; that outcome fails testing.

The cumulative source playground includes foundation, MSTest, pytest, Go, Cargo and Java JUnit:

features__testCommandEnabled=true \
dotnet run --project src/Aspire.Cli/Aspire.Cli.csproj --no-launch-profile -- \
  test --apphost playground/AspireCliTesting/apphost.cs --isolated --keep-alive

Screenshots / Recordings

This PR includes UI changes. Retained screenshots show the real source dashboard/playground before the unsuccessful-status color adjustment, Java insertion and default-off CLI gate. No unchanged screenshots were republished for synchronization; current validation does not claim a new runtime/browser run.

Individual Go results remain visible alongside resource/collector failure:

Go test results retain passing, failed and skipped rows alongside collector errors

Cargo contributes one resource-level outcome:

Cargo failure is represented by one resource-level outcome

The beaker picker preserves actual resource kinds:

Testing resource picker retaining actual resource kinds

The automatic, locked Testing tag:

Automatically appended immutable Testing tag

Validation

All commands use the restored local SDK: DOTNET_ROOT="$PWD/.dotnet" PATH="$PWD/.dotnet:$PATH" MSBUILDTERMINALLOGGER=false. These unit/model/component runners are not the gated CLI command; feature tests retain explicit default-off/opt-in coverage rather than enabling a global environment flag.

Current test-only follow-up at 07d0855e9dc538a7586116a3e22fb1f6bfd8040f: 232 .NET tests and six JavaScript tests passed.

  • dotnet test --project tests/Aspire.Hosting.RemoteHost.Tests/Aspire.Hosting.RemoteHost.Tests.csproj --no-launch-profile -- --filter-class '*.JsonRpcCallbackInvokerTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' — passed, seven tests, including the corrected disconnect assertion.
  • dotnet test --project tests/Aspire.Dashboard.Tests/Aspire.Dashboard.Tests.csproj --no-launch-profile -- --filter-class '*.TestingResourceGroupTests' --filter-class '*.ResourceViewModelTests' --filter-class '*.ResourceTagStoreTests' --filter-class '*.DashboardExperienceRedirectMiddlewareTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' — passed, 101 tests.
  • dotnet test --project tests/Aspire.Dashboard.Components.Tests/Aspire.Dashboard.Components.Tests.csproj --no-launch-profile -- --filter-class '*.TestingResultsTests' --filter-class '*.ResourcesLayoutTests' --filter-class '*.ResourceDetailsTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' — passed, 124 tests covering seven outcomes, grouping, tags, live updates/replay, resource fallback and navigation.
  • node --test tests/Aspire.Dashboard.Components.Tests/JavaScript/DashboardExperience.test.mjs — passed, six tests.
  • git diff --exit-code 0b45856c614c4132e63a1dfe54e651edec34a5e4 HEAD -- src/Aspire.Cli/Commands/RunCommand.cs playground/AspireCliTesting/apphost.cs — passed; neither file changed in this layer. Range-diff confirms all seven prior dashboard patches unchanged, and foundation/Java ancestry was verified.

Broader preceding c3 evidence at dashboard 0f2545555e30d04d05d0d8d00599c3e4e8140383, Java parent d05249ff21199b3698ffb7e53373dbe46ce67f52, foundation c3f7e721be746054e7f963a20e3b2d45a7b9f8e3: 907 .NET tests, six JavaScript tests and cumulative AppHost build passed. This evidence is reused, not claimed as rerun for the test-only follow-up. It includes the same 101 dashboard-model and 124 component tests and JavaScript command above, plus:

  • dotnet test --project tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj --no-launch-profile -- --filter-class '*.TestingCollectorTests' --filter-class '*.TestRunCoordinatorTests' --filter-class '*.TestRunStreamingTests' --filter-class '*.ResourceTraitBuilderTests' --filter-class '*.DashboardServiceDataTerminalTests' --filter-class '*.AuxiliaryBackchannelRpcTargetTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' — passed, 187 tests. Includes lifecycle discovery, contexts, callback replacement, all seven wire values, replicas and fresh/replayed snapshots. Existing snapshots passed unchanged.
  • dotnet test --project tests/Aspire.Hosting.RemoteHost.Tests/Aspire.Hosting.RemoteHost.Tests.csproj --no-launch-profile -- --filter-class '*.CallbackProxyTests' --filter-class '*.CapabilityDispatcherTests' --filter-class '*.JsonRpcCallbackInvokerTests' --filter-class '*.AttributeDataReaderTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' — passed, 213 tests covering inherited callback-timeout policy and invocation behavior.
  • dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class '*.RootCommandTests' --filter-class '*.KnownFeaturesTests' --filter-class '*.TestCommandTests' --filter-class '*.TestRunReporterTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' — passed, 225 tests. Includes default-off/opt-in registration, reporter behavior, JSON, failures, deadlines, cancellation and keep-alive; TestCommand fixtures opt in locally.
  • dotnet test --project tests/Aspire.Hosting.Java.Tests/Aspire.Hosting.Java.Tests.csproj --no-launch-profile -- --filter-class '*.JUnitCollectorTests' --filter-class '*.JUnitTestingTests' --filter-class '*.SurefireJUnitReportTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' — passed, 52 tests. Includes actual JUnit publication, fresh/replayed dashboard snapshots, additive deduplicated tags and independent process failure.
  • dotnet test --project tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.csproj --no-launch-profile -- --filter-method '*.Scanner_WithTesting_ExportsSingleOptionalRuntimeCollector' --filter-method '*.GeneratesExperimentalGoTestAndCaptureOutput' --filter-method '*.GeneratesOneAddMsTestMethodWithTypedOptionsAndExecutableCapabilities' --filter-method '*.GeneratesExperimentalCargoTesting' --filter-method '*.GeneratesExperimentalJUnitTestingOnJavaResources' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' — passed, five tests; no generated snapshot changes.
  • dotnet build playground/AspireCliTesting/apphost.cs --nologo /p:SkipNativeBuild=true — passed, including source dashboard and all hosting integrations. Not repeated for the two-line test-only disconnect correction.

No new runtime/Maven/E2E/browser run or screenshots were produced for the follow-up; production source and UI are unchanged. Full repository suites and formal security review were not run. Stack CI is not verified green; the foundation owner is monitoring CI. Local checks and inherited evidence are not a claim that remote build/E2E checks have passed.

Prior outcome-migration evidence (not newly repeated for later synchronizations): dotnet build /t:UpdateXlf src/Aspire.Dashboard/Aspire.Dashboard.csproj -v:q passed, as did 126 CLI reporter/test-command tests using the same exclusions. An owned source playground run with Go/Cargo failure flags completed with the expected failed verdict: nine published passes, one failed test and three skips across five testing resources. Browser checks verified source dashboard identity, late connection, grouped Go results plus execution/collector failure, exactly one Cargo fallback, reload replay, legacy selection and unsuccessful styling. All seven outcomes were exercised in hosting/model/component tests; the live playground used actual framework verdicts, not fabricated cases. This historical run preceded Java insertion and default-off command registration. The owned AppHost was stopped explicitly and endpoint shutdown verified; its keep-alive wrapper exited 137 following the manual stop after inspection.

Security considerations

Names/messages are untrusted data rendered as text through Razor/Fluent UI. Results use existing resource transport and recording access controls, without new listeners or authentication paths. Collector output-directory fields are excluded from dashboard result metadata. Published messages may contain application details and are retained by existing recording persistence. Formal security review has not been performed.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21646

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21646"

@mitchdenny Mitch Denny (mitchdenny) changed the title Surface testing resources in the dashboard picker and tags Surface test results in the Aspire dashboard Nov 1, 2026
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@mitchdenny
Mitch Denny (mitchdenny) force-pushed the mitchdenny-rust-testing-integration branch from 4a7ef93 to 45e459e Compare November 1, 2026 13:10
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@mitchdenny
Mitch Denny (mitchdenny) force-pushed the mitchdenny-dashboard-testing-indicators branch from 9f0e668 to f1c9710 Compare November 1, 2026 14:40
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@mitchdenny
Mitch Denny (mitchdenny) force-pushed the mitchdenny-rust-testing-integration branch from ee32ee4 to c8cfda8 Compare November 2, 2026 02:47
@mitchdenny
Mitch Denny (mitchdenny) force-pushed the mitchdenny-dashboard-testing-indicators branch from 9cbce40 to 85cca03 Compare November 2, 2026 02:51
@github-actions

This comment has been minimized.

@mitchdenny
Mitch Denny (mitchdenny) force-pushed the mitchdenny-dashboard-testing-indicators branch from 85cca03 to ce214e7 Compare November 2, 2026 03:43
@mitchdenny
Mitch Denny (mitchdenny) changed the base branch from mitchdenny-rust-testing-integration to mitchdenny-java-testing-integration November 2, 2026 03:44
@github-actions

This comment has been minimized.

Keep Go command examples invocation-scoped and adapt inherited streaming coverage to the raw capture dependency.

Co-authored-by: Copilot App <[email protected]>
@mitchdenny
Mitch Denny (mitchdenny) force-pushed the mitchdenny-dashboard-testing-indicators branch from afebf93 to 0f25455 Compare November 2, 2026 09:51
Keep Cargo launch configuration and guards independent of collection, preserve flat resource artifacts, and cover replacement and cancellation semantics.

Co-authored-by: Copilot App <[email protected]>
Distinguish whole-run and resource output paths and verify the renamed generated context getter without changing Cargo execution.

Co-authored-by: Copilot App <[email protected]>
Add testCommandEnabled to Rust and combined playground invocations without changing hosting runtime behavior or saved configuration.

Co-authored-by: Copilot App <[email protected]>
Collect fresh Surefire reports through the existing Java wrapper launch, export the experimental helper, and extend the cumulative testing playground with a shared-service JUnit fixture.

Co-authored-by: Copilot App <[email protected]>
Keep the Java CLI example aligned with the inherited disabled-by-default testing feature gate without changing user configuration.

Co-authored-by: Copilot App <[email protected]>
@mitchdenny
Mitch Denny (mitchdenny) force-pushed the mitchdenny-java-testing-integration branch from d05249f to 0b45856 Compare November 2, 2026 09:57
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@mitchdenny
Mitch Denny (mitchdenny) force-pushed the mitchdenny-dashboard-testing-indicators branch from 0f25455 to 07d0855 Compare November 2, 2026 10:00
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Tests selector

56 / 100 PR test projects · 5 PR jobs, from 57 changed files.

Selected PR test projects (56 / 100)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Analyzers.Tests, Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Azure.Provisioning.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Browsers.Tests, Aspire.Hosting.CodeGeneration.Go.Tests, Aspire.Hosting.CodeGeneration.Java.Tests, Aspire.Hosting.CodeGeneration.Python.Tests, Aspire.Hosting.CodeGeneration.Rust.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Containers.Tests, Aspire.Hosting.DevTunnels.Tests, Aspire.Hosting.Docker.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.EntityFrameworkCore.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Garnet.Tests, Aspire.Hosting.Go.Tests, Aspire.Hosting.Java.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Kafka.Tests, Aspire.Hosting.Keycloak.Tests, Aspire.Hosting.Kubernetes.Tests, Aspire.Hosting.Maui.Tests, Aspire.Hosting.Milvus.Tests, Aspire.Hosting.MongoDB.Tests, Aspire.Hosting.MySql.Tests, Aspire.Hosting.Nats.Tests, Aspire.Hosting.OpenAI.Tests, Aspire.Hosting.Oracle.Tests, Aspire.Hosting.Orleans.Tests, Aspire.Hosting.PostgreSQL.Tests, Aspire.Hosting.Python.Tests, Aspire.Hosting.Qdrant.Tests, Aspire.Hosting.RabbitMQ.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Redis.Tests, Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Rust.Tests, Aspire.Hosting.Seq.Tests, Aspire.Hosting.SqlServer.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Hosting.Valkey.Tests, Aspire.Hosting.Yarp.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests, Infrastructure.Tests

Selected PR jobs (5)

cli-starter-validation, extension-e2e, native-dashboard-validation, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

⚠️ 40 of the 56 selected test projects come from a single change — src/Aspire.Hosting/ApplicationModel/ResourceTraitSnapshotProperties.cs.

🔧 src/Aspire.Hosting/ApplicationModel/ResourceTraitSnapshotProperties.cs (changed source)
→ 40 via the project graph

show 40

Aspire.Hosting.Analyzers.Tests (2 hops), Aspire.Hosting.Azure.EntraId.Tests (2 hops), Aspire.Hosting.Azure.Kusto.Tests (2 hops), Aspire.Hosting.Azure.Provisioning.Tests (3 hops), Aspire.Hosting.Browsers.Tests (2 hops), Aspire.Hosting.CodeGeneration.Go.Tests, Aspire.Hosting.CodeGeneration.Java.Tests, Aspire.Hosting.CodeGeneration.Python.Tests, Aspire.Hosting.CodeGeneration.Rust.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Containers.Tests (2 hops), Aspire.Hosting.DevTunnels.Tests (2 hops), Aspire.Hosting.Docker.Tests (2 hops), Aspire.Hosting.EntityFrameworkCore.Tests (2 hops), Aspire.Hosting.Foundry.Tests (2 hops), Aspire.Hosting.Garnet.Tests (2 hops), Aspire.Hosting.Go.Tests (2 hops), Aspire.Hosting.Kafka.Tests (2 hops), Aspire.Hosting.Keycloak.Tests (2 hops), Aspire.Hosting.Kubernetes.Tests (2 hops), Aspire.Hosting.Maui.Tests, Aspire.Hosting.Milvus.Tests (2 hops), Aspire.Hosting.MongoDB.Tests (2 hops), Aspire.Hosting.MySql.Tests (2 hops), Aspire.Hosting.Nats.Tests (2 hops), Aspire.Hosting.OpenAI.Tests (2 hops), Aspire.Hosting.Oracle.Tests (2 hops), Aspire.Hosting.Orleans.Tests (2 hops), Aspire.Hosting.PostgreSQL.Tests (2 hops), Aspire.Hosting.Python.Tests (2 hops), Aspire.Hosting.Qdrant.Tests (2 hops), Aspire.Hosting.RabbitMQ.Tests (2 hops), Aspire.Hosting.Redis.Tests (2 hops), Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Rust.Tests (2 hops), Aspire.Hosting.Seq.Tests (2 hops), Aspire.Hosting.SqlServer.Tests (2 hops), Aspire.Hosting.Valkey.Tests (2 hops), Aspire.Hosting.Yarp.Tests (2 hops), Aspire.Playground.Tests

🧪 tests/Aspire.Hosting.Tests/Backchannel/AuxiliaryBackchannelRpcTargetTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests
→ 3 via the project graph: Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.Radius.Tests

🔧 src/Aspire.Dashboard/Components/Controls/TestingResults.razor (changed source)
→ 3 via the project graph: Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Testing.Tests

📦 affected project Aspire.Hosting.Dotnet
→ 2 tests: Aspire.Cli.EndToEnd.Tests, Aspire.Templates.Tests

🔧 src/Aspire.Dashboard/wwwroot/js/app-dashboard-experience.js (changed source)
→ 1 directly: Infrastructure.Tests
→ 1 via the project graph: Aspire.Dashboard.Tests

🔧 src/Shared/Model/KnownProperties.cs (changed source)
→ 2 via the project graph: Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/JavaScript/DashboardExperience.test.mjs (changed test)
→ 2 directly: Aspire.Dashboard.Components.Tests, Infrastructure.Tests

📦 affected project Aspire.Dashboard
→ 1 test: Aspire.Templates.Tests

📦 affected project Aspire.Hosting
→ 1 test: Aspire.Cli.EndToEnd.Tests

🔧 src/Aspire.Dashboard/Resources/Layout.resx (changed source)
→ 1 directly: Infrastructure.Tests

🔧 src/Shared/DashboardUrls.cs (changed source)
→ 1 via the project graph: Aspire.Cli.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Controls/ResourceDetailsTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Controls/TestingResultsTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Layout/ResourcesLayoutTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Tests/Middleware/DashboardExperienceRedirectMiddlewareTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Model/ResourceViewModelTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Model/TestingResourceGroupTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Hosting.Java.Tests/JUnitCollectorTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Java.Tests

🧪 tests/Aspire.Hosting.Tests/Cli/TestingCollectorTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests

🧪 tests/Aspire.Hosting.Tests/Dashboard/DashboardServiceDataTerminalTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests

🧪 tests/Aspire.Hosting.Tests/ResourceTraitBuilderTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests

🧪 tests/Aspire.Hosting.Tests/Snapshots/TestingCollectorTests.AllPublishedOutcomesRetainExactWireValuesInDashboardSnapshots.verified.json (changed test)
→ 1 directly: Aspire.Hosting.Tests

🧪 tests/Aspire.Hosting.Tests/Snapshots/TestingCollectorTests.CollectorExceptionPreservesPublishedResultsAndWaitsForOtherCollectorsAndResources.verified.json (changed test)
→ 1 directly: Aspire.Hosting.Tests

🧪 tests/Aspire.Hosting.Tests/Snapshots/TestingCollectorTests.LivePublicationIsReplayedAndCompletionJoinsCollectorsAndAllReplicas.verified.json (changed test)
→ 1 directly: Aspire.Hosting.Tests

🧪 tests/Aspire.Hosting.Tests/Snapshots/TestingCollectorTests.ReplacementCallbackRetainsDashboardResultsAndTagsAcrossFreshSnapshots_markerOnly=False.verified.json (changed test)
→ 1 directly: Aspire.Hosting.Tests

🧪 tests/Aspire.Hosting.Tests/Snapshots/TestingCollectorTests.ReplacementCallbackRetainsDashboardResultsAndTagsAcrossFreshSnapshots_markerOnly=True.verified.json (changed test)
→ 1 directly: Aspire.Hosting.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • src/Aspire.Dashboard/Components/Controls/TestingResults.razor, src/Aspire.Dashboard/Components/Controls/TestingResults.razor.cs, src/Aspire.Dashboard/Components/Controls/TestingResults.razor.css, src/Aspire.Dashboard/Components/Layout/DesktopNavMenu.razor.cs, src/Aspire.Dashboard/Components/Layout/MobileNavMenu.razor.cs, src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor, src/Aspire.Dashboard/Components/Layout/ResourcesLayout.razor.cs, src/Aspire.Dashboard/Components/Legacy/Layout/LegacyDesktopNavMenu.razor, src/Aspire.Dashboard/Components/Legacy/Layout/LegacyMobileNavMenu.razor.cs, src/Aspire.Dashboard/Components/Legacy/Pages/Testing.razor, src/Aspire.Dashboard/Components/Pages/Testing.razor, src/Aspire.Dashboard/Components/Pages/Testing.razor.cs, src/Aspire.Dashboard/Model/DashboardExperienceRedirectMiddleware.cs, src/Aspire.Dashboard/Model/ResourceViewModel.cs, src/Aspire.Dashboard/Model/TestingResourceGroup.cs, src/Aspire.Dashboard/Resources/Layout.Designer.cs, src/Aspire.Dashboard/Resources/Layout.resx, src/Aspire.Dashboard/Resources/xlf/Layout.cs.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.de.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.es.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.fr.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.it.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.ja.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.ko.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.pl.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.pt-BR.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.ru.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.tr.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.zh-Hans.xlf, src/Aspire.Dashboard/Resources/xlf/Layout.zh-Hant.xlf, src/Aspire.Dashboard/wwwroot/js/app-dashboard-experience.js, src/Aspire.Hosting/ApplicationModel/ResourceTraitSnapshotProperties.cs, src/Aspire.Hosting/ApplicationModel/TestingAnnotation.cs, src/Aspire.Hosting/Backchannel/AuxiliaryBackchannelRpcTarget.cs, src/Aspire.Hosting/Cli/TestResourceSnapshotPublisher.cs, src/Aspire.Hosting/Cli/TestRunCoordinator.cs, src/Aspire.Hosting/Dashboard/ResourceSnapshot.cs, src/Aspire.Hosting/TestResourceBuilderExtensions.cs
• affected project Aspire.Dashboard
native-dashboard-validation affected project Aspire.Dashboard
polyglot • affected project Aspire.Hosting
• affected project Aspire.Hosting.Azure.Provisioning.KeyVault
typescript-api-compat affected project Aspire.Hosting

Selection computed for commit 07d0855.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@mitchdenny
Mitch Denny (mitchdenny) force-pushed the mitchdenny-java-testing-integration branch from 0b45856 to 825d9ae Compare November 10, 2026 03:29
Mitch Denny (mitchdenny) added a commit that referenced this pull request Nov 26, 2026
…21559)

<!-- copilot-assessment:v1 -->
### Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: `88c7bca539e15ae8d2fd9c2e2903b65919ab7603`

| Dimension | Assessment | Rationale |
|---|---|---|
| Change confidence | 8/10 | ↑ Eight original MSTest patches preserved
on main; follow-ups correct replica wording and accurately distinguish
collection errors from failing cases.<br>↑ Parent8457d04 passed79 MSTest
tests, including real MTP success/failure, two export tests and AppHost
build; no executable code changed since.<br>↓ Restart, temporary cleanup
and deferred arguments remain explicitly accepted nonblocking follow-ups
in #22706, #22707 and #22708; a separate parser-option review finding
remains unaddressed.<br>↓ Final-head CI/native validation is pending or
running; cross-platform/full CLI behavior was not rerun locally. |
<!-- /copilot-assessment -->

## Description

Adds the experimental MSTest layer of the Aspire testing stack:
`AddMsTest`, `MsTestResource : ExecutableResource`, and `MsTestOptions`
in `Aspire.Hosting.Dotnet`. An executable MSTest project composes normal
references, environment variables and waits, and publishes individual
TRX results during `aspire test`. All new hosting testing APIs are
experimental under `ASPIRETESTING001`, with TypeScript export coverage.

Foundation #21527 is merged into main at
`16f52aeb827e6415fa1e1d318a98dcdad607bcc5`. This PR now targets `main`
at that exact revision. Current MSTest head:
`88c7bca539e15ae8d2fd9c2e2903b65919ab7603` on
`mitchdenny-mstest-testing-integration`.

Nov26 documentation follow-ups remove “shared by its replicas” from the
MSTest artifact-directory paragraph, addressing José's review, and
clarify James's failed-summary finding: a failed TRX run summary causes
a collection error only when no individual failing outcome explains it;
with failing cases, collection can complete successfully while the
overall test outcome fails. Both are precise README-only corrections; no
production code, generated API or lifecycle behavior changed. The
commits were pushed with explicit observed-tip leases against
`8457d04b28670374abc750f30749dff74bcb2fc6` and
`382b7f1d3f95c7893eb2aae0c93e936c84ed7177`, respectively. José's and
James's documentation threads are resolved after their respective fixes
were pushed.

Three runtime findings are explicitly nonblocking follow-ups, not fixes
in this PR: Restart ordering #22706, temporary-report cleanup #22707,
and deferred runner arguments #22708. Each issue links its original
James discussion, and each discussion links its issue; those three
threads are resolved with the deferral stated explicitly. A separate
parser-option syntax review finding remains unaddressed by these
documentation/follow-up changes.

Nov26 reconciliation: GitHub had already retargeted and rebased this PR
after the foundation merge. The verified server head
`8457d04b28670374abc750f30749dff74bcb2fc6` contains current main and
exactly the eight intended MSTest patches; `git range-diff` confirms
each patch is identical to the previous head
`cdfe8f543daf1d52b5d51930ce6f7e38ceea73ea`. The owning worktree adopted
that verified server head; no additional rebase was necessary. Existing
non-draft state and native stack #22374 complete membership [#21527,
#21559, #21580, #21585, #21587, #21675], including merged foundation,
were preserved. No unstack/recreate, upper propagation, metadata
changes, merge or auto-merge. Dashboard #21646 remains closed/removed.

Fixes: N/A (feature request; foundation #21527 is merged).

### Usage

```csharp
#pragma warning disable ASPIRETESTING001

builder.AddMsTest("api-tests", "../Api.Tests/Api.Tests.csproj")
    .WithReference(api)
    .WaitFor(api);
```

```typescript
await builder.addMsTest("api-tests", "../Api.Tests/Api.Tests.csproj")
    .withReference(api)
    .waitFor(api);
```

The preview CLI command is disabled by default. Opt in per invocation
without changing global configuration:

```bash
features__testCommandEnabled=true aspire test
```

The project must enable the MTP executable runner and register
`Microsoft.Testing.Extensions.TrxReport`; MSTest.Sdk's Default profile
supplies both. Aspire does not change project dependencies or runner
configuration. Optional configuration, selected target framework and
structured runner argument tokens are supported. Invocation uses `dotnet
run --project <absolute.csproj> --no-launch-profile -- ...`. Ordinary
runs omit Aspire reporting flags and collection; publish excludes the
resource. This initial executable-based integration builds independently
of the AddDotnetProject coordinator; shared build outputs can contend.

### Collection and artifacts

Uses the foundation's runtime-only
`WithTesting(Func<ResourceTestingContext, Task>?)` callback. Repeated
calls replace the callback; marker-only clears collection while
retaining context. Runner setup is independent of that replaceable
callback. Remote callback timeout, connection lifetime, cancellation and
invocation-gate release/reentry behavior come from the foundation.

During test-mode `OnBeforeStart`, the integration resolves AppHost
`IFileSystemService` and allocates a fresh tracked temporary report
directory, then appends reserved MTP reporting arguments. Collection
waits for resource completion before resolving the launch-owned report
path and stages finalized artifacts even after a nonzero exit. The
filesystem service owns temporary cleanup, including failed
startup/disposal, subject to its debugging preservation option.

`context.TestingContext.OutputPath` is the run root;
`context.OutputPath` is the flat logical-resource directory. Only this
invocation's canonical `results.trx` is read. Staging rejects
source/destination links and reparse points, refuses overwrites, and
does not traverse TRX attachment references. Missing/malformed reports
and collector errors fail explicitly; malformed raw artifacts remain
staged. Cancellation interrupts waits and copying. The cumulative
`playground/AspireCliTesting` fixture preserves the foundation
service/probe/cleanup and source-dashboard wiring.

### Outcomes and reporting

Explicit TRX mappings: Passed → Passed, Failed → Failed, NotExecuted →
Skipped, Inconclusive → Inconclusive, Error → Error, Timeout → TimedOut,
Aborted → Cancelled. Only Passed and Skipped are non-failing. Published
TimedOut/Cancelled cases cause ordinary CLI test failure23, not command
timeout17 or interruption130. Unknown/progress-only states are parser
errors. Counter reconciliation and strict identities prevent
double-counting. A failed TRX run summary causes a collection error when
no individual failing outcome explains it, without fabricating cases or
rewriting real Passed/Skipped results; with failing cases, collection
can complete successfully while the overall test outcome fails.

Current MTP serializes timeout rows as Failed, retaining timeout only in
aggregate counters, and collapses error/cancellation into Failed. Those
rows remain Failed: this integration does not infer identities or
recover categories lost upstream from messages/counters. Sources: [TRX
serializer](https://github.com/microsoft/testfx/blob/v4.4.0/src/Platform/Microsoft.Testing.Extensions.TrxReport/TrxReportEngine.Results.cs),
[MTP state
converter](https://github.com/microsoft/testfx/blob/v4.4.0/src/Platform/Microsoft.Testing.Extensions.TrxReport/Streaming/TrxTestResultExtractor.cs),
[TRX
outcomes](https://github.com/microsoft/vstest/blob/main/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs).

The inherited unreleased CLI contract is schemaVersion1: resource-keyed
`testResults` contains independent execution, collector and case
observations; `testSummary` contains the overall outcome and actual
passed/failed/skipped counts. Partial cases survive collection failure;
resource-only observations do not fabricate case counts. Multi-replica
observations are keyed by actual resource ID. Backchannel v1 is
unchanged. The playground artifact lookup is
`testResults[resourceName].outputPath`; previously declined
feature-opt-in README prose was not reintroduced. The inherited
spec/timeout helpers remain unchanged, including proposed-only
AddCargoTest.

### Validation and readiness

Nov26 validated parent `8457d04b28670374abc750f30749dff74bcb2fc6`, macOS
arm64 with the repository SDK: **81 focused tests and cumulative AppHost
build passed**. Final head differs only by José's replica wording and
James's failed-summary README corrections; executable tests were not
repeated solely for those documentation edits. Wording was checked
against the exact `report.Failed && report.Results.All(result =>
result.Outcome is TestOutcome.Passed or TestOutcome.Skipped)` collection
condition; whitespace checks passed.

- `dotnet test --project
tests/Aspire.Hosting.Dotnet.Tests/Aspire.Hosting.Dotnet.Tests.csproj
--no-launch-profile -- --filter-class '*.MsTest*' --filter-not-trait
'quarantined=true'` — passed79, including two explicitly targeted real
isolated MTP pass/fail runners, parser/outcome/counter handling,
staging/link rejection, cancellation, cleanup, callback replacement and
ordinary run/publish behavior.
- `dotnet test --project
tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.csproj
--no-launch-profile -- --filter-method
'*.GeneratesOneAddMsTestMethodWithTypedOptionsAndExecutableCapabilities'
--filter-method
'*.Scanner_WithTesting_ExportsSingleOptionalRuntimeCollector'
--filter-not-trait 'quarantined=true' --filter-not-trait
'outerloop=true'` — passed2; generated API/context/callback exports
unchanged.
- `dotnet build playground/AspireCliTesting/apphost.cs --verbosity
quiet` — passed.

Range-diff confirms all eight original patches unchanged; current main
ancestry, whitespace and clean worktree verified. No RunCommand or
RunCommandStrings diff against current main.

GitHub currently reports MERGEABLE/conflict-free, APPROVED, and BLOCKED
while checks run. The existing approval was submitted on the earlier
patch-identical head and remains retained by GitHub. Final-head
[CI45747652984](https://github.com/microsoft/aspire/actions/runs/45747652984)
is pending,
[native45747652413](https://github.com/microsoft/aspire/actions/runs/45747652413)
and automated review are running; no current-head green CI claim is
made. The earlier parent
[CI45743335067](https://github.com/microsoft/aspire/actions/runs/45743335067)
and
[native45743334822](https://github.com/microsoft/aspire/actions/runs/45743334822)
are historical links, not final-head results. No unconditional
merge-ready claim is made. The foundation is merged, no longer an open
stack prerequisite.

Previous Nov25 head `cdfe8f543daf1d52b5d51930ce6f7e38ceea73ea`, before
the foundation squash merge/server rebase, passed132 focused tests and
the AppHost build. In addition to the same79 MSTest/two export tests
above, `dotnet test --project
tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile --
--filter-class '*.TestRunReporterTests' --filter-not-trait
'quarantined=true' --filter-not-trait 'outerloop=true'` passed51,
including schemaVersion1 resource-keyed reporting, replicas, retained
partial cases and independent execution/collection/case outcomes.
These51 reporter tests were not rerun in the Nov26 reconciliation;
MSTest executable code is unchanged.

Historical evidence, not rerun whole-CLI coverage on this head: Nov23
parent `baf66756d9846c6bc7fb16179ef77c9d00940c20` passed211 focused
tests plus AppHost build, and actual isolated source-CLI pass/fail
invocations verified four passed/zero failed/one skipped (exit0), and
three passed/one failed/one skipped (exit23, MSTest exit2), completed
collection, staged TRX/probe artifacts and persisted-summary equality.
Those historical JSON runs used the transient schemaVersion2 before
correction to1; no compatibility promise is implied. No full CLI
runtime, other guest SDK suite, user AppHost/browser/terminal operation
or global config change was performed for this reconciliation.

### Security assumptions

Runs trusted local test code, not sandboxed workloads. Structured
arguments avoid shell concatenation; reporting redirection, response
files, server mode and retry options are reserved. XML disables
DTD/external resolution, bounds size and validates identities/counters.
Staging rejects links/reparse points, does not traverse attachment
references and never overwrites files. Foundation/CLI owns private
runtime directories; runner files and staged copies use their writer's
permissions, not a per-file0600 guarantee. Process/artifact handling
still needs review.

## Checklist

- Is this feature complete?
  - [ ] Yes. Ready to ship.
  - [x] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [x] Yes
    - If yes, did you have an API Review for it?
      - [ ] Yes
      - [x] No
- Did you add `<remarks />` and `<code />` elements on your triple slash
comments?
      - [x] Yes
      - [ ] No
  - [ ] No
- Does the change make any security assumptions or guarantees?
  - [x] Yes
    - If yes, have you done a threat model and had a security review?
      - [ ] Yes
      - [x] No
  - [ ] No

---------

Co-authored-by: Copilot App <[email protected]>
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