Skip to content

add tas downstream tests - #1888

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
kannon92:add-tas-e2es
Jul 8, 2026
Merged

add tas downstream tests#1888
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
kannon92:add-tas-e2es

Conversation

@kannon92

@kannon92 kannon92 commented May 14, 2026

Copy link
Copy Markdown
Contributor

Turns out the upstream tests hardcode kind nodes so it would be quite difficult to adapt the upstream tests.

So i went with a downstream.

Summary by CodeRabbit

  • Tests

    • Added a comprehensive end-to-end test suite for Topology-Aware Scheduling covering batch jobs, job sets, individual pods, pod groups, and datacenter multi-level scenarios; verifies admission results and topology assignments.
    • Extended test utilities for creating/cleaning topologies and resource flavors, labeling/cleaning nodes, and polling workloads to assert topology details.
  • Chores

    • Added a CI make target to run TAS-labeled e2e tests and produce JUnit results.

@kannon92 kannon92 changed the title add tas downstream tests wip: add tas downstream tests May 14, 2026
@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a new end-to-end test suite validating Topology‑Aware Scheduling (TAS) plus supporting test utilities to create/manage Topology and ResourceFlavor resources, label worker nodes for datacenter scenarios, and verify Workload admissions and TopologyAssignments.

Changes

TAS end-to-end tests and supporting utilities

Layer / File(s) Summary
TAS test scenarios and assertions
test/e2e/e2e_tas_test.go
New Ginkgo e2e suite covering TAS admission for batchv1.Job, jobsetapi.JobSet, single corev1.Pod, pod groups, and datacenter cases (block required / rack preferred). Asserts scheduling gates removal, nodeSelector presence, and Workload.Status.Admission.PodSetAssignments[*].TopologyAssignment contents.
Datacenter topology tests
test/e2e/e2e_tas_test.go (datacenter section)
Creates a multi-level Topology (block → rack → hostname) and verifies TopologyAssignment.Levels ordering and non-empty Slices for block-required and rack-preferred admissions.
Node labeling and cleanup utilities for datacenter tests
test/e2e/e2e_tas_test.go (node-label helpers)
Helpers to label up to four worker nodes with block/rack/node-group/kubernetes.io/hostname labels via strategic-merge patch JSON and to remove those labels during cleanup. Also includes shared-test resource creation helpers.
Workload admission verification helpers
test/e2e/e2e_tas_test.go (verification helpers)
Adds polling helpers verifyWorkloadAdmittedWithTopologyLevels (asserts exact Levels order and non-empty Slices) and verifyWorkloadAdmittedWithTopology (asserts presence of TopologyAssignment and non-empty Slices) keyed by job UID and expected PodSet count.
Topology resource wrapper and ResourceFlavor builders
test/e2e/testutils/utils.go
Adds TopologyWrapper type with NewTopology(), WithGenerateName(), WithLevels([]string), and CreateWithObject(ctx, client) which creates the Topology and returns a cleanup func that removes finalizers, deletes, and waits for removal. ResourceFlavorWrapper gains WithTopologyName(name) and WithNodeLabel(key,value) builder methods.
CI target for TAS e2e
Makefile
Adds e2e-ci-test-tas make target to run TAS-labeled e2e tests via ginkgo and write JUnit output to ${ARTIFACT_DIR}/e2e-tas-junit.xml.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 8 | ❌ 4

❌ Failed checks (4 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning Assertion messages are inconsistent. Error assertions lack meaningful messages (e.g., bare Expect(err).NotTo(HaveOccurred())), reducing debuggability compared to helper functions. Add meaningful messages to error assertions, e.g. Expect(err).NotTo(HaveOccurred(), "failed to create job"), matching the pattern used in helper functions.
Microshift Test Compatibility ⚠️ Warning The test "Using a datacenter topology with block and rack levels" requires >=2 worker nodes (multi-node assumption) but lacks MicroShift protection mechanisms. Add [Skipped:MicroShift] label to the affected When block or add an exutil.IsMicroShiftCluster() check with g.Skip() in the BeforeEach of that When block.
Single Node Openshift (Sno) Test Compatibility ⚠️ Warning Two datacenter topology tests require ≥2 worker nodes (line 457 assertion) with no SNO skip protection, causing failures on SNO clusters. Add [Skipped:SingleReplicaTopology] label to line 329 When() block, or guard labelWorkerNodesForDatacenterTopology() call with exutil.IsSingleNode() check and g.Skip().
✅ Passed checks (8 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 Ginkgo test names are stable and deterministic. Test titles use static descriptive strings with no dynamic pod/node names, UUIDs, timestamps, or other run-specific values.
Topology-Aware Scheduling Compatibility ✅ Passed PR adds only test code to test/ directory. Custom check applies to deployment manifests, operator code, or controllers—none modified here. No topology-incompatible constraints found.
Ote Binary Stdout Contract ✅ Passed PR contains no process-level stdout writes. All test code uses Ginkgo v2 patterns correctly, with GinkgoWriter for suite output and test-level code contained in It/BeforeEach blocks.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Tests have no IPv4 hardcoded addresses, no localhost assumptions, no external URLs, and container images use environment-variable-configurable source for disconnected environments.
Title check ✅ Passed The title 'add tas downstream tests' accurately summarizes the main change—adding end-to-end tests for Topology-Aware Scheduling in the downstream project.

✏️ 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.

@openshift-ci openshift-ci Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 14, 2026

@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 (1)
test/e2e/e2e_tas_test.go (1)

770-770: 💤 Low value

Remove unused variable assignment.

The topologyName parameter is assigned to _ but never used in the function body. This appears to be leftover code.

Remove unused variable or document why it's kept
-func verifyWorkloadAdmittedWithTopology(ctx context.Context, namespace, jobUID string, expectedPodSets int, topologyName string) {
+func verifyWorkloadAdmittedWithTopology(ctx context.Context, namespace, jobUID string, expectedPodSets int, _ string) {
 	kueueClient := clients.UpstreamKueueClient
-	_ = topologyName

Or if you plan to use it later for additional assertions, document that with a TODO comment.

🤖 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_tas_test.go` at line 770, The assignment "_ = topologyName" is a
leftover unused variable; remove that line from the test (or if you intend to
use topologyName later, replace the discard with a clear TODO comment
referencing topologyName). Locate the occurrence of topologyName in the test
function (search for the symbol topologyName in test/e2e/e2e_tas_test.go) and
either delete the discard assignment or add a TODO explaining planned assertions
that will use topologyName.
🤖 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/e2e/e2e_tas_test.go`:
- Line 96: The test uses external images via
testutils.GetContainerImageForWorkloads() and must be marked to skip on
disconnected clusters: update the Ginkgo suite/Describe/It that contains the
Image: testutils.GetContainerImageForWorkloads() usages in e2e_tas_test.go to
include the disconnected skip label (e.g., add Label("Skipped:Disconnected") or
Label("Skipped:Disconnected") as an argument to the top-level
Describe/Context/It where the container image is set); apply this change for
every occurrence that references testutils.GetContainerImageForWorkloads() so
the tests are automatically skipped in disconnected environments.
- Around line 592-597: The helper labelWorkerNodesForDatacenterTopology
currently enforces at least 2 worker nodes which breaks Single Node OpenShift
(SNO) runs; update it to either detect SNO and call Skip() or relax the
requirement to work with available nodes. Specifically, modify
labelWorkerNodesForDatacenterTopology to query nodes (using
kubeClient.CoreV1().Nodes().List) and if len(nodes.Items) < 2 then call Ginkgo
Skip() with a clear message about SNO, or alternatively proceed using the single
worker node (adjusting downstream logic that assumes multiple nodes). Ensure the
change is made inside the labelWorkerNodesForDatacenterTopology function so
tests no longer fail on SNO.

---

Nitpick comments:
In `@test/e2e/e2e_tas_test.go`:
- Line 770: The assignment "_ = topologyName" is a leftover unused variable;
remove that line from the test (or if you intend to use topologyName later,
replace the discard with a clear TODO comment referencing topologyName). Locate
the occurrence of topologyName in the test function (search for the symbol
topologyName in test/e2e/e2e_tas_test.go) and either delete the discard
assignment or add a TODO explaining planned assertions that will use
topologyName.
🪄 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: 07576c03-fe31-4c5c-81fd-572c3fe07cf4

📥 Commits

Reviewing files that changed from the base of the PR and between 1be2788 and 5ef518d.

📒 Files selected for processing (2)
  • test/e2e/e2e_tas_test.go
  • test/e2e/testutils/utils.go

Comment thread test/e2e/e2e_tas_test.go Outdated
Comment thread test/e2e/e2e_tas_test.go
@kannon92
kannon92 force-pushed the add-tas-e2es branch 4 times, most recently from 8ba25a9 to 3c969eb Compare May 15, 2026 21:10
@kannon92

Copy link
Copy Markdown
Contributor Author

/retest

@kannon92
kannon92 force-pushed the add-tas-e2es branch 2 times, most recently from 27ca0ad to df27c5c Compare May 29, 2026 13:27
@kannon92 kannon92 changed the title wip: add tas downstream tests add tas downstream tests May 29, 2026
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 29, 2026
@kannon92

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@kannon92

kannon92 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@kannon92

Copy link
Copy Markdown
Contributor Author

/retest

Comment thread test/e2e/e2e_tas_test.go
localQueue *kueuev1beta2.LocalQueue
)

BeforeEach(func(ctx context.Context) {

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.

This BeforeEach and JustAfterEach looks like the same from most of the other ginkgo When. Perhaps we could combine those When conditions that have same BeforeEach into one When to avoid code replication. WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, done — combined the Job/JobSet/Pod/Deployment When blocks (which all shared the same hostname-topology BeforeEach/JustAfterEach) into a single When("Creating a workload requesting TAS with hostname topology", ...) block with separate Its. Pushed in 2ec0a0f.

@kannon92

kannon92 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

/retest

Comment thread test/e2e/e2e_tas_test.go Outdated
@openshift-ci

openshift-ci Bot commented Jul 8, 2026

Copy link
Copy Markdown

@kannon92: 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 3dda229 link true /test test-e2e-ci-build-downstream-4-20
ci/prow/test-e2e-ci-build-upstream-4-21 24f26a4 link true /test test-e2e-ci-build-upstream-4-21
ci/prow/test-e2e-ci-build-downstream-4-21 24f26a4 link true /test test-e2e-ci-build-downstream-4-21

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.

@MaysaMacedo MaysaMacedo 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.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 8, 2026
@openshift-ci

openshift-ci Bot commented Jul 8, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kannon92, MaysaMacedo

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:
  • OWNERS [MaysaMacedo,kannon92]

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

@openshift-merge-bot
openshift-merge-bot Bot merged commit 4e2abb7 into openshift:main Jul 8, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants