Skip to content

test(e2e): add the rayjob flow and its recorded fixtures - #288

Merged
AviadHayumi merged 2 commits into
mainfrom
e2e/flow-rayjob
Sep 15, 2026
Merged

AviadHayumi merged 2 commits into
mainfrom
e2e/flow-rayjob

Conversation

@AviadHayumi

@AviadHayumi AviadHayumi commented Aug 24, 2026 •

Copy link
Copy Markdown
Collaborator

Records the RayJob flows (running, completed, failed, suspended, resumed) and replays every frame through the catalog definition. The recordings are what caught this gap.

Why the definition changes: before job submission the operator reports the cluster bring-up only through jobDeploymentStatus Initializing - jobStatus is still empty. The definition read jobStatus alone, so the whole bring-up read Undefined. The new matcher reads that field the same way the suspended mapping already does.

         statusMappings:
           initializing:
             - byPhase: PENDING
+            - byExpression:
+                expression: .status.jobDeploymentStatus == "Initializing"
+                expectedResult: "true"

The recorder side also tightens: Suspended is labelled only from the settled Suspended, and transients like Suspending or a reset status stay recorded as Undefined, which the replay verifies too.

The recorded fixtures in this PR show the exact bring-up frames: the replay is red without this change and green with it.

why a flow PR carries its own catalog fix

Part of the e2e flow stack (#284 to #295). Recorded live on kind (Kubernetes v1.34.0); replay and make check are green at every layer.

Summary by CodeRabbit

  • Bug Fixes

    • RayJobs are now recognized as initializing when deployment status is Initializing, in addition to the PENDING job status.
    • Initializing detection no longer incorrectly matches jobs with empty status and non-suspended deployment states.
  • Tests

    • Added end-to-end coverage for RayJob running, completed, failed, suspended, and resumed workflows.
    • Added recorded scenarios validating RayJob lifecycle states and transitions.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Enterprise

Run ID: a16b4ab6-9dd2-4351-bcd2-c3939797f9c5

📥 Commits

Reviewing files that changed from the base of the PR and between 2019113 and b500c40.

📒 Files selected for processing (14)
  • docs/catalog/ray-io-rayjob-v1.yaml
  • pkg/catalog/kartas/rayjob.go
  • test/e2e/flows/predicates.go
  • test/e2e/flows/rayjob_test.go
  • test/e2e/flows/testdata/rayjob/completed.yaml
  • test/e2e/flows/testdata/rayjob/failed.yaml
  • test/e2e/flows/testdata/rayjob/resumed.yaml
  • test/e2e/flows/testdata/rayjob/running.yaml
  • test/e2e/flows/testdata/rayjob/suspended.yaml
  • test/e2e/recorded_data/kuberay/v1.34.0/ray-io-rayjob-v1/completed.yaml
  • test/e2e/recorded_data/kuberay/v1.34.0/ray-io-rayjob-v1/failed.yaml
  • test/e2e/recorded_data/kuberay/v1.34.0/ray-io-rayjob-v1/resumed.yaml
  • test/e2e/recorded_data/kuberay/v1.34.0/ray-io-rayjob-v1/running.yaml
  • test/e2e/recorded_data/kuberay/v1.34.0/ray-io-rayjob-v1/suspended.yaml

Included review availability: Your plan provides up to 12 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

RayJob initialization detection now uses either PENDING job status or Initializing deployment status. New end-to-end fixtures and recorded data cover running, completed, failed, suspended, and resumed RayJob flows.

Changes

RayJob lifecycle

Layer / File(s) Summary
Initialization status detection
docs/catalog/ray-io-rayjob-v1.yaml, pkg/catalog/kartas/rayjob.go, test/e2e/flows/predicates.go
RayJob initialization now matches PENDING job status or Initializing deployment status.
RayJob end-to-end flows
test/e2e/flows/rayjob_test.go, test/e2e/flows/testdata/rayjob/*
Added running, completed, failed, suspended, and resumed RayJob fixtures and assertions.
Recorded lifecycle histories
test/e2e/recorded_data/kuberay/v1.34.0/ray-io-rayjob-v1/*
Added recorded RayJob histories and expected results for each lifecycle flow.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Unblocks: 7 PRs

Sequence Diagram(s)

sequenceDiagram
  participant RayJobSuite
  participant KubeRayOperator
  participant RayCluster
  participant Recorder
  RayJobSuite->>KubeRayOperator: Apply RayJob fixture
  KubeRayOperator->>RayCluster: Provision or suspend cluster
  RayCluster-->>KubeRayOperator: Report readiness or terminal status
  KubeRayOperator-->>Recorder: Record RayJob lifecycle state
  RayJobSuite->>KubeRayOperator: Resume suspended RayJob
  KubeRayOperator-->>Recorder: Record resumed Running state
Loading

Merge Risk: ⚪ Minimal · up to 216a3

No concrete correctness or operational risk remains; the change is ready to merge after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (11 skipped: 1…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding the RayJob end-to-end flow and its recorded fixtures. It is concise and specific.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch e2e/flow-rayjob

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

@AviadHayumi
AviadHayumi marked this pull request as ready for review September 15, 2026 07:53
Base automatically changed from e2e/flow-statefulset to main September 15, 2026 10:02
The cluster bring-up before job submission is reported through
jobDeploymentStatus Initializing, matched the same way the Suspended
mapping already reads that field. Verified frame by frame on the
recorded RayJob fixtures.

Signed-off-by: aviadh <aviad.hayumi@gmail.com>
Signed-off-by: aviadh <aviad.hayumi@gmail.com>
@AviadHayumi
AviadHayumi merged commit 4c8676d into main Sep 15, 2026
4 checks passed
@AviadHayumi
AviadHayumi deleted the e2e/flow-rayjob branch September 15, 2026 11:25
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.

3 participants