From 7a00a04c0adda2342b388f71455219d7d8447d2b Mon Sep 17 00:00:00 2001 From: Britania Rodriguez Reyes Date: Tue, 9 Apr 2024 15:16:10 -0700 Subject: [PATCH] comments --- test/e2e/placement_selecting_resources_test.go | 9 +++++---- test/e2e/utils_test.go | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/e2e/placement_selecting_resources_test.go b/test/e2e/placement_selecting_resources_test.go index bda880c7a..27ac8cf78 100644 --- a/test/e2e/placement_selecting_resources_test.go +++ b/test/e2e/placement_selecting_resources_test.go @@ -6,6 +6,9 @@ package e2e import ( "fmt" + rbacv1 "k8s.io/api/rbac/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/utils/ptr" "strconv" "time" @@ -13,11 +16,8 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" - rbacv1 "k8s.io/api/rbac/v1" - "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" placementv1beta1 "go.goms.io/fleet/apis/placement/v1beta1" @@ -764,10 +764,12 @@ var _ = Describe("validating CRP when selecting a reserved resource", Ordered, f var _ = Describe("validating CRP when failed to apply resources", Ordered, func() { crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess()) + workNamespaceName := fmt.Sprintf(workNamespaceNameTemplate, GinkgoParallelProcess()) BeforeAll(func() { By("creating work resources on hub cluster") createWorkResources() + Expect(hubClient.Get(ctx, types.NamespacedName{Name: workNamespaceName}, &corev1.Namespace{})).Should(Succeed(), "Failed to get the namespace %s", workNamespaceName) By("creating work namespace on member cluster") ns := appNamespace() @@ -808,7 +810,6 @@ var _ = Describe("validating CRP when failed to apply resources", Ordered, func( return err } - workNamespaceName := fmt.Sprintf(workNamespaceNameTemplate, GinkgoParallelProcess()) appConfigMapName := fmt.Sprintf(appConfigMapNameTemplate, GinkgoParallelProcess()) wantStatus := placementv1beta1.ClusterResourcePlacementStatus{ Conditions: []metav1.Condition{ diff --git a/test/e2e/utils_test.go b/test/e2e/utils_test.go index 9de5a05ef..2a011ae91 100644 --- a/test/e2e/utils_test.go +++ b/test/e2e/utils_test.go @@ -450,6 +450,7 @@ func createWorkResource(name, namespace string) { // createWorkResources creates some resources on the hub cluster for testing purposes. func createWorkResources() { ns := appNamespace() + By(fmt.Sprintf("Creating namespace: %s", ns.Name)) Expect(hubClient.Create(ctx, &ns)).To(Succeed(), "Failed to create namespace %s", ns.Namespace) configMap := appConfigMap()