Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,12 @@ private async Task UpgradeFromGaToDevDoesNotDuplicateStorageAccountsCore(Cancell
output.WriteLine("Step 5: Creating single-file AppHost with GA CLI...");
await auto.TypeAsync("aspire init");
await auto.EnterAsync();
// Wait for and dismiss the language selection (auto-selected or prompt)
await auto.WaitAsync(TimeSpan.FromSeconds(5));
await auto.EnterAsync();

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

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

The new WaitAsync(5s) + EnterAsync() is timing-based and can send input at the wrong time (or too early/late) if the language selection prompt is slower/faster, making this test flaky. Other E2E tests typically WaitUntilTextAsync("Which language would you like to use?") before sending Enter. Consider waiting for the actual prompt text (or for the success/agent-init prompt if it auto-selects) instead of sleeping.

Suggested change
// Wait for and dismiss the language selection (auto-selected or prompt)
await auto.WaitAsync(TimeSpan.FromSeconds(5));
await auto.EnterAsync();
// Wait for and dismiss the language selection when it is shown.
// Some CLI flows may auto-select the language and skip this prompt.
try
{
await auto.WaitUntilTextAsync("Which language would you like to use?", timeout: TimeSpan.FromSeconds(30));
await auto.EnterAsync();
}
catch
{
// Continue when the language prompt is auto-skipped.
}

Copilot uses AI. Check for mistakes.
await auto.WaitUntilTextAsync("Aspire initialization complete", timeout: TimeSpan.FromMinutes(2));
// The CLI may show a "Select a template version" prompt — dismiss it
await auto.WaitUntilTextAsync("based on NuGet.config", timeout: TimeSpan.FromSeconds(60));
await auto.EnterAsync();
await auto.DeclineAgentInitPromptAsync(counter);

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

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

This step is described as a prompt that "may" appear, but the code unconditionally waits for based on NuGet.config and presses Enter. If the CLI auto-selects a template version (no prompt), this will time out and fail/hang. Consider waiting for either the version prompt OR the next expected prompt (agent-init or shell success prompt), and only sending Enter when the version prompt is actually present.

Copilot uses AI. Check for mistakes.

// Step 6: Add ACA package using GA CLI (uses GA NuGet packages)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private async Task DeployStarterWithManagedRedisToAzureContainerAppsCore(Cancell
.Find($"Enter the project name ({workspace.WorkspaceRoot.Name}): ");

var waitingForOutputPathPrompt = new CellPatternSearcher()
.Find("Enter the output path:");
.Find("Enter the output path");

var waitingForUrlsPrompt = new CellPatternSearcher()
.Find("Use *.dev.localhost URLs");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,17 @@ private async Task DeployPythonStarterWithPurgeTaskCore(CancellationToken cancel
await auto.PrepareEnvironmentAsync(workspace, counter);

// Step 2: Set up CLI environment (in CI)
// Python apphosts need the full bundle because
// the prebuilt AppHost server is required for aspire new with Python templates.
if (DeploymentE2ETestHelpers.IsRunningInCI)
{
output.WriteLine("Step 2: Using pre-installed Aspire CLI from local build...");
await auto.SourceAspireCliEnvironmentAsync(counter);
var prNumber = DeploymentE2ETestHelpers.GetPrNumber();
if (prNumber > 0)
{
output.WriteLine($"Step 2: Installing Aspire bundle from PR #{prNumber}...");
await auto.InstallAspireBundleFromPullRequestAsync(prNumber, counter);
}
await auto.SourceAspireBundleEnvironmentAsync(counter);
}

// Step 3: Create Python FastAPI project using aspire new
Expand All @@ -95,7 +102,7 @@ private async Task DeployPythonStarterWithPurgeTaskCore(CancellationToken cancel
await auto.TypeAsync("aspire add Aspire.Hosting.Azure.AppContainers");
await auto.EnterAsync();

if (DeploymentE2ETestHelpers.IsRunningInCI)
if (DeploymentE2ETestHelpers.IsRunningInCI && DeploymentE2ETestHelpers.GetPrNumber() <= 0)
{
await auto.WaitUntilTextAsync("(based on NuGet.config)", timeout: TimeSpan.FromSeconds(60));
await auto.EnterAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,17 @@ private async Task DeployPythonFastApiTemplateToAzureAppServiceCore(Cancellation
await auto.PrepareEnvironmentAsync(workspace, counter);

// Step 2: Set up CLI environment (in CI)
// Python apphosts need the full bundle because
// the prebuilt AppHost server is required for aspire new with Python templates.
if (DeploymentE2ETestHelpers.IsRunningInCI)
{
output.WriteLine("Step 2: Using pre-installed Aspire CLI from local build...");
await auto.SourceAspireCliEnvironmentAsync(counter);
var prNumber = DeploymentE2ETestHelpers.GetPrNumber();
if (prNumber > 0)
{
output.WriteLine($"Step 2: Installing Aspire bundle from PR #{prNumber}...");
await auto.InstallAspireBundleFromPullRequestAsync(prNumber, counter);
}
await auto.SourceAspireBundleEnvironmentAsync(counter);
}

// Step 3: Create Python FastAPI project using aspire new with interactive prompts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,17 @@ private async Task DeployPythonFastApiTemplateToAzureContainerAppsCore(Cancellat
await auto.PrepareEnvironmentAsync(workspace, counter);

// Step 2: Set up CLI environment (in CI)
// Python apphosts need the full bundle because
// the prebuilt AppHost server is required for aspire new with Python templates.
if (DeploymentE2ETestHelpers.IsRunningInCI)
{
output.WriteLine("Step 2: Using pre-installed Aspire CLI from local build...");
await auto.SourceAspireCliEnvironmentAsync(counter);
var prNumber = DeploymentE2ETestHelpers.GetPrNumber();
if (prNumber > 0)
{
output.WriteLine($"Step 2: Installing Aspire bundle from PR #{prNumber}...");
await auto.InstallAspireBundleFromPullRequestAsync(prNumber, counter);
}
await auto.SourceAspireBundleEnvironmentAsync(counter);
}

// Step 3: Create Python FastAPI project using aspire new with interactive prompts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,27 +86,12 @@ private async Task DeployTypeScriptVnetSqlServerInfrastructureCore(CancellationT
// Step 3: Create TypeScript AppHost using aspire init
output.WriteLine("Step 3: Creating TypeScript AppHost with aspire init...");

var waitingForNuGetConfigPrompt = new CellPatternSearcher()
.Find("NuGet.config");
var waitingForInitComplete = new CellPatternSearcher()
.Find("Aspire initialization complete");

await auto.TypeAsync("aspire init --language typescript");
await auto.EnterAsync();

// NuGet.config prompt may or may not appear depending on environment.
await auto.WaitUntilAsync(
s => waitingForNuGetConfigPrompt.Search(s).Count > 0
|| waitingForInitComplete.Search(s).Count > 0,
timeout: TimeSpan.FromMinutes(2),
description: "NuGet.config prompt or init completion");
await auto.EnterAsync(); // Dismiss NuGet.config prompt if present

await auto.WaitUntilAsync(
s => waitingForInitComplete.Search(s).Count > 0,
timeout: TimeSpan.FromMinutes(2),
description: "aspire initialization complete");

// When using bundle install, the CLI auto-selects the package version
// from the local hive without showing a NuGet.config prompt.
// Go straight to waiting for the agent init prompt / success prompt.
await auto.DeclineAgentInitPromptAsync(counter);

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

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

By removing the optional NuGet/template-version prompt handling here, the test now assumes aspire init --language typescript always proceeds directly to the agent-init prompt/success prompt. If the CLI shows an intermediate prompt (e.g., NuGet.config/template version selection in some environments), DeclineAgentInitPromptAsync will never see the expected prompt and the test can hang. Consider restoring a conditional wait that accepts either (a) the intermediate prompt and dismisses it, or (b) the agent-init/success prompt, so both bundle and non-bundle/local runs stay reliable.

Copilot uses AI. Check for mistakes.
// Step 4a: Add Aspire.Hosting.Azure.AppContainers
Expand Down
Loading