Skip to content

Isolate AKS destroy tests from the real Helm runner - #20057

Merged
Mitch Denny (mitchdenny) merged 2 commits into
mainfrom
jamesnk/fix-aks-destroy-test-helm
Sep 11, 2026
Merged

Mitch Denny (mitchdenny) merged 2 commits into
mainfrom
jamesnk/fix-aks-destroy-test-helm

Conversation

@JamesNK

Copy link
Copy Markdown
Member

Description

Two AKS destroy-pipeline tests timed out in Windows CI. They fake Azure CLI responses and persist a Helm release, but leave the real Helm runner registered. Destroy therefore invokes a machine-installed Helm against a fake kubeconfig instead of remaining isolated from external tools.

Register the existing FakeHelmRunner in both tests and assert the Helm version probe and uninstall arguments, including the generated isolated kubeconfig path. Keep the existing 10-second timeout and the real destroy-pipeline target.

This is a test-only fix, independent of the Dashboard AOT work in #19565. The affected tests originated in #19243. This branch contains only this fix, cherry-picked onto latest main (9c2af96f91).

Validation

  • Both originally failing tests passed on Windows.
  • All 110 regular Aspire.Hosting.Azure.Kubernetes.Tests tests passed on the latest-main branch (net8.0), excluding quarantined and outerloop tests.
  • git diff --check passed.

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

Or

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

@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot September 11, 2026 01:01
@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 11, 2026
@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.

🟢 Approval recommended

No unresolved blocking issues were identified.

Pull request overview

This test-only PR isolates AKS destroy tests from machine-installed Helm by using FakeHelmRunner.

Changes:

  • Registers the fake Helm runner in both tests.
  • Verifies version probing and uninstall arguments, including the isolated kubeconfig.
File summaries
File Summary
tests/Aspire.Hosting.Azure.Kubernetes.Tests/AzureKubernetesInfrastructureTests.cs Updates AKS destroy tests with isolated Helm execution and argument assertions.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

1 / 99 PR test projects · 0 PR jobs · 0 advisory-only targets, from 7 changed files.

Selected PR test projects (1 / 99)

Aspire.Hosting.Azure.Kubernetes.Tests

Selected PR jobs (0)

none

Advisory workflow impact (0)

none


How these were chosen — grouped by what changed

🧪 tests/Aspire.Hosting.Azure.Kubernetes.Tests/AzureKubernetesEnvironmentExtensionsTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.Kubernetes.Tests

🧪 tests/Aspire.Hosting.Azure.Kubernetes.Tests/AzureKubernetesFoundryReferenceTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.Kubernetes.Tests

🧪 tests/Aspire.Hosting.Azure.Kubernetes.Tests/AzureKubernetesHelmChartTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.Kubernetes.Tests

🧪 tests/Aspire.Hosting.Azure.Kubernetes.Tests/AzureKubernetesInfrastructureTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.Kubernetes.Tests

🧪 tests/Aspire.Hosting.Azure.Kubernetes.Tests/AzureKubernetesIngressTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.Kubernetes.Tests

🧪 tests/Aspire.Hosting.Azure.Kubernetes.Tests/AzureKubernetesPersistentVolumeTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.Kubernetes.Tests

🧪 tests/Aspire.Hosting.Azure.Kubernetes.Tests/AzureKubernetesTestBuilder.cs (changed test)
→ 1 directly: Aspire.Hosting.Azure.Kubernetes.Tests

Job reasons

none


Selection computed for commit 5409b2e.

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 unresolved issues were identified that would block approval.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@mitchdenny
Mitch Denny (mitchdenny) merged commit 6c7c3ff into main Sep 11, 2026
42 checks passed
@mitchdenny
Mitch Denny (mitchdenny) deleted the jamesnk/fix-aks-destroy-test-helm branch September 11, 2026 05:04
@github-actions github-actions Bot added this to the 13.6 milestone Sep 11, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

Step 5 branch taken: docs_required → false positive, nothing to document (per Step 10 exception: on inspection, the triggering signal did not correspond to a real Aspire user-facing feature).

Triggered signals (1): pr_body_has_cli_flag_mention — evidence hint: "tests. - git diff --check passed. Fixes # (issue) ## Checklist - Is this feature". This matched the pattern used to detect long-form --flag mentions in the PR body, but the actual text is the validation step git diff --check (a routine git command run by the author to confirm no line-ending/whitespace issues), not a new or changed Aspire CLI flag/option.

Why there is nothing to document:

  • All 7 changed files are under tests/Aspire.Hosting.Azure.Kubernetes.Tests/ (test-only fix, matches only_test_or_build_changes = true).
  • The PR isolates two AKS destroy-pipeline tests from a real, machine-installed Helm runner by registering the existing FakeHelmRunner fake, and asserts on Helm version-probe/uninstall arguments and the isolated kubeconfig path.
  • No production source under src/ changed, no new/changed public API, no new CLI command/option, no dashboard, container-image, template, or diagnostic changes.
  • This is an internal test-infrastructure hardening change with zero impact on documented or undocumented user-facing behavior.

No documentation PR is warranted for this change.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ CI Failure Analysis: Possible Flaky Test(s)

The CI build failed due to test failure(s) that appear unrelated to the PR changes. These may be flaky tests.

Suspected flaky test(s):

  • Aspire.Cli.Tests.Commands.SdkDumpCommandTests.SdkDumpCi_ForHostingProject_DoesNotEmitWarnings in job Cli (macos-latest)
    • Error: Microsoft.DotNet.RemoteExecutor.RemoteExecutionException : Remote process failed with an unhandled exception. Child exception: Xunit.Sdk.EqualException: Assert.Equal() Failure: Values differ Expected: 0 Actual: 6
    • Stack Trace (first frames):
      at Aspire.Cli.Tests.Commands.SdkDumpCommandTests.<>c.<<SdkDumpCi_ForHostingProject_DoesNotEmitWarnings>b__18_0>d.MoveNext() in /Users/runner/work/aspire/aspire/tests/Aspire.Cli.Tests/Commands/SdkDumpCommandTests.cs:line 280 --- End of stack trace from previous location --- at Microsoft.DotNet.RemoteExecutor.Program.Main(String[] args) in /_/src/Microsoft.DotNet.RemoteExecutor/src/Program.cs:line 65
      
    • Why likely flaky: Test asserts that dotnet build of Aspire.Hosting.csproj emits 0 warnings, but got 6 warnings. PR does not touch Aspire.Hosting or Aspire.Cli code, only Azure.Kubernetes hosting tests. Matches known recurring flaky cause with 3 prior occurrences (issue [CI Failure] Flaky: SdkDumpCommandTests.SdkDumpCi_ForHostingProject_DoesNotEmitWarnings fails because dotnet build of Aspire.Hosting.csproj emits unexpected warnings, unrelated to PR changes #20029).
  • Aspire.Cli.Tests.Commands.SdkDumpCommandTests.SdkDumpCi_ForHostingProject_DoesNotEmitWarnings in job Cli (windows-latest)
    • Error: Microsoft.DotNet.RemoteExecutor.RemoteExecutionException : Remote process failed with an unhandled exception. Child exception: Xunit.Sdk.EqualException: Assert.Equal() Failure: Values differ Expected: 0 Actual: 6
    • Stack Trace (first frames):
      at Aspire.Cli.Tests.Commands.SdkDumpCommandTests.<>c.<<SdkDumpCi_ForHostingProject_DoesNotEmitWarnings>b__18_0>d.MoveNext() in D:\a\aspire\aspire\tests\Aspire.Cli.Tests\Commands\SdkDumpCommandTests.cs:line 280 --- End of stack trace from previous location --- at Microsoft.DotNet.RemoteExecutor.Program.Main(String[] args) in /_/src/Microsoft.DotNet.RemoteExecutor/src/Program.cs:line 65
      
    • Why likely flaky: Same recurring warning-count mismatch failure as the macOS job, unrelated to PR changes. Matches known recurring flaky cause with 3 prior occurrences (issue [CI Failure] Flaky: SdkDumpCommandTests.SdkDumpCi_ForHostingProject_DoesNotEmitWarnings fails because dotnet build of Aspire.Hosting.csproj emits unexpected warnings, unrelated to PR changes #20029).

Suggested actions:

  • Re-run the failed CI jobs to confirm if the failure is intermittent
  • If the test continues to fail, consider quarantining it using /quarantine-test <test name> <issue URL>
  • Search existing issues to see if this test is already known to be flaky

You can re-run the failed jobs from the workflow run page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants