Repository navigation
Fix AngleSharp warning in dashboard component tests - #20360
Conversation
Upgrade bUnit and migrate component tests to its supported APIs. Scope required .NET 11 dependency overrides to the component test project. Co-authored-by: Copilot <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20360Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20360" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The obsolete reflection-based bUnit handler workaround must be removed or concretely justified.
Review effort: Balanced
Findings: None
What changed in this PR
Upgrades dashboard component tests to bUnit 2.11.3, resolving the AngleSharp security advisory and migrating affected test APIs.
Changes:
- Migrates rendering, context, authorization, and disposal APIs to bUnit 2.
- Adds scoped .NET 11 dependency overrides required for restore.
- Updates shared helpers and rendered-component types.
| File | Description |
|---|---|
tests/Directory.Packages.props |
Upgrades bUnit; reassess the now-obsolete private-handler workaround. |
tests/Aspire.Dashboard.Components.Tests/Shared/TestJSObjectReference.cs |
Uses BunitContext. |
tests/Aspire.Dashboard.Components.Tests/Shared/TerminalSetupHelpers.cs |
Migrates terminal helpers. |
tests/Aspire.Dashboard.Components.Tests/Shared/StructuredLogsSetupHelpers.cs |
Updates context type. |
tests/Aspire.Dashboard.Components.Tests/Shared/ResourceSetupHelpers.cs |
Updates resource helpers. |
tests/Aspire.Dashboard.Components.Tests/Shared/MetricsSetupHelpers.cs |
Updates metrics helpers. |
tests/Aspire.Dashboard.Components.Tests/Shared/LayoutSetupHelpers.cs |
Updates layout helpers. |
tests/Aspire.Dashboard.Components.Tests/Shared/InteractionsSetupHelpers.cs |
Migrates rendered-component types. |
tests/Aspire.Dashboard.Components.Tests/Shared/FluentUISetupHelpers.cs |
Migrates Fluent UI helpers. |
tests/Aspire.Dashboard.Components.Tests/Shared/DashboardPageTestContext.cs |
Adopts BunitContext; obsolete reflection workaround must be removed or justified. |
tests/Aspire.Dashboard.Components.Tests/Pages/TracesTests.cs |
Migrates render calls. |
tests/Aspire.Dashboard.Components.Tests/Pages/TraceDetailsTests.cs |
Migrates rendering and disposal. |
tests/Aspire.Dashboard.Components.Tests/Pages/TerminalWindowTests.cs |
Migrates terminal-window tests. |
tests/Aspire.Dashboard.Components.Tests/Pages/StructuredLogsTests.cs |
Migrates structured-log rendering. |
tests/Aspire.Dashboard.Components.Tests/Pages/ResourcesTests.cs |
Migrates resource tests. |
tests/Aspire.Dashboard.Components.Tests/Pages/MetricsTests.cs |
Migrates metrics tests. |
tests/Aspire.Dashboard.Components.Tests/Pages/ConsoleLogsTests.cs |
Migrates console-log tests. |
tests/Aspire.Dashboard.Components.Tests/Pages/ConsoleLogsTerminalTests.cs |
Migrates terminal log tests. |
tests/Aspire.Dashboard.Components.Tests/Layout/TerminalDockWindowTrackingTests.cs |
Migrates window-tracking tests. |
tests/Aspire.Dashboard.Components.Tests/Layout/TerminalDockTests.cs |
Migrates terminal-dock tests. |
tests/Aspire.Dashboard.Components.Tests/Layout/TerminalDockTelemetryTests.cs |
Migrates telemetry rendering. |
tests/Aspire.Dashboard.Components.Tests/Layout/TerminalDockInitializationTests.cs |
Migrates initialization tests. |
tests/Aspire.Dashboard.Components.Tests/Layout/ResourceServiceConnectionProviderTests.cs |
Migrates provider rendering. |
tests/Aspire.Dashboard.Components.Tests/Layout/MobileNavMenuTests.cs |
Migrates navigation rendering. |
tests/Aspire.Dashboard.Components.Tests/Layout/MainLayoutTests.cs |
Migrates layout tests. |
tests/Aspire.Dashboard.Components.Tests/Layout/MainLayoutTerminalTests.cs |
Migrates terminal-layout tests. |
tests/Aspire.Dashboard.Components.Tests/Layout/DashboardDialogProviderTests.cs |
Migrates rendering and disposal. |
tests/Aspire.Dashboard.Components.Tests/Interactions/InteractionsProviderTests.Terminal.cs |
Migrates terminal interaction tests. |
tests/Aspire.Dashboard.Components.Tests/Interactions/InteractionsProviderTests.cs |
Migrates interaction tests. |
tests/Aspire.Dashboard.Components.Tests/GridColumnManagerTests.cs |
Migrates grid rendering. |
tests/Aspire.Dashboard.Components.Tests/Dialogs/SettingsDialogTests.cs |
Migrates settings-dialog tests. |
tests/Aspire.Dashboard.Components.Tests/Dialogs/NotificationEntryComponentTests.cs |
Migrates notification rendering. |
tests/Aspire.Dashboard.Components.Tests/Dialogs/ManageDataDialogTests.cs |
Migrates data-dialog tests. |
tests/Aspire.Dashboard.Components.Tests/Dialogs/InteractionsTerminalDialogTests.cs |
Migrates host rerendering. |
tests/Aspire.Dashboard.Components.Tests/Dialogs/InteractionsInputDialogTests.cs |
Updates rendered-component type. |
tests/Aspire.Dashboard.Components.Tests/Dialogs/InteractionMessageBoxDialogTests.cs |
Migrates dialog-host rendering. |
tests/Aspire.Dashboard.Components.Tests/Dialogs/HelpDialogTests.cs |
Migrates help-dialog rendering. |
tests/Aspire.Dashboard.Components.Tests/Dialogs/FilterDialogTests.cs |
Migrates filter-dialog tests. |
tests/Aspire.Dashboard.Components.Tests/Controls/UserProfileTests.cs |
Migrates authorization and rendering APIs. |
tests/Aspire.Dashboard.Components.Tests/Controls/UrlsColumnDisplayTests.cs |
Migrates URL-display tests. |
tests/Aspire.Dashboard.Components.Tests/Controls/TotalItemsFooterTests.cs |
Migrates footer rendering. |
tests/Aspire.Dashboard.Components.Tests/Controls/TextVisualizerDialogTests.cs |
Migrates visualizer rendering. |
tests/Aspire.Dashboard.Components.Tests/Controls/TerminalWindowButtonTests.cs |
Migrates terminal-button tests. |
tests/Aspire.Dashboard.Components.Tests/Controls/TerminalViewTests.cs |
Migrates terminal-view tests. |
tests/Aspire.Dashboard.Components.Tests/Controls/StructuredLogDetailsTests.cs |
Migrates detail rendering. |
tests/Aspire.Dashboard.Components.Tests/Controls/ResourceSelectTests.cs |
Migrates resource-selector rendering. |
tests/Aspire.Dashboard.Components.Tests/Controls/ResourceDetailsTests.cs |
Migrates resource-detail tests. |
tests/Aspire.Dashboard.Components.Tests/Controls/PlotlyChartTests.cs |
Migrates chart rendering. |
tests/Aspire.Dashboard.Components.Tests/Controls/LogViewerTests.cs |
Migrates log-viewer tests. |
tests/Aspire.Dashboard.Components.Tests/Controls/GenAIVisualizerDialogTests.cs |
Migrates GenAI dialog rendering. |
tests/Aspire.Dashboard.Components.Tests/Controls/ChartFiltersTests.cs |
Migrates chart-filter rendering. |
tests/Aspire.Dashboard.Components.Tests/Controls/AspirePropertyDetailsAccordionItemTests.cs |
Migrates accordion tests. |
tests/Aspire.Dashboard.Components.Tests/Controls/AspireProgressRingTests.cs |
Migrates progress-ring tests. |
tests/Aspire.Dashboard.Components.Tests/Controls/AspireMenuTests.cs |
Migrates menu tests. |
tests/Aspire.Dashboard.Components.Tests/Controls/AspireMenuButtonTests.cs |
Migrates menu-button tests. |
tests/Aspire.Dashboard.Components.Tests/Controls/AspireLogoTests.cs |
Adopts BunitContext and Render. |
tests/Aspire.Dashboard.Components.Tests/Controls/AspireFluentDataGridTests.cs |
Migrates data-grid tests. |
tests/Aspire.Dashboard.Components.Tests/Controls/ApplicationNameTests.cs |
Migrates application-name tests. |
tests/Aspire.Dashboard.Components.Tests/Aspire.Dashboard.Components.Tests.csproj |
Adds scoped .NET 11 package overrides. |
eng/Versions.props |
Defines required .NET 11 package versions. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
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 <[email protected]>
Tests selectorSelects the full PR test matrix + all PR-gated jobs (ALL) — a rule matching 'eng/Versions.props' selects ALL Selection computed for commit |
|
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. |
Mitch Denny (mitchdenny)
left a comment
There was a problem hiding this comment.
Reviewed the full diff against main. The bUnit upgrade addresses the AngleSharp security advisory and the API migration is consistent across the component tests. No blocking correctness, security, performance, or test coverage issues found.
|
✅ No documentation update needed. Step 5 branch taken: Triggered signals (2):
Changed-file evidence: all 60 changed files are either under The PR body itself states: "No production dashboard behavior or public API changes." This is a test-infrastructure/dependency-hygiene fix (upgrading bUnit to resolve a transitive AngleSharp NuGet security advisory in dashboard component tests) with zero user-facing or public-API impact. No documentation update is warranted on microsoft/aspire.dev. |
Backports #20360, #20341, and #20362 to release/13.6. ## Customer Impact Dashboard users can encounter popups that are misaligned, overflow the viewport, or disappear while metric dimensions update. Resource graph context menus may not reopen immediately after dismissal, and terminal auto-fit can move focus away from the active control. ## Testing Validated on the release/13.6 backport branch: 570 Aspire.Dashboard.Components.Tests and 1,892 Aspire.Dashboard.Tests passed, excluding quarantined and outerloop tests. The source changes also include targeted Playwright coverage for resources, terminal, navigation, authentication, accessibility, and popup behavior. `git diff --check` passes. ## Risk Medium. The production changes are localized to Dashboard popup, focus, and component-state behavior with no public API changes, but this combines three related changes and a broad component-test migration. ## Regression? Yes — fixes Dashboard behavior and test regressions introduced by the Fluent UI v5 migration.
Backports #20360, #20341, and #20362 to release/13.6. ## Customer Impact Dashboard users can encounter popups that are misaligned, overflow the viewport, or disappear while metric dimensions update. Resource graph context menus may not reopen immediately after dismissal, and terminal auto-fit can move focus away from the active control. ## Testing Validated on the release/13.6 backport branch: 570 Aspire.Dashboard.Components.Tests and 1,892 Aspire.Dashboard.Tests passed, excluding quarantined and outerloop tests. The source changes also include targeted Playwright coverage for resources, terminal, navigation, authentication, accessibility, and popup behavior. `git diff --check` passes. ## Risk Medium. The production changes are localized to Dashboard popup, focus, and component-state behavior with no public API changes, but this combines three related changes and a broad component-test migration. ## Regression? Yes — fixes Dashboard behavior and test regressions introduced by the Fluent UI v5 migration.
Description
Building and running dashboard component tests reports NU1902 because bUnit 1.36.0 brings in AngleSharp 1.1.2, which is affected by GHSA-pgww-w46g-26qg. Upgrade bUnit to 2.11.3 so the tests resolve AngleSharp 1.8.1 without suppressing the advisory.
A direct AngleSharp 1.5.0 pin with bUnit 1.36.0 was tested first, but caused MissingMethodException failures due to binary incompatibility. Upgrading bUnit avoids that incompatibility.
Validation
-p:WarningsNotAsErrors=CA1826for two existing analyzer diagnostics in MobileNavMenuTests. Those diagnostics remain unchanged; no analyzer suppression was added to the project.git diff --checkpasses.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?