Skip to content

Commit

Permalink
update e2e to use new cluster create/destory apis
Browse files Browse the repository at this point in the history
Signed-off-by: Mohamed Mahmoud <[email protected]>
  • Loading branch information
msherif1234 committed Oct 4, 2023
1 parent 50a8043 commit d325f5c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions e2e/basic/flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/mariomac/guara/pkg/test"
"github.com/netobserv/netobserv-ebpf-agent/e2e/cluster"
"github.com/netobserv/netobserv-ebpf-agent/e2e/cluster/tester"

"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
12 changes: 8 additions & 4 deletions e2e/cluster/kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
rt2 "runtime"

"github.com/netobserv/netobserv-ebpf-agent/e2e/cluster/tester"

"github.com/sirupsen/logrus"
"github.com/vladimirvivien/gexe"
"k8s.io/apimachinery/pkg/api/meta"
Expand All @@ -34,6 +35,7 @@ import (
"sigs.k8s.io/e2e-framework/pkg/env"
"sigs.k8s.io/e2e-framework/pkg/envconf"
"sigs.k8s.io/e2e-framework/pkg/envfuncs"
"sigs.k8s.io/e2e-framework/support/kind"
)

// DeployOrder specifies the order in which a Deployment must be executed, from lower to higher
Expand Down Expand Up @@ -170,9 +172,11 @@ func NewKind(kindClusterName, baseDir string, options ...Option) *Kind {
// Run the Kind cluster for the later execution of tests.
func (k *Kind) Run(m *testing.M) {
envFuncs := []env.Func{
envfuncs.CreateKindClusterWithConfig(k.clusterName,
kindImage,
path.Join(packageDir(), "base", "00-kind.yml")),
envfuncs.CreateClusterWithConfig(
kind.NewProvider(),
k.clusterName,
path.Join(packageDir(), "base", "00-kind.yml"),
kind.WithImage(kindImage)),
k.loadLocalImage(),
}
// Deploy base cluster dependencies and wait for readiness (if needed)
Expand All @@ -195,7 +199,7 @@ func (k *Kind) Run(m *testing.M) {
code := k.testEnv.Setup(envFuncs...).
Finish(
k.exportLogs(),
envfuncs.DestroyKindCluster(k.clusterName),
envfuncs.DestroyCluster(k.clusterName),
).Run(m)
log.WithField("returnCode", code).Info("tests finished run")
}
Expand Down
1 change: 1 addition & 0 deletions e2e/kafka/kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/netobserv/netobserv-ebpf-agent/e2e/basic"
"github.com/netobserv/netobserv-ebpf-agent/e2e/cluster"

"github.com/sirupsen/logrus"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down

0 comments on commit d325f5c

Please sign in to comment.