Skip to content

Commit

Permalink
fix(snapshot_predicate_test): remove unneeded provisioning
Browse files Browse the repository at this point in the history
Unittest works directly with objects, there is no need for saving them
in k8s DB

Signed-off-by: Martin Basti <[email protected]>
  • Loading branch information
MartinBasti committed Nov 8, 2023
1 parent 82323e9 commit 9202062
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions gitops/snapshot_predicate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
)

Expand Down Expand Up @@ -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{
Expand All @@ -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()

Expand Down

0 comments on commit 9202062

Please sign in to comment.