Skip to content

[wip][poc] Add skills and test documentation models#1994

Open
anahas-redhat wants to merge 1 commit into
openshift:mainfrom
anahas-redhat:poc-tests
Open

[wip][poc] Add skills and test documentation models#1994
anahas-redhat wants to merge 1 commit into
openshift:mainfrom
anahas-redhat:poc-tests

Conversation

@anahas-redhat

@anahas-redhat anahas-redhat commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

POC for QE team

Add three Claude Code skills:

  • create-release-plan: generates release testing plans (full/light formats) from repo state, with OCP upgrade matrix, CI job derivation, DAST API list, and test case traceability
  • create-test-case: generates manual test case docs from Ginkgo e2e test files, mapping By() steps to action/verification with oc commands
  • create-test-code: generates e2e test code from manual test case documentation

Add documentation models used by the skills:

  • Release test plans for Kueue 1.4 and 1.5 (full and light formats) serving as templates for future releases
  • Test case docs for admission fair sharing, TLS profile, and visibility on demand serving as reference examples

Summary by CodeRabbit

  • Documentation

    • Added detailed release testing plans and strategies for Kueue 1.4 and 1.5 releases
    • Added test case documentation for admission fair sharing, DRA extended resources, TLS profiles, and visibility API features
    • Added command guides for automated test documentation and release plan generation
  • Tests

    • Expanded end-to-end test coverage with new test suite validating extended resource lifecycle and behavior

Add three Claude Code skills:
- create-release-plan: generates release testing plans (full/light
  formats) from repo state, with OCP upgrade matrix, CI job
  derivation, DAST API list, and test case traceability
- create-test-case: generates manual test case docs from Ginkgo
  e2e test files, mapping By() steps to action/verification with
  oc commands
- create-test-code: generates e2e test code from manual test case
  documentation

Add documentation models used by the skills:
- Release test plans for Kueue 1.4 and 1.5 (full and light formats)
  serving as templates for future releases
- Test case docs for admission fair sharing, TLS profile, and
  visibility on demand serving as reference examples

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 10, 2026
@openshift-ci

openshift-ci Bot commented Jun 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: anahas-redhat
Once this PR has been reviewed and has the lgtm label, please assign maysamacedo for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Walkthrough

This PR adds comprehensive release testing documentation and framework for the Kueue operator. It establishes command specifications for automating test artifact generation, documents four feature test suites (admission fair sharing, DRA Extended Resources, TLS profiles, visibility API) across 19 test scenarios, provides release testing plans for Kueue 1.4 and 1.5 with CI job mappings and upgrade matrices, and includes a working Ginkgo E2E test implementation for DRA behavior validation.

Changes

Kueue Release Testing Documentation and E2E Test Suite

Layer / File(s) Summary
AI Command Documentation Framework
.claude/commands/create-test-case.md, .claude/commands/create-test-code.md, .claude/commands/create-release-plan.md
Three command specifications enabling automated test artifact generation: converting Go E2E tests to markdown test case documentation, converting test case docs back to Go test code with repo pattern learning and convention enforcement, and generating release testing plans from CI job patterns and test mappings.
Test Case Documentation Suite
test/docs/cases/e2e_admission_fair_sharing.md, test/docs/cases/e2e_dra_er_alpha2.md, test/docs/cases/e2e_tls_profile.md, test/docs/cases/e2e_visibility_on_demand.md
Four comprehensive test case specifications covering 19 scenarios: fair sharing priority and resource weight scoring (4 scenarios), DRA Extended Resources DeviceClass lifecycle (4 scenarios), TLS profile propagation and cipher suite validation (5 scenarios), and visibility API pending workload ordering with RBAC constraints (10 scenarios).
Release Testing Plans (Kueue 1.4 and 1.5)
test/docs/plans/kueue-1.4-full.md, test/docs/plans/kueue-1.4-light.md, test/docs/plans/kueue-1.5-full.md, test/docs/plans/kueue-1.5-light.md
Release-specific testing matrices mapping test cases to e2e test files, CI periodic and upgrade job names for multiple OCP versions, upgrade paths (OCP and Kueue version transitions with uninstall scenarios), DAST API scanning scope, bug tracking, identified risks with mitigation, and release readiness exit criteria in both full and light plan variants.
DRA Extended Resources E2E Test Implementation
test/e2e/e2e_dra_er_alpha2_test.go
Ginkgo E2E test suite validating DRA Extended Resources Alpha-2: Scenario 1 verifies non-DRA extended resource path when DeviceClass absent (workload admitted, pod Pending, no ResourceClaim); Scenario 2 confirms late DeviceClass creation triggers scheduler-level DRA activation (pod transitions to Running, ResourceClaim allocated); both scenarios include setup/teardown, log dumping, and resource cleanup via DeferCleanup.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning Test file has unresolved symbol references: missing constant definitions (draDeviceClassName, extendedResourceName, draLogicalResource) and helper functions not defined in file or imports. Add missing constants to const block and define or import helper functions (restoreKueueConfig, applyKueueConfig, setDRAJobCPU, checkWorkloadCondition, verifyClusterQueueReservation).
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title '[wip][poc] Add skills and test documentation models' is directly related to the changeset. The PR adds three Claude Code skills (create-release-plan, create-test-case, create-test-code) and multiple test documentation files (test cases and release plans).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed All test declarations (Describe, When, It) use static strings. Dynamic values appear only in By() step descriptions within test bodies, which are explicitly allowed per instructions.
Microshift Test Compatibility ✅ Passed Test uses only standard Kubernetes and Kueue APIs (no unavailable OpenShift APIs). Runtime Skip checks protect against missing DRA APIs on clusters like MicroShift where DRA is unavailable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The single Ginkgo e2e test added makes no multi-node assumptions. It checks pod transitions and API operations (compatible with SNO) and handles hardware prerequisites via Skip() conditions.
Topology-Aware Scheduling Compatibility ✅ Passed PR adds documentation and E2E test files only, with no deployment manifests, operator code, or controllers that would introduce topology-aware scheduling constraints.
Ote Binary Stdout Contract ✅ Passed Test file e2e_dra_er_alpha2_test.go contains no process-level stdout writes; all fmt calls are within test blocks where output is intercepted. Documentation files are non-executable markdown.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No IPv4 hardcoding, external connectivity, or service calls found. Test uses cluster-local Kubernetes APIs only, compatible with IPv6 and disconnected environments.
No-Weak-Crypto ✅ Passed PR adds test documentation and Go test file with no weak crypto algorithms (MD5, SHA1, DES, RC4), custom implementations, or non-constant-time secret comparisons detected.
Container-Privileges ✅ Passed No privileged container configurations, host network access, SYS_ADMIN capabilities, or unnecessary root access found in any PR files.
No-Sensitive-Data-In-Logs ✅ Passed No actual sensitive data (passwords, tokens, API keys, PII) found in logs or documentation. Bearer token examples use placeholders like <token>. Logging follows standard e2e test practices.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (7)
.claude/commands/create-test-case.md (1)

9-13: 💤 Low value

Consider adding a language identifier to the fenced code block.

The usage examples block would be clearer with a language identifier (e.g., bash or plaintext).

📝 Suggested improvement
 ## Usage
 
-```
+```plaintext
 /create-test-case test/e2e/e2e_dra_test.go
 /create-test-case test/e2e/e2e_preemption_test.go
 /create-test-case
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/commands/create-test-case.md around lines 9 - 13, The fenced code
block showing usage examples in .claude/commands/create-test-case.md lacks a
language identifier; update the triple-backtick fence to include a language like
plaintext or bash so syntax/highlighting and accessibility improve (locate the
block containing "/create-test-case test/e2e/e2e_dra_test.go" and change the
opening "```" to "```plaintext" or "```bash").
.claude/commands/create-test-code.md (1)

8-12: 💤 Low value

Consider adding a language identifier to the fenced code block.

The usage examples block would benefit from a language identifier for consistency with other command specifications.

📝 Suggested improvement
 ## Usage
 
-```
+```plaintext
 /create-test-code test/docs/cases/e2e_dra.md
 /create-test-code test/docs/cases/e2e_preemption.md
 /create-test-code
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/commands/create-test-code.md around lines 8 - 12, The fenced code
block showing the usage examples for the /create-test-code command lacks a
language identifier; update the block to include a language tag (e.g.,
plaintext) so it matches other command specifications — locate the fenced block
containing the three lines that start with "/create-test-code" and change the
opening ``` to ```plaintext to provide consistent syntax highlighting and
styling.
.claude/commands/create-release-plan.md (1)

9-13: ⚡ Quick win

Add language identifiers to fenced code blocks for better rendering.

Multiple fenced code blocks throughout this file lack language identifiers, which affects syntax highlighting and accessibility.

📝 Suggested improvements
 ## Usage
 
-```
+```plaintext
 /create-release-plan 1.5
 /create-release-plan 1.5 full
 /create-release-plan 1.5 light

And similarly for the code blocks at lines 55, 63, 78, and 86 - they should use plaintext or text as the language identifier.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/commands/create-release-plan.md around lines 9 - 13, Add a language
identifier (e.g., plaintext) to the fenced code blocks that currently contain
the command examples so they render with proper syntax highlighting;
specifically update the blocks containing the lines "/create-release-plan 1.5",
"/create-release-plan 1.5 full", and "/create-release-plan 1.5 light" (and the
other similar blocks at the later occurrences around the snippets showing those
commands) to use ```plaintext instead of plain ``` so all code fences include a
language tag.
test/docs/plans/kueue-1.4-light.md (1)

50-50: 💤 Low value

Minor naming inconsistency across plans.

The test case name varies between documents: "Managed Jobs NS Selector" (1.4-light, 1.5-light) vs "Managed Jobs Namespace Selector" (1.5-full). Consider standardizing to the full form for clarity.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/docs/plans/kueue-1.4-light.md` at line 50, Rename the plan entry title
"Managed Jobs NS Selector" to "Managed Jobs Namespace Selector" to match the
naming used elsewhere; update the string in the document containing the table
row that references the test file e2e_managed_jobs_namespace_selector_test.go so
the label exactly reads "Managed Jobs Namespace Selector" (this ensures
consistency across the plans 1.4-light, 1.5-light, and 1.5-full).
test/e2e/e2e_dra_er_alpha2_test.go (3)

188-196: 💤 Low value

Consider extracting job creation into a helper function.

Following the guideline pattern from e2e_dra_test.go, consider creating a small helper function in this file that calls the builder and layers on the DRA extended resource fields. This reduces duplication between the two test scenarios and improves readability.

♻️ Example helper function
func newDRAExtendedResourceJob(builder *testutils.TestResourceBuilder, name, queueName string) *batchv1.Job {
	job := builder.NewJob()
	setDRAJobCPU(job)
	job.Name = name
	job.Labels[testutils.QueueLabel] = queueName
	job.Spec.Template.Spec.Containers[0].Resources.Requests[corev1.ResourceName(extendedResourceName)] = resource.MustParse("1")
	job.Spec.Template.Spec.Containers[0].Resources.Limits = corev1.ResourceList{
		corev1.ResourceName(extendedResourceName): resource.MustParse("1"),
	}
	return job
}

Then use it at the call sites:

builder := testutils.NewTestResourceBuilder(ns.Name, erAlpha2QueueName)
job := newDRAExtendedResourceJob(builder, "s1-no-deviceclass", erAlpha2QueueName)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/e2e/e2e_dra_er_alpha2_test.go` around lines 188 - 196, Extract the
repeated job construction into a helper like newDRAExtendedResourceJob that
accepts the testutils.TestResourceBuilder (from
testutils.NewTestResourceBuilder), name and queueName, calls builder.NewJob(),
invokes setDRAJobCPU(job), sets job.Name, job.Labels[testutils.QueueLabel], and
applies the extended resource requests/limits using
corev1.ResourceName(extendedResourceName) and resource.MustParse("1"); replace
the inline construction in the test with a call to this helper to reduce
duplication and improve readability.

Source: Coding guidelines


310-318: 💤 Low value

Inconsistent timeout for Consistently check.

Line 318 uses testutils.ConsistentlyTimeout, while the similar check in the first scenario (line 225) uses testutils.ConsistentlyLongTimeout. If the shorter timeout is intentional (waiting less before DeviceClass creation), consider adding a comment to explain the difference. Otherwise, use the same timeout for consistency.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/e2e/e2e_dra_er_alpha2_test.go` around lines 310 - 318, The Consistently
check using testutils.ConsistentlyTimeout in the Consistently(func(g Gomega) {
... }) call is inconsistent with the earlier scenario which uses
testutils.ConsistentlyLongTimeout; either replace testutils.ConsistentlyTimeout
with testutils.ConsistentlyLongTimeout to match the first scenario (so the
Consistently invocation that checks pods for createdJob uses the longer
timeout), or if the shorter timeout is intentional add a brief comment
immediately above the Consistently call explaining why this case needs a shorter
timeout (referencing the Consistently invocation and
testutils.ConsistentlyTimeout/testutils.ConsistentlyLongTimeout to locate the
change).

121-135: ⚡ Quick win

Consider logging errors during DeviceClass restoration.

Lines 128 and 132 ignore errors during DeviceClass recreation/update. While cleanup failures can be tolerated, logging them helps with debugging when tests behave unexpectedly.

♻️ Proposed enhancement to log cleanup errors
 			if err != nil {
 				recreated := originalDeviceClass.DeepCopy()
 				recreated.ResourceVersion = ""
-				_, _ = kubeClient.ResourceV1().DeviceClasses().Create(ctx, recreated, metav1.CreateOptions{})
+				if _, err := kubeClient.ResourceV1().DeviceClasses().Create(ctx, recreated, metav1.CreateOptions{}); err != nil {
+					GinkgoWriter.Printf("Warning: Failed to recreate DeviceClass during cleanup: %v\n", err)
+				}
 			} else {
 				dc.Spec.ExtendedResourceName = originalDeviceClass.Spec.ExtendedResourceName
 				dc.Spec.Selectors = originalDeviceClass.Spec.Selectors
-				_, _ = kubeClient.ResourceV1().DeviceClasses().Update(ctx, dc, metav1.UpdateOptions{})
+				if _, err := kubeClient.ResourceV1().DeviceClasses().Update(ctx, dc, metav1.UpdateOptions{}); err != nil {
+					GinkgoWriter.Printf("Warning: Failed to update DeviceClass during cleanup: %v\n", err)
+				}
 			}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/e2e/e2e_dra_er_alpha2_test.go` around lines 121 - 135, The cleanup block
in AfterAll that restores originalDeviceClass currently ignores errors from
DeviceClasses.Create and DeviceClasses.Update; update the AfterAll closure to
capture the returned errors from
kubeClient.ResourceV1().DeviceClasses().Create(...) and .Update(...), and log
them (including context like draDeviceClassName and whether it was a recreate vs
update) using the test logging mechanism in this file (e.g., Ginkgo/Gomega
logging or the existing test logger) so failures during restoration are
recorded; reference the existing symbols originalDeviceClass,
draDeviceClassName, kubeClient.ResourceV1().DeviceClasses().Get/Create/Update,
and the local variables dc/err when adding the logging.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/docs/cases/e2e_admission_fair_sharing.md`:
- Around line 330-339: Update the cleanup step in the
e2e_admission_fair_sharing.md doc to clarify the Kueue config restore: replace
the literal filename reference `kueue-config-backup.yaml` with a clear
placeholder or restoration command and mention the saved-config variable used in
the Setup, e.g., use `<kueue-config-backup.yaml>` or a restoration instruction
like patching the cluster Kueue config with the saved config (refer to
"saved-config" from the Setup step) so readers know whether to apply a file or
reapply the saved config; adjust the final line accordingly in the markdown.

In `@test/e2e/e2e_dra_er_alpha2_test.go`:
- Around line 168-174: The namespace is being created directly with
kubeClient.CoreV1().Namespaces().Create(...) instead of using the shared helper;
replace the direct creation with testutils.CreateNamespace by constructing the
corev1.Namespace (with GenerateName erAlpha2NamespacePrefix and Labels using
testutils.OpenShiftManagedLabel), call cleanup, err :=
testutils.CreateNamespace(kubeClient, ns), assert
Expect(err).NotTo(HaveOccurred(), "Failed to create namespace"), and register
cleanup with DeferCleanup(cleanup) so the test uses consistent setup/teardown
patterns.

---

Nitpick comments:
In @.claude/commands/create-release-plan.md:
- Around line 9-13: Add a language identifier (e.g., plaintext) to the fenced
code blocks that currently contain the command examples so they render with
proper syntax highlighting; specifically update the blocks containing the lines
"/create-release-plan 1.5", "/create-release-plan 1.5 full", and
"/create-release-plan 1.5 light" (and the other similar blocks at the later
occurrences around the snippets showing those commands) to use ```plaintext
instead of plain ``` so all code fences include a language tag.

In @.claude/commands/create-test-case.md:
- Around line 9-13: The fenced code block showing usage examples in
.claude/commands/create-test-case.md lacks a language identifier; update the
triple-backtick fence to include a language like plaintext or bash so
syntax/highlighting and accessibility improve (locate the block containing
"/create-test-case test/e2e/e2e_dra_test.go" and change the opening "```" to
"```plaintext" or "```bash").

In @.claude/commands/create-test-code.md:
- Around line 8-12: The fenced code block showing the usage examples for the
/create-test-code command lacks a language identifier; update the block to
include a language tag (e.g., plaintext) so it matches other command
specifications — locate the fenced block containing the three lines that start
with "/create-test-code" and change the opening ``` to ```plaintext to provide
consistent syntax highlighting and styling.

In `@test/docs/plans/kueue-1.4-light.md`:
- Line 50: Rename the plan entry title "Managed Jobs NS Selector" to "Managed
Jobs Namespace Selector" to match the naming used elsewhere; update the string
in the document containing the table row that references the test file
e2e_managed_jobs_namespace_selector_test.go so the label exactly reads "Managed
Jobs Namespace Selector" (this ensures consistency across the plans 1.4-light,
1.5-light, and 1.5-full).

In `@test/e2e/e2e_dra_er_alpha2_test.go`:
- Around line 188-196: Extract the repeated job construction into a helper like
newDRAExtendedResourceJob that accepts the testutils.TestResourceBuilder (from
testutils.NewTestResourceBuilder), name and queueName, calls builder.NewJob(),
invokes setDRAJobCPU(job), sets job.Name, job.Labels[testutils.QueueLabel], and
applies the extended resource requests/limits using
corev1.ResourceName(extendedResourceName) and resource.MustParse("1"); replace
the inline construction in the test with a call to this helper to reduce
duplication and improve readability.
- Around line 310-318: The Consistently check using
testutils.ConsistentlyTimeout in the Consistently(func(g Gomega) { ... }) call
is inconsistent with the earlier scenario which uses
testutils.ConsistentlyLongTimeout; either replace testutils.ConsistentlyTimeout
with testutils.ConsistentlyLongTimeout to match the first scenario (so the
Consistently invocation that checks pods for createdJob uses the longer
timeout), or if the shorter timeout is intentional add a brief comment
immediately above the Consistently call explaining why this case needs a shorter
timeout (referencing the Consistently invocation and
testutils.ConsistentlyTimeout/testutils.ConsistentlyLongTimeout to locate the
change).
- Around line 121-135: The cleanup block in AfterAll that restores
originalDeviceClass currently ignores errors from DeviceClasses.Create and
DeviceClasses.Update; update the AfterAll closure to capture the returned errors
from kubeClient.ResourceV1().DeviceClasses().Create(...) and .Update(...), and
log them (including context like draDeviceClassName and whether it was a
recreate vs update) using the test logging mechanism in this file (e.g.,
Ginkgo/Gomega logging or the existing test logger) so failures during
restoration are recorded; reference the existing symbols originalDeviceClass,
draDeviceClassName, kubeClient.ResourceV1().DeviceClasses().Get/Create/Update,
and the local variables dc/err when adding the logging.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 9ed91a3e-2854-4322-98b6-408199e36291

📥 Commits

Reviewing files that changed from the base of the PR and between 707e7c9 and a4ce967.

📒 Files selected for processing (12)
  • .claude/commands/create-release-plan.md
  • .claude/commands/create-test-case.md
  • .claude/commands/create-test-code.md
  • test/docs/cases/e2e_admission_fair_sharing.md
  • test/docs/cases/e2e_dra_er_alpha2.md
  • test/docs/cases/e2e_tls_profile.md
  • test/docs/cases/e2e_visibility_on_demand.md
  • test/docs/plans/kueue-1.4-full.md
  • test/docs/plans/kueue-1.4-light.md
  • test/docs/plans/kueue-1.5-full.md
  • test/docs/plans/kueue-1.5-light.md
  • test/e2e/e2e_dra_er_alpha2_test.go

Comment on lines +330 to +339
**Cleanup:**

```bash
oc delete jobs --all -n <namespace>
oc delete localqueue lq-cpu-heavy lq-cpu-light -n <namespace>
oc delete clusterqueue <cq-name>
oc delete resourceflavor <rf-name>
oc delete namespace <namespace>
oc apply -f kueue-config-backup.yaml
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clarify or correct the cleanup file reference.

Line 338 references kueue-config-backup.yaml, which suggests a specific file must exist. Since this is a manual test case document, this should either:

  1. Be a placeholder like <kueue-config-backup.yaml>
  2. Show the actual command to restore from the saved config variable
  3. Reference the pattern used in automated tests
💡 Suggested clarification
 **Cleanup:**
 
 ```bash
 oc delete jobs --all -n <namespace>
 oc delete localqueue lq-cpu-heavy lq-cpu-light -n <namespace>
 oc delete clusterqueue <cq-name>
 oc delete resourceflavor <rf-name>
 oc delete namespace <namespace>
-oc apply -f kueue-config-backup.yaml
+# Restore the saved Kueue config (saved in Setup step 1)
+oc patch kueue cluster --type=merge -p '{"spec":{"config":<saved-config>}}'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**Cleanup:**
```bash
oc delete jobs --all -n <namespace>
oc delete localqueue lq-cpu-heavy lq-cpu-light -n <namespace>
oc delete clusterqueue <cq-name>
oc delete resourceflavor <rf-name>
oc delete namespace <namespace>
oc apply -f kueue-config-backup.yaml
```
**Cleanup:**
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/docs/cases/e2e_admission_fair_sharing.md` around lines 330 - 339, Update
the cleanup step in the e2e_admission_fair_sharing.md doc to clarify the Kueue
config restore: replace the literal filename reference
`kueue-config-backup.yaml` with a clear placeholder or restoration command and
mention the saved-config variable used in the Setup, e.g., use
`<kueue-config-backup.yaml>` or a restoration instruction like patching the
cluster Kueue config with the saved config (refer to "saved-config" from the
Setup step) so readers know whether to apply a file or reapply the saved config;
adjust the final line accordingly in the markdown.

Comment on lines +168 to +174
ns, err := kubeClient.CoreV1().Namespaces().Create(ctx, &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{
GenerateName: erAlpha2NamespacePrefix,
Labels: map[string]string{testutils.OpenShiftManagedLabel: "true"},
},
}, metav1.CreateOptions{})
Expect(err).NotTo(HaveOccurred(), "Failed to create namespace")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use testutils.CreateNamespace for all namespace creation in e2e tests.

Both test scenarios create namespaces directly instead of using the recommended testutils.CreateNamespace(kubeClient, ns) utility function. As per coding guidelines, all e2e tests should use the testutils helper for namespace creation to ensure consistent setup and cleanup patterns across the test suite.

🔧 Proposed fix pattern

Replace direct namespace creation:

ns, err := kubeClient.CoreV1().Namespaces().Create(ctx, &corev1.Namespace{...}, metav1.CreateOptions{})
// ... manual cleanup with DeferCleanup

With testutils helper:

ns := &corev1.Namespace{
	ObjectMeta: metav1.ObjectMeta{
		GenerateName: erAlpha2NamespacePrefix,
		Labels:       map[string]string{testutils.OpenShiftManagedLabel: "true"},
	},
}
cleanup, err := testutils.CreateNamespace(kubeClient, ns)
Expect(err).NotTo(HaveOccurred(), "Failed to create namespace")
DeferCleanup(cleanup)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/e2e/e2e_dra_er_alpha2_test.go` around lines 168 - 174, The namespace is
being created directly with kubeClient.CoreV1().Namespaces().Create(...) instead
of using the shared helper; replace the direct creation with
testutils.CreateNamespace by constructing the corev1.Namespace (with
GenerateName erAlpha2NamespacePrefix and Labels using
testutils.OpenShiftManagedLabel), call cleanup, err :=
testutils.CreateNamespace(kubeClient, ns), assert
Expect(err).NotTo(HaveOccurred(), "Failed to create namespace"), and register
cleanup with DeferCleanup(cleanup) so the test uses consistent setup/teardown
patterns.

Source: Coding guidelines

@openshift-ci

openshift-ci Bot commented Jul 7, 2026

Copy link
Copy Markdown

@anahas-redhat: 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/test-e2e-ci-build-downstream-4-20 a4ce967 link true /test test-e2e-ci-build-downstream-4-20
ci/prow/test-e2e-ci-build-downstream-4-21 a4ce967 link true /test test-e2e-ci-build-downstream-4-21
ci/prow/test-e2e-ci-build-downstream-4-22 a4ce967 link true /test test-e2e-ci-build-downstream-4-22

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

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant