From a85e54f8574a4348d132c7bb0fe613f6081b5abe Mon Sep 17 00:00:00 2001 From: Zijun Wang <32318664+zijun726911@users.noreply.github.com> Date: Sat, 20 Jan 2024 01:49:43 +0800 Subject: [PATCH] - e2e test minor change (#591) - Makefile minor change Co-authored-by: Zijun Wang --- Makefile | 5 +++-- docs/contributing/developer.md | 1 + test/pkg/test/framework.go | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 93da0688..0d047a9d 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ run: ## Run in development mode .PHONY: presubmit -presubmit: manifest vet lint test ## Run all commands before submitting code +presubmit: vet manifest lint test ## Run all commands before submitting code .PHONY: vet vet: ## Vet the code and dependencies @@ -123,7 +123,8 @@ e2e-test: ## Run e2e tests against cluster pointed to by ~/.kube/config -v \ ./suites/integration/... \ --ginkgo.focus="${FOCUS}" \ - --ginkgo.skip="${SKIP}" + --ginkgo.skip="${SKIP}" \ + --ginkgo.v .SILENT: .PHONY: e2e-clean diff --git a/docs/contributing/developer.md b/docs/contributing/developer.md index a4713119..f17cafeb 100644 --- a/docs/contributing/developer.md +++ b/docs/contributing/developer.md @@ -133,6 +133,7 @@ You can create an IAM Role, with a Trust Policy allowing the primary account to ``` export SECONDARY_ACCOUNT_TEST_ROLE_ARN=arn:aws:iam::000000000000:role/MyRole +export FOCUS="RAM Share" REGION=us-west-2 make e2e-test ``` diff --git a/test/pkg/test/framework.go b/test/pkg/test/framework.go index 5822c924..602cfefd 100644 --- a/test/pkg/test/framework.go +++ b/test/pkg/test/framework.go @@ -155,16 +155,17 @@ func (env *Framework) ExpectToBeClean(ctx context.Context) { defer GinkgoRecover() env.EventuallyExpectNoneFound(ctx, testObject.ListType) }) - + tags := env.DefaultTags + tags[model.K8SServiceNamespaceKey] = aws.String(K8sNamespace) Eventually(func(g Gomega) { - arns, err := env.TaggingClient.FindResourcesByTags(ctx, services.ResourceTypeService, env.DefaultTags) + arns, err := env.TaggingClient.FindResourcesByTags(ctx, services.ResourceTypeService, tags) env.Log.Infow("Expecting no services created by the controller", "found", arns) g.Expect(err).To(BeNil()) g.Expect(arns).To(BeEmpty()) }).Should(Succeed()) Eventually(func(g Gomega) { - arns, err := env.TaggingClient.FindResourcesByTags(ctx, services.ResourceTypeTargetGroup, env.DefaultTags) + arns, err := env.TaggingClient.FindResourcesByTags(ctx, services.ResourceTypeTargetGroup, tags) env.Log.Infow("Expecting no target groups created by the controller", "found", arns) g.Expect(err).To(BeNil()) g.Expect(arns).To(BeEmpty())