@@ -34,6 +34,7 @@ import (
34
34
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
35
35
"github.com/ray-project/kuberay/ray-operator/controllers/ray/common"
36
36
"github.com/ray-project/kuberay/ray-operator/controllers/ray/utils"
37
+ utiltypes "github.com/ray-project/kuberay/ray-operator/controllers/ray/utils/types"
37
38
"github.com/ray-project/kuberay/ray-operator/pkg/features"
38
39
"github.com/ray-project/kuberay/ray-operator/test/support"
39
40
)
@@ -270,8 +271,8 @@ var _ = Context("RayJob with different submission modes", func() {
270
271
271
272
It ("RayJobs's JobDeploymentStatus transitions from Running to Complete." , func () {
272
273
// Update fake dashboard client to return job info with "Succeeded" status.
273
- getJobInfo := func (context.Context , string ) (* utils .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
274
- return & utils .RayJobInfo {JobStatus : rayv1 .JobStatusSucceeded , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
274
+ getJobInfo := func (context.Context , string ) (* utiltypes .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
275
+ return & utiltypes .RayJobInfo {JobStatus : rayv1 .JobStatusSucceeded , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
275
276
}
276
277
fakeRayDashboardClient .GetJobInfoMock .Store (& getJobInfo )
277
278
defer fakeRayDashboardClient .GetJobInfoMock .Store (nil )
@@ -495,8 +496,8 @@ var _ = Context("RayJob with different submission modes", func() {
495
496
496
497
It ("RayJobs's JobDeploymentStatus transitions from Running to Complete." , func () {
497
498
// Update fake dashboard client to return job info with "Succeeded" status.
498
- getJobInfo := func (context.Context , string ) (* utils .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
499
- return & utils .RayJobInfo {JobStatus : rayv1 .JobStatusSucceeded , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
499
+ getJobInfo := func (context.Context , string ) (* utiltypes .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
500
+ return & utiltypes .RayJobInfo {JobStatus : rayv1 .JobStatusSucceeded , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
500
501
}
501
502
fakeRayDashboardClient .GetJobInfoMock .Store (& getJobInfo )
502
503
defer fakeRayDashboardClient .GetJobInfoMock .Store (nil )
@@ -660,8 +661,8 @@ var _ = Context("RayJob with different submission modes", func() {
660
661
It ("RayJobs's JobDeploymentStatus transitions from Running -> Retrying -> New -> Initializing" , func () {
661
662
// Update fake dashboard client to return job info with "Failed" status.
662
663
//nolint:unparam // this is a mock and the function signature cannot change
663
- getJobInfo := func (context.Context , string ) (* utils .RayJobInfo , error ) {
664
- return & utils .RayJobInfo {JobStatus : rayv1 .JobStatusFailed , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
664
+ getJobInfo := func (context.Context , string ) (* utiltypes .RayJobInfo , error ) {
665
+ return & utiltypes .RayJobInfo {JobStatus : rayv1 .JobStatusFailed , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
665
666
}
666
667
fakeRayDashboardClient .GetJobInfoMock .Store (& getJobInfo )
667
668
defer fakeRayDashboardClient .GetJobInfoMock .Store (nil )
@@ -755,8 +756,8 @@ var _ = Context("RayJob with different submission modes", func() {
755
756
It ("RayJobs's JobDeploymentStatus transitions from Running -> Complete (attempt 2)" , func () {
756
757
// Update fake dashboard client to return job info with "Failed" status.
757
758
//nolint:unparam // this is a mock and the function signature cannot change
758
- getJobInfo := func (context.Context , string ) (* utils .RayJobInfo , error ) {
759
- return & utils .RayJobInfo {JobStatus : rayv1 .JobStatusSucceeded , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
759
+ getJobInfo := func (context.Context , string ) (* utiltypes .RayJobInfo , error ) {
760
+ return & utiltypes .RayJobInfo {JobStatus : rayv1 .JobStatusSucceeded , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
760
761
}
761
762
fakeRayDashboardClient .GetJobInfoMock .Store (& getJobInfo )
762
763
defer fakeRayDashboardClient .GetJobInfoMock .Store (nil )
@@ -982,8 +983,8 @@ var _ = Context("RayJob with different submission modes", func() {
982
983
983
984
By ("RayJobs's JobDeploymentStatus transitions from Running to Complete." , func () {
984
985
// Update fake dashboard client to return job info with "Succeeded" status.
985
- getJobInfo := func (context.Context , string ) (* utils .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
986
- return & utils .RayJobInfo {JobStatus : rayv1 .JobStatusSucceeded , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
986
+ getJobInfo := func (context.Context , string ) (* utiltypes .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
987
+ return & utiltypes .RayJobInfo {JobStatus : rayv1 .JobStatusSucceeded , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
987
988
}
988
989
fakeRayDashboardClient .GetJobInfoMock .Store (& getJobInfo )
989
990
defer fakeRayDashboardClient .GetJobInfoMock .Store (nil )
@@ -1121,8 +1122,8 @@ var _ = Context("RayJob with different submission modes", func() {
1121
1122
1122
1123
By ("RayJobs's JobDeploymentStatus transitions from Running to Complete." , func () {
1123
1124
// Update fake dashboard client to return job info with "Failed" status.
1124
- getJobInfo := func (context.Context , string ) (* utils .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
1125
- return & utils .RayJobInfo {JobStatus : rayv1 .JobStatusFailed , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
1125
+ getJobInfo := func (context.Context , string ) (* utiltypes .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
1126
+ return & utiltypes .RayJobInfo {JobStatus : rayv1 .JobStatusFailed , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
1126
1127
}
1127
1128
fakeRayDashboardClient .GetJobInfoMock .Store (& getJobInfo )
1128
1129
defer fakeRayDashboardClient .GetJobInfoMock .Store (nil )
@@ -1260,8 +1261,8 @@ var _ = Context("RayJob with different submission modes", func() {
1260
1261
1261
1262
By ("RayJobs's JobDeploymentStatus transitions from Running to Complete." , func () {
1262
1263
// Update fake dashboard client to return job info with "Succeeded" status.
1263
- getJobInfo := func (context.Context , string ) (* utils .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
1264
- return & utils .RayJobInfo {JobStatus : rayv1 .JobStatusSucceeded , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
1264
+ getJobInfo := func (context.Context , string ) (* utiltypes .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
1265
+ return & utiltypes .RayJobInfo {JobStatus : rayv1 .JobStatusSucceeded , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
1265
1266
}
1266
1267
fakeRayDashboardClient .GetJobInfoMock .Store (& getJobInfo )
1267
1268
defer fakeRayDashboardClient .GetJobInfoMock .Store (nil )
@@ -1416,8 +1417,8 @@ var _ = Context("RayJob with different submission modes", func() {
1416
1417
1417
1418
By ("RayJobs's JobDeploymentStatus transitions from Running to Complete." , func () {
1418
1419
// Update fake dashboard client to return job info with "Failed" status.
1419
- getJobInfo := func (context.Context , string ) (* utils .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
1420
- return & utils .RayJobInfo {JobStatus : rayv1 .JobStatusFailed , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
1420
+ getJobInfo := func (context.Context , string ) (* utiltypes .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
1421
+ return & utiltypes .RayJobInfo {JobStatus : rayv1 .JobStatusFailed , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
1421
1422
}
1422
1423
fakeRayDashboardClient .GetJobInfoMock .Store (& getJobInfo )
1423
1424
defer fakeRayDashboardClient .GetJobInfoMock .Store (nil )
@@ -1561,8 +1562,8 @@ var _ = Context("RayJob with different submission modes", func() {
1561
1562
1562
1563
By ("RayJobs's JobDeploymentStatus transitions from Running to Complete." , func () {
1563
1564
// Update fake dashboard client to return job info with "Succeeded" status.
1564
- getJobInfo := func (context.Context , string ) (* utils .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
1565
- return & utils .RayJobInfo {JobStatus : rayv1 .JobStatusSucceeded , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
1565
+ getJobInfo := func (context.Context , string ) (* utiltypes .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
1566
+ return & utiltypes .RayJobInfo {JobStatus : rayv1 .JobStatusSucceeded , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
1566
1567
}
1567
1568
fakeRayDashboardClient .GetJobInfoMock .Store (& getJobInfo )
1568
1569
@@ -1677,8 +1678,8 @@ var _ = Context("RayJob with different submission modes", func() {
1677
1678
1678
1679
By ("RayJobs's JobDeploymentStatus transitions from Running to Complete." , func () {
1679
1680
// Update fake dashboard client to return job info with "Failed" status.
1680
- getJobInfo := func (context.Context , string ) (* utils .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
1681
- return & utils .RayJobInfo {JobStatus : rayv1 .JobStatusFailed , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
1681
+ getJobInfo := func (context.Context , string ) (* utiltypes .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
1682
+ return & utiltypes .RayJobInfo {JobStatus : rayv1 .JobStatusFailed , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
1682
1683
}
1683
1684
fakeRayDashboardClient .GetJobInfoMock .Store (& getJobInfo )
1684
1685
@@ -1804,8 +1805,8 @@ var _ = Context("RayJob with different submission modes", func() {
1804
1805
1805
1806
By ("RayJobs's JobDeploymentStatus transitions from Running to Complete." , func () {
1806
1807
// Update fake dashboard client to return job info with "Succeeded" status.
1807
- getJobInfo := func (context.Context , string ) (* utils .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
1808
- return & utils .RayJobInfo {JobStatus : rayv1 .JobStatusSucceeded , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
1808
+ getJobInfo := func (context.Context , string ) (* utiltypes .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
1809
+ return & utiltypes .RayJobInfo {JobStatus : rayv1 .JobStatusSucceeded , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
1809
1810
}
1810
1811
fakeRayDashboardClient .GetJobInfoMock .Store (& getJobInfo )
1811
1812
defer fakeRayDashboardClient .GetJobInfoMock .Store (nil )
@@ -1965,8 +1966,8 @@ var _ = Context("RayJob with different submission modes", func() {
1965
1966
1966
1967
By ("RayJobs's JobDeploymentStatus transitions from Running to Complete." , func () {
1967
1968
// Update fake dashboard client to return job info with "Failed" status.
1968
- getJobInfo := func (context.Context , string ) (* utils .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
1969
- return & utils .RayJobInfo {JobStatus : rayv1 .JobStatusFailed , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
1969
+ getJobInfo := func (context.Context , string ) (* utiltypes .RayJobInfo , error ) { //nolint:unparam // This is a mock function so parameters are required
1970
+ return & utiltypes .RayJobInfo {JobStatus : rayv1 .JobStatusFailed , EndTime : uint64 (time .Now ().UnixMilli ())}, nil
1970
1971
}
1971
1972
fakeRayDashboardClient .GetJobInfoMock .Store (& getJobInfo )
1972
1973
defer fakeRayDashboardClient .GetJobInfoMock .Store (nil )
0 commit comments