Skip to content

Bind Dashboard integration test listeners to loopback - #22710

Open
James Newton-King (JamesNK) wants to merge 1 commit into
mainfrom
jamesnk/dashboard-test-loopback
Open

James Newton-King (JamesNK) wants to merge 1 commit into
mainfrom
jamesnk/dashboard-test-loopback

Conversation

@JamesNK

Copy link
Copy Markdown
Member

Description

Some Dashboard integration tests listen on all network interfaces, which can trigger a Windows Firewall prompt during local test runs even though the tests don't need inbound connections from other machines.

Keep the wildcard URLs in the test configuration so that the Dashboard still exercises endpoint reporting, but bind the underlying Kestrel sockets to loopback. The tests still use real dynamically assigned ports and verify endpoint accessors, OTLP addresses, and browser-token login URLs. Production behavior and firewall settings are unchanged.

Validation

14 targeted cases passed on Windows; no failures or skips:

.\.dotnet\dotnet.exe test --project .\tests\Aspire.Dashboard.Tests\Aspire.Dashboard.Tests.csproj --no-restore --no-launch-profile -- --filter-method '*.ResolvedEndpointInfo_WildcardAddressesUseLocalhost' --filter-method '*.EndPointAccessors_WildcardUrls_ReportAssignedPorts' --filter-method '*.OtlpEndpointInfo_OnlyExposesEnabledResolvedEndpoints' --filter-method '*.LogOutput_AnyIP_LoginLinkLocalhost' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

Fixes # (issue)

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

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 -- 22710

Or

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

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

1 / 101 PR test projects · 0 PR jobs, from 3 changed files.

Selected PR test projects (1 / 101)

Aspire.Dashboard.Tests

Selected PR jobs (0)

none


How these were chosen — grouped by what changed

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

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

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

Job reasons

none


Selection computed for commit 713f823.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the integration-test loopback-binding changes.

No open issues 🎉

What changed in this PR

This PR limits selected Dashboard integration-test listeners to loopback to avoid Windows Firewall prompts, while preserving wildcard URL configuration for endpoint-reporting coverage. Production behavior is unchanged.

Changes:

  • Adds a shared helper that binds wildcard Kestrel sockets to loopback.
  • Updates startup tests to verify assigned ports and preserved wildcard configuration.
  • Updates browser-token tests to verify loopback binding and matching login-link ports.
File Description
tests/​Aspire.Dashboard.Tests/​Integration/​StartupTests.cs Applies loopback binding and updates endpoint assertions.
tests/​Aspire.Dashboard.Tests/​Integration/​IntegrationTestHelpers.cs Adds the shared wildcard-to-loopback socket-binding helper.
tests/​Aspire.Dashboard.Tests/​Integration/​FrontendBrowserTokenAuthTests.cs Applies the helper and verifies login-link ports match bound endpoints.

Review effort: Balanced

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants