Skip to content

Commit bd6c07d

Browse files
committed
test: use exact error message match
Signed-off-by: machichima <[email protected]>
1 parent 53cb27d commit bd6c07d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ray-operator/controllers/ray/rayjob_controller_unit_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ func TestReconcile_ValidationFailures(t *testing.T) {
655655
},
656656
},
657657
},
658-
shouldContain: "The RayJob metadata is invalid",
658+
shouldContain: "The RayJob metadata is invalid: RayJob name should be no more than 47 characters",
659659
},
660660
{
661661
name: "spec validation failure - empty containers",
@@ -676,7 +676,7 @@ func TestReconcile_ValidationFailures(t *testing.T) {
676676
},
677677
},
678678
},
679-
shouldContain: "The RayJob spec is invalid",
679+
shouldContain: "The RayJob spec is invalid: headGroupSpec should have at least one container",
680680
},
681681
{
682682
name: "status validation failure - invalid status combination",
@@ -701,7 +701,7 @@ func TestReconcile_ValidationFailures(t *testing.T) {
701701
JobDeploymentStatus: rayv1.JobDeploymentStatusWaiting,
702702
},
703703
},
704-
shouldContain: "The RayJob status is invalid",
704+
shouldContain: "The RayJob status is invalid: invalid RayJob State: JobDeploymentStatus cannot be `Waiting` when SubmissionMode is not InteractiveMode",
705705
},
706706
}
707707

@@ -743,7 +743,7 @@ func TestReconcile_ValidationFailures(t *testing.T) {
743743
assert.Equal(t, rayv1.JobDeploymentStatusFailed, updatedRayJob.Status.JobDeploymentStatus)
744744
assert.Equal(t, rayv1.JobStatusFailed, updatedRayJob.Status.JobStatus)
745745
assert.Equal(t, rayv1.ValidationFailed, updatedRayJob.Status.Reason)
746-
assert.Contains(t, updatedRayJob.Status.Message, tt.shouldContain)
746+
assert.Equal(t, tt.shouldContain, updatedRayJob.Status.Message)
747747
})
748748
}
749749
}

0 commit comments

Comments
 (0)