From 2fceba05c6d30720cba7eb8f7fc876d568b4a12f Mon Sep 17 00:00:00 2001 From: win5923 Date: Fri, 17 Jan 2025 22:30:57 +0800 Subject: [PATCH] Resloved conflicts Signed-off-by: win5923 --- ray-operator/controllers/ray/common/pod_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ray-operator/controllers/ray/common/pod_test.go b/ray-operator/controllers/ray/common/pod_test.go index 0ecae375707..b4728ad0d78 100644 --- a/ray-operator/controllers/ray/common/pod_test.go +++ b/ray-operator/controllers/ray/common/pod_test.go @@ -365,7 +365,6 @@ func TestConfigureGCSFaultToleranceWithAnnotations(t *testing.T) { isHeadPod: false, }, { - // The most common case. name: "GCS FT enabled with redis username and password env and ray start params referring to env", gcsFTEnabled: true, redisUsernameEnv: "test-username", @@ -389,6 +388,9 @@ func TestConfigureGCSFaultToleranceWithAnnotations(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { // Validate the test input + if test.redisUsernameEnv != "" && test.redisUsernameRayStartParams != "" { + assert.True(t, test.redisUsernameRayStartParams == "$REDIS_USERNAME") + } if test.redisPasswordEnv != "" && test.redisPasswordRayStartParams != "" { assert.True(t, test.redisPasswordRayStartParams == "$REDIS_PASSWORD") } @@ -475,6 +477,10 @@ func TestConfigureGCSFaultToleranceWithAnnotations(t *testing.T) { assert.Equal(t, podTemplate.Annotations[utils.RayExternalStorageNSAnnotationKey], test.storageNS) assert.True(t, utils.EnvVarExists(utils.RAY_EXTERNAL_STORAGE_NS, container.Env)) } + if test.redisUsernameEnv != "" { + env := getEnvVar(container, utils.REDIS_USERNAME) + assert.Equal(t, env.Value, test.redisUsernameEnv) + } if test.redisPasswordEnv != "" { env := getEnvVar(container, utils.REDIS_PASSWORD) assert.Equal(t, env.Value, test.redisPasswordEnv)