Skip to content

ci: use shared resource group for E2E runs - #460

Open
Wei Weng (weng271190436) wants to merge 16 commits into
mainfrom
ci/shared-e2e-resource-group
Open

Wei Weng (weng271190436) wants to merge 16 commits into
mainfrom
ci/shared-e2e-resource-group

Conversation

@weng271190436

@weng271190436 Wei Weng (weng271190436) commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

What type of PR is this?
/kind test

What this PR does / why we need it:

  • Run E2E scenarios in one pre-created shared resource group instead of creating and deleting an entire resource group per run.
  • Derive run-specific Azure cluster, VNet, identity, registry and workload names while retaining the existing logical kubeconfig contexts; support the performance topology as well.
  • Fix AKS admin context creation in setup and cleanup: Azure CLI adds the -admin suffix automatically.
  • Verify run ownership, AKS node groups, controller profiles, role assignments and VNet peerings during per-run cleanup; never delete the shared resource group. Refuse cleanup when ownership cannot be established.
  • Update Azure DevOps to use unique run IDs, isolated kubeconfigs and unconditional log collection and per-resource cleanup; remove the GitHub Actions E2E workflow. For AFD, read the test principal object ID from the E2E_TEST_PRINCIPAL_ID pipeline variable; keep it aligned with the selected service connection.

Which issue(s) this PR fixes:
No linked issue.

Requirements:

  • Uses conventional commit messages.
  • Includes documentation and focused offline tests.
  • make reviewable (not run; targeted checks below).

How has this code been tested

  • GOTOOLCHAIN=go1.26.10 go test -count=1 ./test/scripts ./test/e2e/framework
  • GOTOOLCHAIN=go1.26.10 go vet ./test/scripts ./test/e2e/framework
  • Offline tagged E2E helper tests and go vet; E2E and performance suites compiled without running live suites.
  • Azure CLI option metadata checks, Bash syntax checks, Azure DevOps workflow YAML parse and git diff --check.
  • A separately approved live Azure DevOps E2E run was started; no live pass is claimed yet.

Special notes for your reviewer

  • This is an intentional behavior change: setup requires the pre-created shared RG and scoped permissions; cleanup removes only run-owned resources.
  • Contributor on the shared RG is not a security boundary between runs. Subscription-scoped conditioned delegation still permits granting specified roles elsewhere in the subscription.
  • Cleanup can fail closed and leave resources requiring operator follow-up; there is no stale-run sweeper.
  • Setup does not check for existing kubeconfig contexts or reused run IDs; callers must avoid collisions.

Wei Weng and others added 9 commits November 24, 2026 19:11
Add opt-in run-specific resource naming, scoped role grants, and ownership-verified per-run cleanup while preserving disposable resource group behavior by default.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove disposable resource group setup and the shared-mode flag, update both workflows, preserve the performance topology, and resolve the AFD caller identity without a separate parameter.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep separate tests for appImage and UniqueTestNamespace, including their missing-configuration behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Describe the required group tags without requiring a specific resource group name.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep Azure DevOps as the E2E pipeline and remove the workflow-specific test and setup output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Read the service principal object ID from Azure DevOps configuration instead of decoding an access token.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread test/scripts/afd_test.go
}
}
}
contents := readAFDFile(t, filepath.Join("..", "..", ".github", "workflows", "e2e-tests.yml"))

@weng271190436 Wei Weng (weng271190436) Nov 24, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removing the github workflow so this is no longer needed. This test was just parsing and checking a github action yaml, not testing AFD shared vnet feature

Wei Weng and others added 3 commits November 24, 2026 20:18
Run log collection and per-resource cleanup unconditionally without requiring a setup marker.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pass the unsuffixed context name to az aks get-credentials because Azure CLI appends -admin for admin credentials. Cover setup, performance setup and cleanup with an offline regression test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.62%. Comparing base (58e51b6) to head (1ebace1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #460      +/-   ##
==========================================
+ Coverage   76.54%   76.62%   +0.07%     
==========================================
  Files          77       77              
  Lines        7669     7669              
==========================================
+ Hits         5870     5876       +6     
+ Misses       1387     1382       -5     
+ Partials      412      411       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Wei Weng and others added 3 commits November 24, 2026 20:46
Record approved cleanup and clarify Azure CLI admin context naming.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Read the full Docker log stream while checking for the disabled controller message, preserving failure when it is absent.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants