Repository navigation
[automated] test(templates): Fix child-project SDK isolation and dashboard checks - #21423
Conversation
Local starter-template validation can fail with an unexpected __dotnet-project-build resource when AppHost runtime builds inherit the repository's MSBuild SDK paths. Apply the existing SDK-path cleanup to AppHost launches before fixture overrides. Discover project endpoints through project metadata rather than the legacy resource type. Fixes microsoft#21413 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21423Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21423" |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the template-test harness changes.
No open issues 🎉
What changed in this PR
Updates the template-test harness to keep AppHost coordinated builds on the isolated test SDK, addressing the startup failure reported in #21413.
Changes:
- Removes inherited MSBuild SDK paths before applying fixture environment overrides when launching AppHosts.
- Identifies project resources by metadata when collecting endpoints, supporting the current resource implementation.
- Documents SDK-path cleanup for both command helpers and AppHost launches.
| File | Description |
|---|---|
tests/Shared/TemplatesTesting/data/EndPointWriterHook_cs |
Selects endpoint-bearing project resources using project metadata. |
tests/Shared/TemplatesTesting/AspireProject.cs |
Applies existing MSBuild environment cleanup before AppHost fixture overrides. |
tests/Aspire.Templates.Tests/README.md |
Documents isolated-SDK handling for coordinated project builds. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Heads-up for the Templates outerloop failures (
The same stale locator broke 🤖 Posted by AspireAgent (AI Agent) |
|
Copilot resolve the merge conflicts in this pull request |
…21656) ## Description `DashboardUrlTests.DashboardDisplaysResourceUpdatesWhileAppHostIsPausedAtBreakpoint` has failed in every scheduled Outerloop run on `main` since #21412 ("Modernize the dashboard experience") made the Cards layout the default resources view. Before #21412 it passed 12 of 12 runs; since then it has failed 2 of 2 ([41158473015](https://github.com/microsoft/aspire/actions/runs/41158473015), [41263841334](https://github.com/microsoft/aspire/actions/runs/41263841334)). **Root cause:** the test waits for `tr.resource-row`, the legacy grid row. The default view now renders each resource as `<article class="resource-card" aria-label="{name}">` (`ApplicationSummary.razor`), so the locator never matches. The aria snapshot in the CI failure shows the card already displaying `dashboard-test-resource … State Dashboard test initial`. The product is fine; only the locator is stale. **Fix:** locate the resource card by its exact `aria-label`. The state is still read from `.state-column-cell`, because the card renders the same `StateColumnDisplay` component the grid did. Both state assertions are unchanged: the initial custom state, then the updated state published while the AppHost is held at the breakpoint. There are no sleeps, retries, or relaxed timeouts. Fixes #21655 ### Validation - **Before the fix (`main` at 1bccada), locally with real DCP, the dashboard, and headless Chromium:** fails the same way as CI, `Locator expected to be visible … waiting for Locator("tr.resource-row")…`. The snapshot shows the Cards region containing `dashboard-test-resource … Dashboard test initial`. - **After the fix:** passes in about 30s. It passed **50 of 50** consecutive local runs (27–33s each). - **Outerloop CI on this branch:** I dispatched [run 41310885927](https://github.com/microsoft/aspire/actions/runs/41310885927) on 7b9e3a3. - `outerloop_tests / Hosting.Testing (ubuntu-latest)` passed ([job 124868319332](https://github.com/microsoft/aspire/actions/runs/41310885927/job/124868319332): total 1, succeeded 1, skipped 0). That job runs only this outerloop test; on `main` it reports total 1, failed 1. - `Hosting.Testing (windows-latest)` also passed. - I then cancelled the run. Its remaining Templates and Radius jobs fail on every scheduled `main` run for unrelated, already-tracked reasons (#21413/#21423, MongoDB family). - Because of that cancellation, the run's `Final Results` check shows as failed on this commit. It is not one of this PR's required checks. ### Out of scope `TemplateTestsBase.CheckDashboardHasResourcesActualAsync` (`.main-grid tr.resource-row`) reads the same legacy grid and affects the Templates outerloop tests. That path is tracked by #21413/#21423. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] 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? - [ ] Yes - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - [x] No **🤖 Posted by AspireAgent (AI Agent)** Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Integrate current main while retaining its IDotnetProgramResource endpoint discovery. Keep AppHost child builds on the isolated SDK and update dashboard resource checks for the default cards layout. Add browser regression coverage without relaxing resource assertions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
End-to-end .NET 10/11 starter-template validation with isolated SDKs and the live dashboard remains outstanding, while the focused cleanup and synthetic-markup tests do not establish that the coordinated-build failure is resolved.
No open issues 🎉
Review effort: Balanced
Sébastien Ros (sebastienros)
left a comment
There was a problem hiding this comment.
Approving. The SDK path cleanup runs before the fixture overrides and configureProcess, and I checked the new selectors against the dashboard's card markup. __dotnet-project-build also finishes and hides before the page opens on a successful build, because AppHost startup waits for it, so the unknown-resource check won't trip there.
The two comments are minor and fine as a follow-up: one low-rate flake and one misleading timeout. I reviewed the code only and did not run the tests. As the description says, the starter scenarios still need to pass against a real dashboard, so the next outerloop run is the check for #21413.
|
Please hold this PR until the dashboard checks are retargeted: #21759, also approved, removes the Cards layout these checks now depend on. Once both are in, The simplest order is to merge #21759 first, then update this PR before it merges:
The SDK isolation changes in this PR aren't affected. |
Keep the sidebar/details helper and real-dashboard coverage from microsoft#21759, remove obsolete card-only tests, and preserve the template SDK isolation fix. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Validation covered only dictionary cleanup, leaving starter-template startup and coordinated child-project builds unverified in CI with isolated .NET 10/.NET 11 SDKs, including the reported macOS/.NET 11 scenario.
No open issues 🎉
Review effort: Balanced
|
Merged main, including #21759, in e030a1d and kept its shared DashboardResourceAssertions helper. It reads sidebar resource rows and checks sources in the details panel, so source validation is preserved without depending on Cards or sidebar density. Removed the obsolete card implementation and hardcoded-card test, and updated the README and PR description. The real-dashboard TemplateResourceAssertionsTests from #21759 remains the coverage for the replacement. The remaining test-code diff against main is SDK isolation. Local SDK-path cleanup tests passed (2/2); fresh CI is still running, with no failures reported so far. The full starter-template and real-dashboard outerloop scenarios have not been rerun locally. |
Description
Fix starter-template AppHost startup failures caused by inherited repository MSBuild paths.
The AppHost builds its API and frontend child projects before starting those services. Remove inherited
MSBuildSDKsPathandMSBuildExtensionsPathbefore applying fixture and caller overrides, reusing the existing command-helper cleanup so those child builds use the isolated test SDK.Fixes #21413
Dashboard compatibility and related fixes
Merged current
mainthroughd698a4f9cb, including #21759, and resolved the dashboard-helper conflict in favor of its sharedDashboardResourceAssertionsimplementation. It reads names and states from.resource-row[data-resource-name]and validates sources in each resource's details panel, independently of overview layout and sidebar density. Source validation is preserved.Removed this PR's obsolete card-only implementation and synthetic card-HTML test. Real-dashboard coverage now comes from
TemplateResourceAssertionsTestsinAspire.Dashboard.Playwright.Tests, added by #21759, including Resources/Graph navigation and incorrect project/container sources. The README now describes the shared helper rather than the removed Cards layout. The remaining test-code change againstmainis SDK isolation.Endpoint discovery remains unchanged from
main(#21360). #21222 separately fixed Redis output-cache service registration.Validation
Local Windows validation after merging
mainand resolving conflicts:Result: passed; provisioned the pinned SDK and restored the repository. Restore reported existing package vulnerability warnings.
Result: 2 passed, zero failed, zero skipped; compiles the template-test project and exercises inherited SDK-path cleanup.
Result: passed.
Fresh CI at
e030a1df833ed17dadf31ac2a53a1dbec2c89053passed:Full .NET 10/.NET 11 starter-template outerloop scenarios and
TemplateResourceAssertionsTestswere not rerun locally. Focused cleanup tests and regular PR CI do not establish that all scheduled starter-template outerloop failures are resolved.An independent GPT-6.1 Sol review at high reasoning effort found no merge blockers and confirmed that Sébastien's layout, card-reordering, and error-badge feedback is addressed by retaining the shared helper from #21759. Both inline threads have been replied to and resolved.
Checklist
<remarks />and<code />elements on your triple slash comments?