Skip to content

Commit

Permalink
fixup support archive test (#3814)
Browse files Browse the repository at this point in the history
  • Loading branch information
andriisoldatenko authored Sep 20, 2024
1 parent afefcf9 commit 52b1a19
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/helpers/components/edgeconnect/edgeconnect.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ import (
"github.com/Dynatrace/dynatrace-operator/pkg/api/status"
"github.com/Dynatrace/dynatrace-operator/pkg/api/v1alpha1"
"github.com/Dynatrace/dynatrace-operator/pkg/api/v1alpha2/edgeconnect"
"github.com/Dynatrace/dynatrace-operator/test/helpers/kubeobjects/deployment"
"github.com/Dynatrace/dynatrace-operator/test/helpers/tenant"
"github.com/stretchr/testify/require"
appsv1 "k8s.io/api/apps/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/e2e-framework/klient/k8s"
"sigs.k8s.io/e2e-framework/klient/wait"
"sigs.k8s.io/e2e-framework/klient/wait/conditions"
Expand All @@ -38,6 +41,11 @@ func VerifyStartup(builder *features.FeatureBuilder, level features.Level, testE
fmt.Sprintf("'%s' edgeconnect phase changes to 'Running'", testEdgeConnect.Name),
level,
WaitForPhase(testEdgeConnect, status.Running))

builder.WithStep(
fmt.Sprintf("'%s' edgeconnect deployment changes to 'Available'", testEdgeConnect.Name),
level,
WaitForDeployment(testEdgeConnect))
}

func Create(edgeConnect edgeconnect.EdgeConnect) features.Func {
Expand Down Expand Up @@ -96,3 +104,12 @@ func WaitForPhase(edgeConnect edgeconnect.EdgeConnect, phase status.DeploymentPh
return ctx
}
}

func WaitForDeployment(ec edgeconnect.EdgeConnect) features.Func {
return func(ctx context.Context, t *testing.T, envConfig *envconf.Config) context.Context {
dep := appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{Namespace: ec.Namespace, Name: ec.Name}}
deployment.WaitUntilReady(envConfig.Client().Resources(), &dep)

return ctx
}
}

0 comments on commit 52b1a19

Please sign in to comment.