From 6d1c496dfb1b0c444eb48b1f4ecb239bfab30da7 Mon Sep 17 00:00:00 2001 From: Rueian Date: Wed, 18 Dec 2024 09:01:11 +0800 Subject: [PATCH] [RayCluster][CI] fail fast all support functions in test/support/yaml.go Signed-off-by: Rueian --- ray-operator/test/support/yaml.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ray-operator/test/support/yaml.go b/ray-operator/test/support/yaml.go index 426114e703..289b96bc50 100644 --- a/ray-operator/test/support/yaml.go +++ b/ray-operator/test/support/yaml.go @@ -28,7 +28,7 @@ func DeserializeRayClusterYAML(t Test, filename string) *rayv1.RayCluster { t.T().Helper() rayCluster := &rayv1.RayCluster{} err := deserializeYAML(filename, rayCluster) - require.NoError(t.T(), err) + require.NoError(t.T(), err, "Fail to deserialize yaml file %s", filename) return rayCluster } @@ -36,7 +36,7 @@ func DeserializeRayJobYAML(t Test, filename string) *rayv1.RayJob { t.T().Helper() rayJob := &rayv1.RayJob{} err := deserializeYAML(filename, rayJob) - require.NoError(t.T(), err) + require.NoError(t.T(), err, "Fail to deserialize yaml file %s", filename) return rayJob } @@ -44,7 +44,7 @@ func DeserializeRayServiceYAML(t Test, filename string) *rayv1.RayService { t.T().Helper() rayService := &rayv1.RayService{} err := deserializeYAML(filename, rayService) - require.NoError(t.T(), err) + require.NoError(t.T(), err, "Fail to deserialize yaml file %s", filename) return rayService } @@ -52,7 +52,7 @@ func KubectlApplyYAML(t Test, filename string, namespace string) { t.T().Helper() kubectlCmd := exec.CommandContext(t.Ctx(), "kubectl", "apply", "-f", filename, "-n", namespace) err := kubectlCmd.Run() - require.NoError(t.T(), err) + require.NoError(t.T(), err, "Failed to apply %s to namespace %s", filename, namespace) t.T().Logf("Successfully applied %s to namespace %s", filename, namespace) } @@ -60,7 +60,7 @@ func KubectlApplyQuota(t Test, namespace, quota string) { t.T().Helper() kubectlCmd := exec.CommandContext(t.Ctx(), "kubectl", "create", "quota", namespace, "-n", namespace, quota) err := kubectlCmd.Run() - require.NoError(t.T(), err) + require.NoError(t.T(), err, "Failed to apply quota %s in %s", quota, namespace) t.T().Logf("Successfully applied quota %s in %s", quota, namespace) } @@ -68,6 +68,6 @@ func KubectlDeleteAllPods(t Test, namespace string) { t.T().Helper() kubectlCmd := exec.CommandContext(t.Ctx(), "kubectl", "delete", "--all", "pods", "-n", namespace) err := kubectlCmd.Run() - require.NoError(t.T(), err) + require.NoError(t.T(), err, "Failed to delete pods in %s", namespace) t.T().Logf("Successfully delete pods in %s", namespace) }