-
Notifications
You must be signed in to change notification settings - Fork 856
Switch to fail-fast prompt waits after WaitUntilAsync in CLI E2E tests #15934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,7 +46,7 @@ public async Task AgentCommands_AllHelpOutputs_AreCorrect() | |
| await auto.WaitUntilAsync( | ||
| s => s.ContainsText("mcp") && s.ContainsText("init"), | ||
| timeout: TimeSpan.FromSeconds(30), description: "agent help showing mcp and init subcommands"); | ||
| await auto.WaitForSuccessPromptAsync(counter); | ||
| await auto.WaitForSuccessPromptFailFastAsync(counter); | ||
|
|
||
| // Test 2: aspire agent mcp --help | ||
| await auto.TypeAsync("aspire agent mcp --help"); | ||
|
|
@@ -66,7 +66,7 @@ await auto.WaitUntilAsync( | |
| await auto.WaitUntilAsync( | ||
| s => s.ContainsText("tools") && s.ContainsText("call"), | ||
| timeout: TimeSpan.FromSeconds(30), description: "mcp help showing tools and call subcommands"); | ||
| await auto.WaitForSuccessPromptAsync(counter); | ||
| await auto.WaitForSuccessPromptFailFastAsync(counter); | ||
|
||
|
|
||
| // Test 5: aspire mcp tools --help | ||
| await auto.TypeAsync("aspire mcp tools --help"); | ||
|
|
@@ -186,7 +186,7 @@ public async Task DoctorCommand_DetectsDeprecatedAgentConfig() | |
| await auto.WaitUntilAsync( | ||
| s => s.ContainsText("dev-certs") && s.ContainsText("deprecated") && s.ContainsText("aspire agent init"), | ||
| timeout: TimeSpan.FromSeconds(60), description: "doctor output with deprecated warning and fix suggestion"); | ||
| await auto.WaitForSuccessPromptAsync(counter); | ||
| await auto.WaitForSuccessPromptFailFastAsync(counter); | ||
|
||
|
|
||
| await auto.TypeAsync("exit"); | ||
| await auto.EnterAsync(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,7 +49,7 @@ public async Task Banner_DisplayedOnFirstRun() | |
| await auto.WaitUntilAsync( | ||
| s => s.ContainsText(RootCommandStrings.BannerWelcomeText) && s.ContainsText("Telemetry"), | ||
| timeout: TimeSpan.FromSeconds(30), description: "waiting for banner and telemetry notice on first run"); | ||
| await auto.WaitForSuccessPromptAsync(counter); | ||
| await auto.WaitForSuccessPromptFailFastAsync(counter); | ||
|
||
| await auto.TypeAsync("exit"); | ||
| await auto.EnterAsync(); | ||
|
|
||
|
|
@@ -81,7 +81,7 @@ public async Task Banner_DisplayedWithExplicitFlag() | |
| await auto.WaitUntilAsync( | ||
| s => s.ContainsText(RootCommandStrings.BannerWelcomeText) && s.ContainsText("CLI"), | ||
| timeout: TimeSpan.FromSeconds(30), description: "waiting for banner with version info"); | ||
| await auto.WaitForSuccessPromptAsync(counter); | ||
| await auto.WaitForSuccessPromptFailFastAsync(counter); | ||
|
||
| await auto.TypeAsync("exit"); | ||
| await auto.EnterAsync(); | ||
|
|
||
|
|
@@ -129,7 +129,7 @@ await auto.WaitUntilAsync(s => | |
| // Only return true once the help hint is visible at the end of the output | ||
| return s.ContainsText(HelpGroupStrings.HelpHint); | ||
| }, timeout: TimeSpan.FromSeconds(30), description: "waiting for help output to complete"); | ||
| await auto.WaitForSuccessPromptAsync(counter); | ||
| await auto.WaitForSuccessPromptFailFastAsync(counter); | ||
|
||
| await auto.TypeAsync("exit"); | ||
| await auto.EnterAsync(); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -198,7 +198,7 @@ await auto.WaitUntilAsync(s => | |
| await auto.EnterAsync(); | ||
| } | ||
|
|
||
| await auto.WaitForSuccessPromptAsync(counter); | ||
| await auto.WaitForSuccessPromptFailFastAsync(counter); | ||
|
||
|
|
||
| // Verify the AppHost project does not end up with a version-pinned Redis PackageReference. | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,7 +46,7 @@ public async Task DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted() | |
| await auto.WaitUntilAsync( | ||
| s => s.ContainsText("dev-certs") && s.ContainsText("partially trusted"), | ||
| timeout: TimeSpan.FromSeconds(60), description: "doctor to complete with partial trust warning"); | ||
| await auto.WaitForSuccessPromptAsync(counter); | ||
| await auto.WaitForSuccessPromptFailFastAsync(counter); | ||
|
||
| await auto.TypeAsync("exit"); | ||
| await auto.EnterAsync(); | ||
|
|
||
|
|
@@ -99,7 +99,7 @@ await auto.WaitUntilAsync(s => | |
|
|
||
| return s.ContainsText("certificate is trusted"); | ||
| }, timeout: TimeSpan.FromSeconds(60), description: "doctor to complete with trusted certificate"); | ||
| await auto.WaitForSuccessPromptAsync(counter); | ||
| await auto.WaitForSuccessPromptFailFastAsync(counter); | ||
|
||
| await auto.TypeAsync("exit"); | ||
| await auto.EnterAsync(); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fail-fast prompt detection occurs only after WaitUntilAsync succeeds. If the help command fails before printing the expected text, WaitUntilAsync will still time out. If the intent is to avoid long timeouts on non-zero exits, consider adding an ERR-prompt check inside WaitUntilAsync (or use a helper that fails fast on ERR while waiting for output).