tests/int: do not wait for static objects

HelmRepo OCI, Alerts and Providers are static objects and don't need to
be checked for readiness.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
pull/4298/head
Sunny 1 year ago
parent e901e8b6f8
commit 2649bfb3a3

@ -27,7 +27,6 @@ import (
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
notiv1 "github.com/fluxcd/notification-controller/api/v1"
@ -119,32 +118,6 @@ metadata:
g.Expect(testEnv.Create(ctx, &alert)).ToNot(HaveOccurred())
defer testEnv.Delete(ctx, &alert)
g.Eventually(func() bool {
nn := types.NamespacedName{Name: provider.Name, Namespace: provider.Namespace}
obj := &notiv1beta3.Provider{}
err := testEnv.Get(ctx, nn, obj)
if err != nil {
return false
}
if err := checkReadyCondition(obj); err != nil {
t.Log(err)
return false
}
nn = types.NamespacedName{Name: alert.Name, Namespace: alert.Namespace}
alertObj := &notiv1beta3.Alert{}
err = testEnv.Get(ctx, nn, alertObj)
if err != nil {
return false
}
if err := checkReadyCondition(alertObj); err != nil {
t.Log(err)
return false
}
return true
}, testTimeout, testInterval).Should(BeTrue())
modifyKsSpec := func(spec *kustomizev1.KustomizationSpec) {
spec.Interval = metav1.Duration{Duration: 30 * time.Second}
spec.HealthChecks = []meta.NamespacedObjectKindReference{

@ -49,7 +49,7 @@ func TestOCIHelmRelease(t *testing.T) {
err := pushImagesFromURL(repoURL, "ghcr.io/stefanprodan/charts/podinfo:6.2.0", []string{"6.2.0"})
g.Expect(err).ToNot(HaveOccurred())
// Create HelmRepository and wait for it to sync
// Create HelmRepository.
helmRepository := sourcev1.HelmRepository{
ObjectMeta: metav1.ObjectMeta{Name: testID, Namespace: testID},
Spec: sourcev1.HelmRepositorySpec{
@ -66,21 +66,6 @@ func TestOCIHelmRelease(t *testing.T) {
g.Expect(testEnv.Create(ctx, &helmRepository)).To(Succeed())
defer testEnv.Delete(ctx, &helmRepository)
g.Eventually(func() bool {
obj := &sourcev1.HelmRepository{}
nn := types.NamespacedName{Name: helmRepository.Name, Namespace: helmRepository.Namespace}
err := testEnv.Get(ctx, nn, obj)
if err != nil {
t.Logf("error getting helm repository %s", err.Error())
return false
}
if err := checkReadyCondition(obj); err != nil {
t.Logf("%v", err)
return false
}
return true
}, testTimeout, testInterval).Should(BeTrue())
// create helm release
helmRelease := helmv2.HelmRelease{
ObjectMeta: metav1.ObjectMeta{Name: testID, Namespace: testID},

Loading…
Cancel
Save