diff --git a/apiserver/pkg/model/converter_test.go b/apiserver/pkg/model/converter_test.go index 2bfb2c2e6bf..3e2e2623075 100644 --- a/apiserver/pkg/model/converter_test.go +++ b/apiserver/pkg/model/converter_test.go @@ -630,7 +630,7 @@ func TestPopulateRayClusterSpec(t *testing.T) { assert.Equal(t, "resource", value.Key) default: assert.Equal(t, "FIELD", value.Source.String()) - assert.Equal(t, "", value.Name) + assert.Empty(t, value.Name) assert.Equal(t, "path", value.Key) } } @@ -645,7 +645,7 @@ func TestFromKubeToAPIComputeTemplates(t *testing.T) { assert.Equal(t, uint32(4), template.Cpu, "CPU mismatch") assert.Equal(t, uint32(8), template.Memory, "Memory mismatch") assert.Equal(t, uint32(0), template.Gpu, "GPU mismatch") - assert.Equal(t, "", template.GpuAccelerator, "GPU accelerator mismatch") + assert.Empty(t, template.GpuAccelerator, "GPU accelerator mismatch") } func TestPopulateTemplate(t *testing.T) { diff --git a/apiserver/pkg/util/cluster_test.go b/apiserver/pkg/util/cluster_test.go index 804b44f6e14..c8a4cf7bba8 100644 --- a/apiserver/pkg/util/cluster_test.go +++ b/apiserver/pkg/util/cluster_test.go @@ -608,8 +608,8 @@ func TestNewComputeTemplate(t *testing.T) { t.Errorf("failed to build compute template: %v", err) } - assert.Equal(t, "", configMap.Data["name"]) - assert.Equal(t, "", configMap.Data["namespace"]) + assert.Empty(t, configMap.Data["name"]) + assert.Empty(t, configMap.Data["namespace"]) assert.Equal(t, "2", configMap.Data["cpu"]) assert.Equal(t, "8", configMap.Data["memory"]) assert.Equal(t, "4", configMap.Data["gpu"]) diff --git a/apiserver/test/e2e/job_server_e2e_test.go b/apiserver/test/e2e/job_server_e2e_test.go index 28d52579a8e..bd0a592d08e 100644 --- a/apiserver/test/e2e/job_server_e2e_test.go +++ b/apiserver/test/e2e/job_server_e2e_test.go @@ -468,7 +468,7 @@ func TestGetJobByPaginationInNamespace(t *testing.T) { require.Equal(t, response.Jobs[0].Name, testJobs[i].Job.Name) continueToken = response.Continue } - require.Equal(t, "", continueToken) // Continue token should be empty because this is the last page + require.Empty(t, continueToken) // Continue token should be empty because this is the last page }) // Test pagination return all jobs @@ -482,7 +482,7 @@ func TestGetJobByPaginationInNamespace(t *testing.T) { require.Nil(t, actualRPCStatus, "No RPC status expected") require.NotNil(t, response, "A response is expected") require.Equal(t, len(response.Jobs), testJobNum) - require.Equal(t, "", response.Continue) // Continue token should be empty because this is the last page + require.Empty(t, response.Continue) // Continue token should be empty because this is the last page }) t.Run("Test no pagination", func(t *testing.T) { @@ -493,7 +493,7 @@ func TestGetJobByPaginationInNamespace(t *testing.T) { require.Nil(t, actualRPCStatus, "No RPC status expected") require.NotNil(t, response, "A response is expected") require.Equal(t, len(response.Jobs), testJobNum) - require.Equal(t, "", response.Continue) // Continue token should be empty because this is the last page + require.Empty(t, response.Continue) // Continue token should be empty because this is the last page }) } diff --git a/experimental/cmd/main.go b/experimental/cmd/main.go index 2142b1a245e..c04bd948556 100644 --- a/experimental/cmd/main.go +++ b/experimental/cmd/main.go @@ -12,7 +12,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/metadata" - "k8s.io/klog/v2" "github.com/ray-project/kuberay/experimental/pkg/grpcproxy" diff --git a/kubectl-plugin/pkg/cmd/get/get_cluster_test.go b/kubectl-plugin/pkg/cmd/get/get_cluster_test.go index 7f4a5dc0aa0..b5a541d23d2 100644 --- a/kubectl-plugin/pkg/cmd/get/get_cluster_test.go +++ b/kubectl-plugin/pkg/cmd/get/get_cluster_test.go @@ -329,7 +329,7 @@ func TestGetRayClusters(t *testing.T) { } require.NoError(t, err) - assert.Equal(t, len(tc.expectedRayClusters), len(rayClusters.Items)) + assert.Len(t, rayClusters.Items, len(tc.expectedRayClusters)) }) } }