Skip to content

WIP test: share single HCP cluster across SRE admin API E2E tests - #6677

Open
Gerd Oberlechner (geoberle) wants to merge 1 commit into
Azure:mainfrom
geoberle:e2e/shared-sre-cluster-setup
Open

WIP test: share single HCP cluster across SRE admin API E2E tests#6677
Gerd Oberlechner (geoberle) wants to merge 1 commit into
Azure:mainfrom
geoberle:e2e/shared-sre-cluster-setup

Conversation

@geoberle

Copy link
Copy Markdown
Collaborator

What

The three admin API tests (breakglass, serial console, boot diagnostics) each provisioned their own HCP cluster independently. Wrap them in an Ordered Context with a shared BeforeAll that creates one cluster and one worker nodepool, eliminating two redundant cluster provisions per suite run.

Why

Testing

Testing is required for feature completion and tests should be part of the pull
request along with the feature changes.

Describe the testing provided. If you did not add tests, provide a clear
justification.

Special notes for your reviewer

PR Checklist

  • PR is scoped to a single task (no mixed concerns)
  • Title follows Conventional Commits format
  • Summary explains the "Why" behind the change
  • Linked to relevant ticket/issue
  • Screenshots included (if graph/UI/metrics changes)
  • Self-reviewed the diff
  • CI/CD checks are passing (ignore Tide)
  • Draft PR used for WIP (if applicable)
  • Commit history is clean (rebased/squashed)
  • Tricky code blocks are commented
  • Specific reviewers tagged
  • All comment threads resolved before merge

If E2E tests are included:

  • E2E tests follow Principles of Good E2E Test Case Design
  • If new E2E use case is covered (via a new test or new check/verifier),
    demonstrate that the test is able to detect a defect/error and fail with
    proper error message and logs which communicates nature of the problem.

The three admin API tests (breakglass, serial console, boot diagnostics)
each provisioned their own HCP cluster independently. Wrap them in an
Ordered Context with a shared BeforeAll that creates one cluster and
one worker nodepool, eliminating two redundant cluster provisions per
suite run.
Copilot AI lite review requested due to automatic review settings August 25, 2026 13:52
@openshift-ci

openshift-ci Bot commented Aug 25, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: geoberle

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@geoberle Gerd Oberlechner (geoberle) changed the title test: share single HCP cluster across SRE admin API E2E tests WIP test: share single HCP cluster across SRE admin API E2E tests Aug 25, 2026

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.

Pull request overview

This PR refactors SRE admin API E2E tests to share one HCP cluster and worker nodepool across three scenarios.

Changes:

  • Adds ordered shared setup with BeforeAll.
  • Reuses shared cluster, nodepool, and identity state.
  • Consolidates setup for breakglass, serial console, and boot diagnostics tests.
Suppressed comments (3)

test/e2e/admin_api.go:38

  • Even after fixing cleanup, Ordered makes these three checks one failure domain: when an earlier spec fails, Ginkgo skips later specs. A breakglass regression would therefore suppress the independent serial-console and boot-diagnostics checks, contrary to the self-contained test requirement in test/AGENTS.md:29-30,467. Keep the specs independent, or continue ordered execution after failures and make each spec safe after preceding mutations.
	Context("admin API", Ordered,

test/e2e/admin_api.go:59

  • Constructing the test context during spec registration also runs setupAzureLogging before any It is executing. That installs a process-global Azure SDK log listener for this context, but later tests' NewTestContext calls replace it; by the time this ordered context runs, its Azure logs can be written to another test's file (or the closed file from the preceding test), so the admin API diagnostics are lost/misattributed. The shared setup needs a runtime context initialization that binds logging for this ordered scope, or the framework must explicitly support shared contexts.
			tc := framework.NewTestContext()

test/e2e/admin_api.go:61

  • run-suite does not execute these leaf specs in one Ginkgo process: aro-hcp-tests documents that openshift-tests-extension launches each spec in a separate run-test worker (test/cmd/aro-hcp-tests/main.go:172-176, 434-437). As a result, this BeforeAll and its variables are recreated per worker, so CI still provisions one cluster per test and Ordered cannot provide cross-test ordering. To share setup, these checks need to be one leaf spec or use a runner-level/shared-resource mechanism.
			BeforeAll(func(ctx context.Context) {

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

Comment thread test/e2e/admin_api.go
By("testing error case: boot diagnostics disabled")
err = tc.DisableVMBootDiagnostics(ctx, managedResourceGroupName, vmName)
Expect(err).NotTo(HaveOccurred(), "failed to disable boot diagnostics on VM %q", vmName)
BeforeAll(func(ctx context.Context) {
@openshift-ci

openshift-ci Bot commented Aug 25, 2026

Copy link
Copy Markdown

Gerd Oberlechner (@geoberle): The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/verify 0d881db link true /test verify
ci/prow/test-unit 0d881db link true /test test-unit
ci/prow/e2e-parallel 0d881db link true /test e2e-parallel

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants