From 92020629017a48bcb2d3e83cbaae3493ba40e414 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Wed, 8 Nov 2023 10:27:55 +0100 Subject: [PATCH] fix(snapshot_predicate_test): remove unneeded provisioning Unittest works directly with objects, there is no need for saving them in k8s DB Signed-off-by: Martin Basti --- gitops/snapshot_predicate_test.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/gitops/snapshot_predicate_test.go b/gitops/snapshot_predicate_test.go index 0c7662486..62a28c218 100644 --- a/gitops/snapshot_predicate_test.go +++ b/gitops/snapshot_predicate_test.go @@ -17,7 +17,6 @@ limitations under the License. package gitops_test import ( - "context" "github.com/redhat-appstudio/integration-service/gitops" . "github.com/onsi/ginkgo/v2" @@ -27,7 +26,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/event" - "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -139,12 +137,6 @@ var _ = Describe("Predicates", Ordered, func() { }, }, } - ctx := context.Background() - - Expect(k8sClient.Create(ctx, hasSnapshotUnknownStatus)).Should(Succeed()) - Expect(k8sClient.Create(ctx, hasSnapshotTrueStatus)).Should(Succeed()) - Expect(k8sClient.Create(ctx, hasSnapshotAnnotationOld)).Should(Succeed()) - Expect(k8sClient.Create(ctx, hasSnapshotAnnotationNew)).Should(Succeed()) // Set the binding statuses after they are created hasSnapshotUnknownStatus.Status.Conditions = []metav1.Condition{ @@ -161,13 +153,6 @@ var _ = Describe("Predicates", Ordered, func() { } }) - AfterAll(func() { - err := k8sClient.Delete(ctx, hasSnapshotUnknownStatus) - Expect(err == nil || errors.IsNotFound(err)).To(BeTrue()) - err = k8sClient.Delete(ctx, hasSnapshotTrueStatus) - Expect(err == nil || errors.IsNotFound(err)).To(BeTrue()) - }) - Context("when testing IntegrationSnapshotChangePredicate predicate", func() { instance := gitops.IntegrationSnapshotChangePredicate()