From 4ee9956b65a7a017ee536b12beb14e7a15dec671 Mon Sep 17 00:00:00 2001 From: Jamison Tsai Date: Thu, 12 Dec 2024 17:27:23 +1100 Subject: [PATCH] delete print error and add error message if namespace not created --- test/apis/v1alpha1/api_validation_integration_test.go | 3 --- test/apis/v1alpha1/suite_test.go | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/test/apis/v1alpha1/api_validation_integration_test.go b/test/apis/v1alpha1/api_validation_integration_test.go index 8338bfd2..27fd35f1 100644 --- a/test/apis/v1alpha1/api_validation_integration_test.go +++ b/test/apis/v1alpha1/api_validation_integration_test.go @@ -40,7 +40,6 @@ var _ = Describe("Test networking v1alpha1 API validation", func() { By(fmt.Sprintf("expecting denial of CREATE API %s", name)) var err = hubClient.Create(ctx, multiClusterServiceName) var statusErr *k8serrors.StatusError - fmt.Print(err) Expect(errors.As(err, &statusErr)).To(BeTrue(), fmt.Sprintf("Create API call produced error %s. Error type wanted is %s.", reflect.TypeOf(err), reflect.TypeOf(&k8serrors.StatusError{}))) Expect(statusErr.Status().Message).Should(ContainSubstring("metadata.name max length is 63")) }) @@ -222,8 +221,6 @@ var _ = Describe("Test networking v1alpha1 API validation", func() { } By(fmt.Sprintf("expecting denial of CREATE API %s", name)) var err = hubClient.Create(ctx, serviceExportName) - fmt.Println("Print test") - fmt.Println(err) var statusErr *k8serrors.StatusError Expect(errors.As(err, &statusErr)).To(BeTrue(), fmt.Sprintf("Create API call produced error %s. Error type wanted is %s.", reflect.TypeOf(err), reflect.TypeOf(&k8serrors.StatusError{}))) Expect(statusErr.Status().Message).Should(ContainSubstring("metadata.name max length is 63")) diff --git a/test/apis/v1alpha1/suite_test.go b/test/apis/v1alpha1/suite_test.go index b2fcaed4..ce28e098 100644 --- a/test/apis/v1alpha1/suite_test.go +++ b/test/apis/v1alpha1/suite_test.go @@ -85,7 +85,7 @@ var _ = BeforeSuite(func() { Name: "testnamespace", }, } - Expect(hubClient.Create(ctx, &ns)).Should(Succeed()) + Expect(hubClient.Create(ctx, &ns)).Should(Succeed(), "failed to delete namespace") go func() { defer GinkgoRecover()