Skip to content

[release/17.0] Stabilize CLI update E2E tests - #22409

Merged
Jose Perez Rodriguez (joperezr) merged 2 commits into
release/17.0from
dev/karolz/release-17-e2e-test-stability
Nov 20, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 2 commits into
release/17.0from
dev/karolz/release-17-e2e-test-stability

Conversation

@karolz-ms

Copy link
Copy Markdown
Contributor

Description

Test-only change for release/17.0. It fixes CLI E2E failures that show up on unrelated release PRs (for example #22401 and #22362). There are no product changes.

1. ConfigSource brownfield adoption test. This ports only the ConfigSourceTestContext test fix from #22182, which is already merged on main and is also part of the open backport #22219. Update_AcceptingConfigurationSourceUpdatesBrownfieldConfiguration assumed the old SDK version and an exact JSON property order. With this change, the test:

  • runs aspire update --yes --nuget-config-dir .
  • sets the expected sdk.version from the AppHost
  • compares the result with JsonNode.DeepEquals

2. Post-update CLI self-update prompt. After the project update, aspire update may ask An update is available for the Aspire CLI. Would you like to update it now? [Y/n]. features.updateNotificationsEnabled does not control this prompt. It appears only when a newer CLI has been published on the selected channel. Four tests blocked on it until they timed out:

  • CentralPackageManagementTests.AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps
  • CentralPackageManagementTests.AspireUpdateRemovesOrphanAppHostPackageVersionWhenSdkAlreadyCurrent
  • ChannelUpdateWorkflowTests.UpdateToStable_TypeScriptSingleFileInit_KeepsConfigChannel
  • ChannelUpdateWorkflowTests.UpdateToStable_TypeScript_PreviewsStablePkgsAndKeepsChannel

The new CliE2EAutomatorHelpers.WaitForAspireUpdateCompletionAsync helper waits until one of three things appears for the current SequenceCounter value:

  • the success prompt
  • the error prompt, which still fails fast
  • the CLI self-update prompt

Only output after the line where the command was typed is considered, so a prompt left on screen by an earlier aspire update in the same test does not count. When the CLI self-update prompt appears, the helper types n without Enter, so no phantom shell command desyncs the counter, and then waits for the success prompt. It does not press Enter blindly or use fixed delays, and it works whether or not the prompt appears. The comments that claimed updateNotificationsEnabled suppresses this prompt have been corrected.

Validation

  • MSBUILDTERMINALLOGGER=false dotnet build tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj -v q -nologo succeeded with 0 warnings and 0 errors.
  • The affected E2E tests were not run locally: they need Docker plus a Linux CLI archive, and Docker isn't available on the authoring machine. The CLI E2E jobs in this PR's CI provide that validation.
  • Root cause comes from the asciinema recordings and TRX files of CI run 44398134189 ([release/17.0] Fix Visual Studio debugging for Azure Functions projects #22401). In all four failures the terminal is blocked at the CLI self-update [Y/n] prompt.

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

Or

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

@github-actions

This comment has been minimized.

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.

🟡 Changes recommended

The success marker’s trailing space cannot match the trimmed idle prompt, causing the initial wait to time out after a successful aspire update when no self-update question appears.

1 open issue
What changed in this PR

This test-only PR aims to stabilize CLI update end-to-end tests on release/17.0, without changing product behavior.

Changes:

  • Makes configuration-source adoption assertions independent of JSON property order and aligns the expected SDK version with the AppHost.
  • Adds a shared completion helper to handle optional CLI self-update prompts in package-management and channel-update tests.
  • Corrects comments about which update prompts the notification setting controls.
File Description
tests/​Aspire.Cli.EndToEnd.Tests/​Helpers/​ConfigSourceTestContext.cs Specifies the NuGet config directory and updates configuration assertions.
tests/​Aspire.Cli.EndToEnd.Tests/​Helpers/​CliE2EAutomatorHelpers.cs Adds update-completion handling for success, failure, and self-update prompts.
tests/​Aspire.Cli.EndToEnd.Tests/​ChannelUpdateWorkflowTests.cs Uses the completion helper and corrects notification comments.
tests/​Aspire.Cli.EndToEnd.Tests/​CentralPackageManagementTests.cs Uses the completion helper across update scenarios and corrects comments.

Review effort: Balanced

@github-actions

This comment has been minimized.

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.

🔵 Needs a closer look

Terminal timing and screen scoping across repeated updates remain unverified because the affected Linux/Docker E2E tests were not run locally and no passing CI results were provided.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Port the ConfigSource E2E test fix from #22182 so brownfield source
adoption no longer assumes a fixed SDK version or JSON property order.

Add WaitForAspireUpdateCompletionAsync, which waits for the aspire update
command to finish and declines the optional post-update CLI self-update
confirmation when it appears. features.updateNotificationsEnabled does not
gate that prompt, so CentralPackageManagementTests and the
ChannelUpdateWorkflowTests stable-preview flow must handle both cases.

Co-authored-by: Copilot App <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

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

Selected PR test projects (1 / 101)

Aspire.Cli.EndToEnd.Tests

Selected PR jobs (0)

none


How these were chosen — grouped by what changed

🧪 tests/Aspire.Cli.EndToEnd.Tests/CentralPackageManagementTests.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/ChannelUpdateWorkflowTests.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2EAutomatorHelpers.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/Helpers/ConfigSourceTestContext.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

Job reasons

none


Selection computed for commit 558e1e5.

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 are identified in the test-only changes to stabilize CLI update end-to-end tests.

No open issues 🎉

Review effort: Balanced

@joperezr
Jose Perez Rodriguez (joperezr) merged commit fe043aa into release/17.0 Nov 20, 2026
164 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants