From ab0b83789b16aca59800f1bebf09d4a4b5ef74f1 Mon Sep 17 00:00:00 2001 From: Damian Edwards Date: Tue, 13 May 2025 16:54:47 -0700 Subject: [PATCH] Test that ensures legacy dashboard token env var is honored Fixes #8487 --- tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs b/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs index f7bb37bcb1c..7d4920db1f3 100644 --- a/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs +++ b/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs @@ -650,15 +650,17 @@ public async Task SpecifyingEnvPortInEndpointFlowsToEnv() } } - [Fact] - public async Task StartAsync_DashboardAuthConfig_PassedToDashboardProcess() + [Theory] + [InlineData(KnownConfigNames.DashboardFrontendBrowserToken)] + [InlineData(KnownConfigNames.Legacy.DashboardFrontendBrowserToken)] + public async Task StartAsync_DashboardAuthConfig_PassedToDashboardProcess(string tokenEnvVarName) { const string testName = "dashboard-auth-config"; var browserToken = "ThisIsATestToken"; var args = new string[] { $"{KnownConfigNames.AspNetCoreUrls}=http://localhost:0", $"{KnownConfigNames.DashboardOtlpGrpcEndpointUrl}=http://localhost:0", - $"{KnownConfigNames.DashboardFrontendBrowserToken}={browserToken}" + $"{tokenEnvVarName}={browserToken}" }; using var testProgram = CreateTestProgram(testName, args: args, disableDashboard: false);