Repository: kumahq/kuma
Pull request #2418 (2021-07-22 17:25:39)

fix(test): use port 0 binding for mads test
It was using a sequential port selection which was causing
problems when running tests in parallel

Signed-off-by: Charly Molter <charly.molter@konghq.com>


codecov-commenter: # [Codecov](https://codecov.io/gh/kumahq/kuma/pull/2418?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq) Report
> Merging [#2418](https://codecov.io/gh/kumahq/kuma/pull/2418?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq) (7803806) into [master](https://codecov.io/gh/kumahq/kuma/commit/f3ca1c70128a388698c6afc8a731f412a9cd48c8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq) (f3ca1c7) will **increase** coverage by `0.20%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/kumahq/kuma/pull/2418/graphs/tree.svg?width=650&height=150&src=pr&token=D7Yvqs6rwV&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq)](https://codecov.io/gh/kumahq/kuma/pull/2418?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq)

```diff
@@            Coverage Diff             @@
##           master    #2418      +/-   ##
==========================================
+ Coverage   52.34%   52.55%   +0.20%     
==========================================
  Files         876      878       +2     
  Lines       47837    47859      +22     
==========================================
+ Hits        25042    25153     +111     
+ Misses      20759    20657     -102     
- Partials     2036     2049      +13     
```


| [Impacted Files](https://codecov.io/gh/kumahq/kuma/pull/2418?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq) | Coverage Δ | |
|---|---|---|
| [pkg/xds/cache/once/cache.go](https://codecov.io/gh/kumahq/kuma/pull/2418/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq#diff-cGtnL3hkcy9jYWNoZS9vbmNlL2NhY2hlLmdv) | `87.17% <0.00%> (-7.70%)` | :arrow_down: |
| [pkg/mads/v1/client/client.go](https://codecov.io/gh/kumahq/kuma/pull/2418/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq#diff-cGtnL21hZHMvdjEvY2xpZW50L2NsaWVudC5nbw==) | `41.25% <0.00%> (-2.50%)` | :arrow_down: |
| [api/observability/v1/mads.pb.go](https://codecov.io/gh/kumahq/kuma/pull/2418/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq#diff-YXBpL29ic2VydmFiaWxpdHkvdjEvbWFkcy5wYi5nbw==) | `34.53% <0.00%> (-1.04%)` | :arrow_down: |
| [api/internal/util/proto/types.go](https://codecov.io/gh/kumahq/kuma/pull/2418/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq#diff-YXBpL2ludGVybmFsL3V0aWwvcHJvdG8vdHlwZXMuZ28=) | `100.00% <0.00%> (ø)` | |
| [api/internal/util/proto/proto.go](https://codecov.io/gh/kumahq/kuma/pull/2418/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq#diff-YXBpL2ludGVybmFsL3V0aWwvcHJvdG8vcHJvdG8uZ28=) | `70.00% <0.00%> (ø)` | |
| [pkg/xds/generator/direct\_access\_proxy\_generator.go](https://codecov.io/gh/kumahq/kuma/pull/2418/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq#diff-cGtnL3hkcy9nZW5lcmF0b3IvZGlyZWN0X2FjY2Vzc19wcm94eV9nZW5lcmF0b3IuZ28=) | `83.90% <0.00%> (+1.14%)` | :arrow_up: |
| [pkg/dns/vips\_allocator.go](https://codecov.io/gh/kumahq/kuma/pull/2418/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq#diff-cGtnL2Rucy92aXBzX2FsbG9jYXRvci5nbw==) | `75.80% <0.00%> (+1.61%)` | :arrow_up: |
| [pkg/insights/resyncer.go](https://codecov.io/gh/kumahq/kuma/pull/2418/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq#diff-cGtnL2luc2lnaHRzL3Jlc3luY2VyLmdv) | `66.38% <0.00%> (+1.68%)` | :arrow_up: |
| [api/mesh/v1alpha1/dataplane\_helpers.go](https://codecov.io/gh/kumahq/kuma/pull/2418/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq#diff-YXBpL21lc2gvdjFhbHBoYTEvZGF0YXBsYW5lX2hlbHBlcnMuZ28=) | `79.32% <0.00%> (+1.68%)` | :arrow_up: |
| [pkg/core/resources/manager/cache.go](https://codecov.io/gh/kumahq/kuma/pull/2418/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq#diff-cGtnL2NvcmUvcmVzb3VyY2VzL21hbmFnZXIvY2FjaGUuZ28=) | `84.41% <0.00%> (+2.59%)` | :arrow_up: |
| ... and [9 more](https://codecov.io/gh/kumahq/kuma/pull/2418/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/kumahq/kuma/pull/2418?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/kumahq/kuma/pull/2418?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq). Last update [f3ca1c7...7803806](https://codecov.io/gh/kumahq/kuma/pull/2418?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kumahq).

jpeach: @lahabana Do we need both `PickTCPPort` and `FindFreePort`? Since they both listen and close, I would expect they are both subject to the same race conditions?
lahabana: @jpeach they have 2 different use cases:

`PickTCPPort` is meant to be used for finding the closest available port from the start of a range. It's used for finding a port for the dataplane admin for example. It's also used in the test framework and I think in this case it makes debugging easy (port are mostly predictable).

`FindFreePort` is only aimed at testing so we just bind to port 0 to reduce the risk of a race for the port (Combination of pseudorandom selection + TIME_WAIT).

So both have the same issue which (I believe it is only avoidable by using Unix Domain Sockets rather than network sockets) but `FindFreePort` is less likely to hit it which is why I'm swapping it here.

Patch:
diff --git a/app/kuma-cp/cmd/root.go b/app/kuma-cp/cmd/root.go
index fd97ee9e1..eb5402286 100644
--- a/app/kuma-cp/cmd/root.go
+++ b/app/kuma-cp/cmd/root.go
@@ -3,6 +3,7 @@ package cmd
 import (
 	"fmt"
 	"os"
+	"path/filepath"
 
 	"github.com/spf13/cobra"
 
@@ -37,8 +38,13 @@ func newRootCmd() *cobra.Command {
 			}
 
 			if args.outputPath != "" {
-				fmt.Printf("logs will be stored in %v", args.outputPath)
-				core.SetLogger(core.NewLoggerWithRotation(level, args.outputPath, args.maxSize, args.maxBackups, args.maxAge))
+				output, err := filepath.Abs(args.outputPath)
+				if err != nil {
+					return err
+				}
+
+				fmt.Printf("%s: logs will be stored in %q\n", "kuma-cp", output)
+				core.SetLogger(core.NewLoggerWithRotation(level, output, args.maxSize, args.maxBackups, args.maxAge))
 			} else {
 				core.SetLogger(core.NewLogger(level))
 			}
diff --git a/app/kuma-dp/cmd/root.go b/app/kuma-dp/cmd/root.go
index c27778a05..9f27c5ad1 100644
--- a/app/kuma-dp/cmd/root.go
+++ b/app/kuma-dp/cmd/root.go
@@ -3,6 +3,7 @@ package cmd
 import (
 	"fmt"
 	"os"
+	"path/filepath"
 
 	"github.com/spf13/cobra"
 
@@ -35,8 +36,13 @@ func NewRootCmd(rootCtx *RootContext) *cobra.Command {
 				return err
 			}
 			if args.outputPath != "" {
-				fmt.Printf("logs will be stored in %v", args.outputPath)
-				core.SetLogger(core.NewLoggerWithRotation(level, args.outputPath, args.maxSize, args.maxBackups, args.maxAge))
+				output, err := filepath.Abs(args.outputPath)
+				if err != nil {
+					return err
+				}
+
+				fmt.Printf("%s: logs will be stored in %q\n", "kuma-dp", output)
+				core.SetLogger(core.NewLoggerWithRotation(level, output, args.maxSize, args.maxBackups, args.maxAge))
 			} else {
 				core.SetLogger(core.NewLogger(level))
 			}
diff --git a/app/kuma-prometheus-sd/cmd/root.go b/app/kuma-prometheus-sd/cmd/root.go
index 95ef982b2..a57a3a2bf 100644
--- a/app/kuma-prometheus-sd/cmd/root.go
+++ b/app/kuma-prometheus-sd/cmd/root.go
@@ -3,6 +3,7 @@ package cmd
 import (
 	"fmt"
 	"os"
+	"path/filepath"
 
 	"github.com/spf13/cobra"
 
@@ -35,8 +36,13 @@ func newRootCmd() *cobra.Command {
 				return err
 			}
 			if args.outputPath != "" {
-				fmt.Printf("logs will be stored in %v", args.outputPath)
-				core.SetLogger(core.NewLoggerWithRotation(level, args.outputPath, args.maxSize, args.maxBackups, args.maxAge))
+				output, err := filepath.Abs(args.outputPath)
+				if err != nil {
+					return err
+				}
+
+				fmt.Printf("%s: logs will be stored in %q\n", "kuma-prometheus-sd", output)
+				core.SetLogger(core.NewLoggerWithRotation(level, output, args.maxSize, args.maxBackups, args.maxAge))
 			} else {
 				core.SetLogger(core.NewLogger(level))
 			}
diff --git a/pkg/core/xds/v2/context.go b/pkg/core/xds/v2/context.go
deleted file mode 100644
index 1bdbdbafd..000000000
--- a/pkg/core/xds/v2/context.go
+++ /dev/null
@@ -1,67 +0,0 @@
-package v2
-
-import (
-	envoy_core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
-	envoy_cache "github.com/envoyproxy/go-control-plane/pkg/cache/v2"
-	envoy_log "github.com/envoyproxy/go-control-plane/pkg/log"
-	"github.com/go-logr/logr"
-
-	"github.com/kumahq/kuma/pkg/core"
-	"github.com/kumahq/kuma/pkg/core/xds"
-	util_xds "github.com/kumahq/kuma/pkg/util/xds"
-)
-
-type XdsContext interface {
-	Hasher() envoy_cache.NodeHash
-	Cache() envoy_cache.SnapshotCache
-}
-
-func NewXdsContext() XdsContext {
-	return newXdsContext("xds-server", true)
-}
-
-func newXdsContext(name string, ads bool) XdsContext {
-	log := core.Log.WithName(name)
-	hasher := hasher{log}
-	logger := util_xds.NewLogger(log)
-	cache := envoy_cache.NewSnapshotCache(ads, hasher, logger)
-	return &xdsContext{
-		NodeHash:      hasher,
-		Logger:        logger,
-		SnapshotCache: cache,
-	}
-}
-
-var _ XdsContext = &xdsContext{}
-
-type xdsContext struct {
-	envoy_cache.NodeHash
-	envoy_log.Logger
-	envoy_cache.SnapshotCache
-}
-
-func (c *xdsContext) Hasher() envoy_cache.NodeHash {
-	return c.NodeHash
-}
-
-func (c *xdsContext) Cache() envoy_cache.SnapshotCache {
-	return c.SnapshotCache
-}
-
-var _ envoy_cache.NodeHash = &hasher{}
-
-type hasher struct {
-	log logr.Logger
-}
-
-func (h hasher) ID(node *envoy_core.Node) string {
-	if node == nil {
-		return "unknown"
-	}
-	proxyId, err := xds.ParseProxyIdFromString(node.GetId())
-	if err != nil {
-		h.log.Error(err, "failed to parse Proxy ID", "node", node)
-		return "unknown"
-	}
-	return proxyId.String()
-}
diff --git a/pkg/xds/generator/proxy_template.go b/pkg/xds/generator/proxy_template.go
index 885324d33..195795ada 100644
--- a/pkg/xds/generator/proxy_template.go
+++ b/pkg/xds/generator/proxy_template.go
@@ -5,17 +5,17 @@ import (
 
 	"github.com/pkg/errors"
 
-	"github.com/kumahq/kuma/pkg/xds/generator/modifications"
-
-	kuma_mesh "github.com/kumahq/kuma/api/mesh/v1alpha1"
+	mesh_proto "github.com/kumahq/kuma/api/mesh/v1alpha1"
 	mesh_core "github.com/kumahq/kuma/pkg/core/resources/apis/mesh"
 	model "github.com/kumahq/kuma/pkg/core/xds"
 	util_envoy "github.com/kumahq/kuma/pkg/util/envoy"
 	xds_context "github.com/kumahq/kuma/pkg/xds/context"
+	"github.com/kumahq/kuma/pkg/xds/generator/modifications"
+	"github.com/kumahq/kuma/pkg/xds/template"
 )
 
 type ProxyTemplateGenerator struct {
-	ProxyTemplate *kuma_mesh.ProxyTemplate
+	ProxyTemplate *mesh_proto.ProxyTemplate
 }
 
 func (g *ProxyTemplateGenerator) Generate(ctx xds_context.Context, proxy *model.Proxy) (*model.ResourceSet, error) {
@@ -44,7 +44,7 @@ func (g *ProxyTemplateGenerator) Generate(ctx xds_context.Context, proxy *model.
 const OriginProxyTemplateRaw = "proxy-template-raw"
 
 type ProxyTemplateRawSource struct {
-	Resources []*kuma_mesh.ProxyTemplateRawResource
+	Resources []*mesh_proto.ProxyTemplateRawResource
 }
 
 func (s *ProxyTemplateRawSource) Generate(_ xds_context.Context, proxy *model.Proxy) (*model.ResourceSet, error) {
@@ -64,7 +64,17 @@ func (s *ProxyTemplateRawSource) Generate(_ xds_context.Context, proxy *model.Pr
 	return resources, nil
 }
 
-var predefinedProfiles = make(map[string]ResourceGenerator)
+type ProxyTemplateProfileSource struct {
+	ProfileName string
+}
+
+func (s *ProxyTemplateProfileSource) Generate(ctx xds_context.Context, proxy *model.Proxy) (*model.ResourceSet, error) {
+	g, ok := predefinedProfiles[s.ProfileName]
+	if !ok {
+		return nil, fmt.Errorf("profile{name=%q}: unknown profile", s.ProfileName)
+	}
+	return g.Generate(ctx, proxy)
+}
 
 func NewDefaultProxyProfile() ResourceGenerator {
 	return CompositeResourceGenerator{
@@ -80,6 +90,19 @@ func NewDefaultProxyProfile() ResourceGenerator {
 	}
 }
 
+// DefaultTemplateResolver is the default template resolver that xDS
+// generators fall back to if they are otherwise unable to determine which
+// ProxyTemplate resource to apply. Plugins may modify this variable.
+var DefaultTemplateResolver template.ProxyTemplateResolver = &template.StaticProxyTemplateResolver{
+	Template: &mesh_proto.ProxyTemplate{
+		Conf: &mesh_proto.ProxyTemplate_Conf{
+			Imports: []string{mesh_core.ProfileDefaultProxy},
+		},
+	},
+}
+
+var predefinedProfiles = make(map[string]ResourceGenerator)
+
 func init() {
 	RegisterProfile(mesh_core.ProfileDefaultProxy, NewDefaultProxyProfile())
 	RegisterProfile(IngressProxy, CompositeResourceGenerator{AdminProxyGenerator{}, IngressGenerator{}})
@@ -88,15 +111,3 @@ func init() {
 func RegisterProfile(profileName string, generator ResourceGenerator) {
 	predefinedProfiles[profileName] = generator
 }
-
-type ProxyTemplateProfileSource struct {
-	ProfileName string
-}
-
-func (s *ProxyTemplateProfileSource) Generate(ctx xds_context.Context, proxy *model.Proxy) (*model.ResourceSet, error) {
-	g, ok := predefinedProfiles[s.ProfileName]
-	if !ok {
-		return nil, fmt.Errorf("profile{name=%q}: unknown profile", s.ProfileName)
-	}
-	return g.Generate(ctx, proxy)
-}
diff --git a/pkg/xds/server/callbacks/dataplane_status_tracker.go b/pkg/xds/server/callbacks/dataplane_status_tracker.go
index 181b91d93..9315665bf 100644
--- a/pkg/xds/server/callbacks/dataplane_status_tracker.go
+++ b/pkg/xds/server/callbacks/dataplane_status_tracker.go
@@ -16,7 +16,7 @@ import (
 	util_xds "github.com/kumahq/kuma/pkg/util/xds"
 )
 
-var statusTrackerLog = core.Log.WithName("xds").WithName("statusTracker")
+var statusTrackerLog = core.Log.WithName("xds").WithName("status-tracker")
 
 type DataplaneStatusTracker interface {
 	util_xds.Callbacks
diff --git a/pkg/xds/server/v3/components.go b/pkg/xds/server/v3/components.go
index d35ec7f76..b12a32394 100644
--- a/pkg/xds/server/v3/components.go
+++ b/pkg/xds/server/v3/components.go
@@ -7,10 +7,10 @@ import (
 	envoy_service_discovery "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
 	envoy_server "github.com/envoyproxy/go-control-plane/pkg/server/v3"
 
+	mesh_proto "github.com/kumahq/kuma/api/mesh/v1alpha1"
 	"github.com/kumahq/kuma/pkg/core"
 	core_model "github.com/kumahq/kuma/pkg/core/resources/model"
 	core_runtime "github.com/kumahq/kuma/pkg/core/runtime"
-	v3 "github.com/kumahq/kuma/pkg/core/xds/v3"
 	util_xds "github.com/kumahq/kuma/pkg/util/xds"
 	util_xds_v3 "github.com/kumahq/kuma/pkg/util/xds/v3"
 	"github.com/kumahq/kuma/pkg/xds/auth"
@@ -18,6 +18,7 @@ import (
 	"github.com/kumahq/kuma/pkg/xds/cache/mesh"
 	xds_context "github.com/kumahq/kuma/pkg/xds/context"
 	envoy_common "github.com/kumahq/kuma/pkg/xds/envoy"
+	"github.com/kumahq/kuma/pkg/xds/generator"
 	xds_metrics "github.com/kumahq/kuma/pkg/xds/metrics"
 	xds_callbacks "github.com/kumahq/kuma/pkg/xds/server/callbacks"
 	xds_sync "github.com/kumahq/kuma/pkg/xds/sync"
@@ -33,7 +34,7 @@ func RegisterXDS(
 	envoyCpCtx *xds_context.ControlPlaneContext,
 	rt core_runtime.Runtime,
 ) error {
-	xdsContext := v3.NewXdsContext()
+	xdsContext := NewXdsContext()
 
 	authenticator, err := auth_components.DefaultAuthenticator(rt)
 	if err != nil {
@@ -70,26 +71,38 @@ func RegisterXDS(
 	return nil
 }
 
-func DefaultReconciler(rt core_runtime.Runtime, xdsContext v3.XdsContext) xds_sync.SnapshotReconciler {
+func DefaultReconciler(rt core_runtime.Runtime, xdsContext XdsContext) xds_sync.SnapshotReconciler {
+	resolver := xds_template.SequentialResolver(
+		&xds_template.SimpleProxyTemplateResolver{
+			ReadOnlyResourceManager: rt.ReadOnlyResourceManager(),
+		},
+		generator.DefaultTemplateResolver,
+	)
+
 	return &reconciler{
 		&templateSnapshotGenerator{
-			ResourceSetHooks: rt.XDSHooks().ResourceSetHooks(),
-			ProxyTemplateResolver: &xds_template.SimpleProxyTemplateResolver{
-				ReadOnlyResourceManager: rt.ReadOnlyResourceManager(),
-				DefaultProxyTemplate:    xds_template.DefaultProxyTemplate,
-			},
+			ResourceSetHooks:      rt.XDSHooks().ResourceSetHooks(),
+			ProxyTemplateResolver: resolver,
 		},
 		&simpleSnapshotCacher{xdsContext.Hasher(), xdsContext.Cache()},
 	}
 }
 
-func DefaultIngressReconciler(rt core_runtime.Runtime, xdsContext v3.XdsContext) xds_sync.SnapshotReconciler {
+func DefaultIngressReconciler(rt core_runtime.Runtime, xdsContext XdsContext) xds_sync.SnapshotReconciler {
+	resolver := &xds_template.StaticProxyTemplateResolver{
+		Template: &mesh_proto.ProxyTemplate{
+			Conf: &mesh_proto.ProxyTemplate_Conf{
+				Imports: []string{
+					generator.IngressProxy,
+				},
+			},
+		},
+	}
+
 	return &reconciler{
 		generator: &templateSnapshotGenerator{
-			ResourceSetHooks: rt.XDSHooks().ResourceSetHooks(),
-			ProxyTemplateResolver: &xds_template.StaticProxyTemplateResolver{
-				Template: xds_template.IngressProxyTemplate,
-			},
+			ResourceSetHooks:      rt.XDSHooks().ResourceSetHooks(),
+			ProxyTemplateResolver: resolver,
 		},
 		cacher: &simpleSnapshotCacher{xdsContext.Hasher(), xdsContext.Cache()},
 	}
diff --git a/pkg/xds/template/proxy_template.go b/pkg/xds/template/proxy_template.go
deleted file mode 100644
index 4aa4c5461..000000000
--- a/pkg/xds/template/proxy_template.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package template
-
-import (
-	kuma_mesh "github.com/kumahq/kuma/api/mesh/v1alpha1"
-	core_mesh "github.com/kumahq/kuma/pkg/core/resources/apis/mesh"
-	"github.com/kumahq/kuma/pkg/xds/generator"
-)
-
-var (
-	DefaultProxyTemplate = &kuma_mesh.ProxyTemplate{
-		Conf: &kuma_mesh.ProxyTemplate_Conf{
-			Imports: []string{
-				core_mesh.ProfileDefaultProxy,
-			},
-		},
-	}
-
-	IngressProxyTemplate = &kuma_mesh.ProxyTemplate{
-		Conf: &kuma_mesh.ProxyTemplate_Conf{
-			Imports: []string{
-				generator.IngressProxy,
-			},
-		},
-	}
-)
diff --git a/pkg/xds/template/proxy_template_resolver.go b/pkg/xds/template/proxy_template_resolver.go
index 2c4d7a25d..cf6f89fdb 100644
--- a/pkg/xds/template/proxy_template_resolver.go
+++ b/pkg/xds/template/proxy_template_resolver.go
@@ -22,8 +22,7 @@ type ProxyTemplateResolver interface {
 }
 
 type SimpleProxyTemplateResolver struct {
-	manager.ReadOnlyResourceManager
-	DefaultProxyTemplate *mesh_proto.ProxyTemplate
+	ReadOnlyResourceManager manager.ReadOnlyResourceManager
 }
 
 func (r *SimpleProxyTemplateResolver) GetTemplate(proxy *model.Proxy) *mesh_proto.ProxyTemplate {
@@ -44,8 +43,9 @@ func (r *SimpleProxyTemplateResolver) GetTemplate(proxy *model.Proxy) *mesh_prot
 		log.V(2).Info("found the best matching ProxyTemplate", "proxytemplate", core_model.MetaToResourceKey(bestMatchTemplate.GetMeta()))
 		return bestMatchTemplate.(*mesh_core.ProxyTemplateResource).Spec
 	}
-	log.V(2).Info("falling back to the default ProxyTemplate since there is no best match", "templates", templateList.Items)
-	return r.DefaultProxyTemplate
+
+	log.V(2).Info("no matching ProxyTemplate")
+	return nil
 }
 
 type StaticProxyTemplateResolver struct {
@@ -55,3 +55,22 @@ type StaticProxyTemplateResolver struct {
 func (r *StaticProxyTemplateResolver) GetTemplate(proxy *model.Proxy) *mesh_proto.ProxyTemplate {
 	return r.Template
 }
+
+type sequentialResolver []ProxyTemplateResolver
+
+func (s sequentialResolver) GetTemplate(proxy *model.Proxy) *mesh_proto.ProxyTemplate {
+	for _, r := range s {
+		if t := r.GetTemplate(proxy); t != nil {
+			return t
+		}
+	}
+
+	return nil
+}
+
+// SequentialResolver returns a new ProxyTemplate resolver that applies
+// each of the resolvers given as arguments in turn. The result of the
+// first successful resolver is returned.
+func SequentialResolver(r ...ProxyTemplateResolver) ProxyTemplateResolver {
+	return sequentialResolver(r)
+}


Test patch:
diff --git a/api/mesh/v1alpha1/v1alpha1_suite_test.go b/api/mesh/v1alpha1/v1alpha1_suite_test.go
index 090a64720..f921a0542 100644
--- a/api/mesh/v1alpha1/v1alpha1_suite_test.go
+++ b/api/mesh/v1alpha1/v1alpha1_suite_test.go
@@ -8,6 +8,6 @@ import (
 )
 
 func TestV1alpha1(t *testing.T) {
-	RegisterFailHandler(Fail)
+	RegisterFailHandlerWithT(t, Fail)
 	RunSpecs(t, "V1alpha1 Suite")
 }
diff --git a/api/observability/v1/v1_suite_test.go b/api/observability/v1/v1_suite_test.go
index 914079324..bb60b71b0 100644
--- a/api/observability/v1/v1_suite_test.go
+++ b/api/observability/v1/v1_suite_test.go
@@ -8,6 +8,6 @@ import (
 )
 
 func TestV1alpha1(t *testing.T) {
-	RegisterFailHandler(Fail)
+	RegisterFailHandlerWithT(t, Fail)
 	RunSpecs(t, "v1 Suite")
 }
diff --git a/api/observability/v1alpha1/v1alpha1_suite_test.go b/api/observability/v1alpha1/v1alpha1_suite_test.go
index 090a64720..f921a0542 100644
--- a/api/observability/v1alpha1/v1alpha1_suite_test.go
+++ b/api/observability/v1alpha1/v1alpha1_suite_test.go
@@ -8,6 +8,6 @@ import (
 )
 
 func TestV1alpha1(t *testing.T) {
-	RegisterFailHandler(Fail)
+	RegisterFailHandlerWithT(t, Fail)
 	RunSpecs(t, "V1alpha1 Suite")
 }
diff --git a/api/system/v1alpha1/v1alpha1_suite_test.go b/api/system/v1alpha1/v1alpha1_suite_test.go
index 090a64720..f921a0542 100644
--- a/api/system/v1alpha1/v1alpha1_suite_test.go
+++ b/api/system/v1alpha1/v1alpha1_suite_test.go
@@ -8,6 +8,6 @@ import (
 )
 
 func TestV1alpha1(t *testing.T) {
-	RegisterFailHandler(Fail)
+	RegisterFailHandlerWithT(t, Fail)
 	RunSpecs(t, "V1alpha1 Suite")
 }
diff --git a/app/kuma-cp/cmd/cmd_suite_test.go b/app/kuma-cp/cmd/cmd_suite_test.go
index 52fb4520c..eaa03663c 100644
--- a/app/kuma-cp/cmd/cmd_suite_test.go
+++ b/app/kuma-cp/cmd/cmd_suite_test.go
@@ -19,21 +19,9 @@ package cmd
 import (
 	"testing"
 
-	"github.com/go-logr/logr"
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
-
-	"github.com/kumahq/kuma/pkg/core"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestCmd(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "CMD Suite")
+	test.RunSpecs(t, "CMD Suite")
 }
-
-var _ = BeforeSuite(func() {
-	core.SetLogger = func(l logr.Logger) {}
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-})
diff --git a/app/kuma-dp/cmd/cmd_suite_test.go b/app/kuma-dp/cmd/cmd_suite_test.go
index 22d1c5779..ffda82345 100644
--- a/app/kuma-dp/cmd/cmd_suite_test.go
+++ b/app/kuma-dp/cmd/cmd_suite_test.go
@@ -3,11 +3,9 @@ package cmd_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestCmd(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Cmd Suite")
+	test.RunSpecs(t, "Cmd Suite")
 }
diff --git a/app/kuma-dp/pkg/config/config_suite_test.go b/app/kuma-dp/pkg/config/config_suite_test.go
index ddc35f3ff..6ed91e3fe 100644
--- a/app/kuma-dp/pkg/config/config_suite_test.go
+++ b/app/kuma-dp/pkg/config/config_suite_test.go
@@ -3,11 +3,9 @@ package config_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestConfig(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Kuma DP Config Suite")
+	test.RunSpecs(t, "Kuma DP Config Suite")
 }
diff --git a/app/kuma-dp/pkg/dataplane/accesslogs/v3/accesslogs_suite_test.go b/app/kuma-dp/pkg/dataplane/accesslogs/v3/accesslogs_suite_test.go
index 4feac8e30..6fab9b01e 100644
--- a/app/kuma-dp/pkg/dataplane/accesslogs/v3/accesslogs_suite_test.go
+++ b/app/kuma-dp/pkg/dataplane/accesslogs/v3/accesslogs_suite_test.go
@@ -3,11 +3,9 @@ package v3_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestAccesslogs(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Accesslogs Suite")
+	test.RunSpecs(t, "Accesslogs Suite")
 }
diff --git a/app/kuma-dp/pkg/dataplane/dnsserver/dnsserver_suite_test.go b/app/kuma-dp/pkg/dataplane/dnsserver/dnsserver_suite_test.go
index 0749ea444..90021bd07 100644
--- a/app/kuma-dp/pkg/dataplane/dnsserver/dnsserver_suite_test.go
+++ b/app/kuma-dp/pkg/dataplane/dnsserver/dnsserver_suite_test.go
@@ -3,11 +3,9 @@ package dnsserver
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestEnvoy(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "DNS Server Suite")
+	test.RunSpecs(t, "DNS Server Suite")
 }
diff --git a/app/kuma-dp/pkg/dataplane/envoy/envoy_suite_test.go b/app/kuma-dp/pkg/dataplane/envoy/envoy_suite_test.go
index 7664d89be..c0dc8d647 100644
--- a/app/kuma-dp/pkg/dataplane/envoy/envoy_suite_test.go
+++ b/app/kuma-dp/pkg/dataplane/envoy/envoy_suite_test.go
@@ -3,11 +3,9 @@ package envoy
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestEnvoy(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Envoy Suite")
+	test.RunSpecs(t, "Envoy Suite")
 }
diff --git a/app/kuma-dp/pkg/dataplane/metrics/metrics_suite_test.go b/app/kuma-dp/pkg/dataplane/metrics/metrics_suite_test.go
index 5e8061b97..3922c73d0 100644
--- a/app/kuma-dp/pkg/dataplane/metrics/metrics_suite_test.go
+++ b/app/kuma-dp/pkg/dataplane/metrics/metrics_suite_test.go
@@ -3,11 +3,9 @@ package metrics
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMetrics(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Metrics Hijacker Suite")
+	test.RunSpecs(t, "Metrics Hijacker Suite")
 }
diff --git a/app/kuma-prometheus-sd/cmd/cmd_suite_test.go b/app/kuma-prometheus-sd/cmd/cmd_suite_test.go
index 22d1c5779..ffda82345 100644
--- a/app/kuma-prometheus-sd/cmd/cmd_suite_test.go
+++ b/app/kuma-prometheus-sd/cmd/cmd_suite_test.go
@@ -3,11 +3,9 @@ package cmd_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestCmd(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Cmd Suite")
+	test.RunSpecs(t, "Cmd Suite")
 }
diff --git a/app/kuma-prometheus-sd/pkg/discovery/xds/v1/suite_test.go b/app/kuma-prometheus-sd/pkg/discovery/xds/v1/suite_test.go
index 7dfb9f5a9..d3f5a531b 100644
--- a/app/kuma-prometheus-sd/pkg/discovery/xds/v1/suite_test.go
+++ b/app/kuma-prometheus-sd/pkg/discovery/xds/v1/suite_test.go
@@ -3,11 +3,9 @@ package v1_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestXds(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Prometheus SD V1 Suite")
+	test.RunSpecs(t, "Prometheus SD V1 Suite")
 }
diff --git a/app/kuma-prometheus-sd/pkg/discovery/xds/v1alpha1/suite_test.go b/app/kuma-prometheus-sd/pkg/discovery/xds/v1alpha1/suite_test.go
index 77b56be54..48b6967fd 100644
--- a/app/kuma-prometheus-sd/pkg/discovery/xds/v1alpha1/suite_test.go
+++ b/app/kuma-prometheus-sd/pkg/discovery/xds/v1alpha1/suite_test.go
@@ -3,11 +3,9 @@ package v1alpha1_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestXds(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Prometheus SD V1Alpha1 Suite")
+	test.RunSpecs(t, "Prometheus SD V1Alpha1 Suite")
 }
diff --git a/app/kuma-prometheus-sd/pkg/discovery/xds/xds_suite_test.go b/app/kuma-prometheus-sd/pkg/discovery/xds/xds_suite_test.go
index 8d5efb824..120947958 100644
--- a/app/kuma-prometheus-sd/pkg/discovery/xds/xds_suite_test.go
+++ b/app/kuma-prometheus-sd/pkg/discovery/xds/xds_suite_test.go
@@ -3,11 +3,9 @@ package xds_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestXds(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Xds Suite")
+	test.RunSpecs(t, "Xds Suite")
 }
diff --git a/app/kumactl/cmd/apply/apply_suite_test.go b/app/kumactl/cmd/apply/apply_suite_test.go
index a6b8e146f..c3df4a017 100644
--- a/app/kumactl/cmd/apply/apply_suite_test.go
+++ b/app/kumactl/cmd/apply/apply_suite_test.go
@@ -3,11 +3,9 @@ package apply_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestApplyCmd(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Apply Cmd Suite")
+	test.RunSpecs(t, "Apply Cmd Suite")
 }
diff --git a/app/kumactl/cmd/cmd_suite_test.go b/app/kumactl/cmd/cmd_suite_test.go
index 22d1c5779..ffda82345 100644
--- a/app/kumactl/cmd/cmd_suite_test.go
+++ b/app/kumactl/cmd/cmd_suite_test.go
@@ -3,11 +3,9 @@ package cmd_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestCmd(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Cmd Suite")
+	test.RunSpecs(t, "Cmd Suite")
 }
diff --git a/app/kumactl/cmd/completion/completion_suite_test.go b/app/kumactl/cmd/completion/completion_suite_test.go
index f851fd69a..15fe63a96 100644
--- a/app/kumactl/cmd/completion/completion_suite_test.go
+++ b/app/kumactl/cmd/completion/completion_suite_test.go
@@ -3,11 +3,9 @@ package completion_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestCompletionCmd(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Completion Cmd Suite")
+	test.RunSpecs(t, "Completion Cmd Suite")
 }
diff --git a/app/kumactl/cmd/config/config_suite_test.go b/app/kumactl/cmd/config/config_suite_test.go
index ad110e7bb..2f10b497b 100644
--- a/app/kumactl/cmd/config/config_suite_test.go
+++ b/app/kumactl/cmd/config/config_suite_test.go
@@ -3,11 +3,9 @@ package config_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestConfigCmd(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Config Cmd Suite")
+	test.RunSpecs(t, "Config Cmd Suite")
 }
diff --git a/app/kumactl/cmd/delete/delete_suite_test.go b/app/kumactl/cmd/delete/delete_suite_test.go
index d50e69234..797afecc0 100644
--- a/app/kumactl/cmd/delete/delete_suite_test.go
+++ b/app/kumactl/cmd/delete/delete_suite_test.go
@@ -3,11 +3,9 @@ package delete_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestDeleteCmd(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Delete Cmd Suite")
+	test.RunSpecs(t, "Delete Cmd Suite")
 }
diff --git a/app/kumactl/cmd/generate/generate_suite_test.go b/app/kumactl/cmd/generate/generate_suite_test.go
index b9fa49b7d..ae3e27d4d 100644
--- a/app/kumactl/cmd/generate/generate_suite_test.go
+++ b/app/kumactl/cmd/generate/generate_suite_test.go
@@ -3,11 +3,9 @@ package generate_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestGenerateDataplaneTokenCmd(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Generate Dataplane Token Suite")
+	test.RunSpecs(t, "Generate Dataplane Token Suite")
 }
diff --git a/app/kumactl/cmd/get/get_suite_test.go b/app/kumactl/cmd/get/get_suite_test.go
index f83995a8f..7cb1fb676 100644
--- a/app/kumactl/cmd/get/get_suite_test.go
+++ b/app/kumactl/cmd/get/get_suite_test.go
@@ -3,11 +3,9 @@ package get_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestGetCmd(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Get Cmd Suite")
+	test.RunSpecs(t, "Get Cmd Suite")
 }
diff --git a/app/kumactl/cmd/inspect/inspect_suite_test.go b/app/kumactl/cmd/inspect/inspect_suite_test.go
index 33fb46083..66a281f37 100644
--- a/app/kumactl/cmd/inspect/inspect_suite_test.go
+++ b/app/kumactl/cmd/inspect/inspect_suite_test.go
@@ -3,11 +3,9 @@ package inspect_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestGetCmd(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Inspect Cmd Suite")
+	test.RunSpecs(t, "Inspect Cmd Suite")
 }
diff --git a/app/kumactl/cmd/install/install_suite_test.go b/app/kumactl/cmd/install/install_suite_test.go
index e95baec8b..faa339a8a 100644
--- a/app/kumactl/cmd/install/install_suite_test.go
+++ b/app/kumactl/cmd/install/install_suite_test.go
@@ -3,11 +3,9 @@ package install_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestInstallCmd(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Install Cmd Suite")
+	test.RunSpecs(t, "Install Cmd Suite")
 }
diff --git a/app/kumactl/cmd/uninstall/uninstall_suite_test.go b/app/kumactl/cmd/uninstall/uninstall_suite_test.go
index 42fbc1451..810c9090b 100644
--- a/app/kumactl/cmd/uninstall/uninstall_suite_test.go
+++ b/app/kumactl/cmd/uninstall/uninstall_suite_test.go
@@ -3,11 +3,9 @@ package uninstall_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestInstallCmd(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Uninstall Cmd Suite")
+	test.RunSpecs(t, "Uninstall Cmd Suite")
 }
diff --git a/app/kumactl/pkg/errors/errors_suite_test.go b/app/kumactl/pkg/errors/errors_suite_test.go
index 58f333e15..efecbedeb 100644
--- a/app/kumactl/pkg/errors/errors_suite_test.go
+++ b/app/kumactl/pkg/errors/errors_suite_test.go
@@ -3,11 +3,9 @@ package errors_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestWs(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Errors")
+	test.RunSpecs(t, "Errors")
 }
diff --git a/app/kumactl/pkg/output/json/json_suite_test.go b/app/kumactl/pkg/output/json/json_suite_test.go
index b18dd7535..3bc901534 100644
--- a/app/kumactl/pkg/output/json/json_suite_test.go
+++ b/app/kumactl/pkg/output/json/json_suite_test.go
@@ -3,11 +3,9 @@ package json_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestJson(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Json Suite")
+	test.RunSpecs(t, "Json Suite")
 }
diff --git a/app/kumactl/pkg/output/table/table_suite_test.go b/app/kumactl/pkg/output/table/table_suite_test.go
index 0a005b136..ae90724ed 100644
--- a/app/kumactl/pkg/output/table/table_suite_test.go
+++ b/app/kumactl/pkg/output/table/table_suite_test.go
@@ -3,11 +3,9 @@ package table_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestTable(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Table Suite")
+	test.RunSpecs(t, "Table Suite")
 }
diff --git a/app/kumactl/pkg/output/yaml/yaml_suite_test.go b/app/kumactl/pkg/output/yaml/yaml_suite_test.go
index b7c6b6015..e2d6adec8 100644
--- a/app/kumactl/pkg/output/yaml/yaml_suite_test.go
+++ b/app/kumactl/pkg/output/yaml/yaml_suite_test.go
@@ -3,11 +3,9 @@ package yaml_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestYaml(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Yaml Suite")
+	test.RunSpecs(t, "Yaml Suite")
 }
diff --git a/app/kumactl/pkg/resources/resources_suite_test.go b/app/kumactl/pkg/resources/resources_suite_test.go
index b38445adb..63f16f9c4 100644
--- a/app/kumactl/pkg/resources/resources_suite_test.go
+++ b/app/kumactl/pkg/resources/resources_suite_test.go
@@ -3,11 +3,9 @@ package resources
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestResources(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Resources Suite")
+	test.RunSpecs(t, "Resources Suite")
 }
diff --git a/app/kumactl/pkg/tokens/client_suite_test.go b/app/kumactl/pkg/tokens/client_suite_test.go
index bf7e9107b..e19dd239d 100644
--- a/app/kumactl/pkg/tokens/client_suite_test.go
+++ b/app/kumactl/pkg/tokens/client_suite_test.go
@@ -3,11 +3,9 @@ package tokens_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestTokensClient(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Tokens Client Suite")
+	test.RunSpecs(t, "Tokens Client Suite")
 }
diff --git a/pkg/api-server/api_server_suite_test.go b/pkg/api-server/api_server_suite_test.go
index 40bf98c78..f596b2a28 100644
--- a/pkg/api-server/api_server_suite_test.go
+++ b/pkg/api-server/api_server_suite_test.go
@@ -3,11 +3,9 @@ package api_server_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestWs(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "API Server")
+	test.RunSpecs(t, "API Server")
 }
diff --git a/pkg/api-server/customization/customization_suite_test.go b/pkg/api-server/customization/customization_suite_test.go
index f9251d842..f5e0e6151 100644
--- a/pkg/api-server/customization/customization_suite_test.go
+++ b/pkg/api-server/customization/customization_suite_test.go
@@ -4,7 +4,6 @@ import (
 	"path/filepath"
 	"testing"
 
-	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
 
 	api_server "github.com/kumahq/kuma/pkg/api-server"
@@ -19,8 +18,7 @@ import (
 )
 
 func TestWs(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "API Server Customization")
+	test.RunSpecs(t, "API Server Customization")
 }
 
 func createTestApiServer(store store.ResourceStore, config *config_api_server.ApiServerConfig, enableGUI bool, metrics core_metrics.Metrics, wsManager customization.APIManager) *api_server.ApiServer {
diff --git a/pkg/clusterid/clusterid_suite_test.go b/pkg/clusterid/clusterid_suite_test.go
index 39e90a4fc..012dde409 100644
--- a/pkg/clusterid/clusterid_suite_test.go
+++ b/pkg/clusterid/clusterid_suite_test.go
@@ -3,11 +3,9 @@ package clusterid_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestClusterID(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Cluster ID Suite")
+	test.RunSpecs(t, "Cluster ID Suite")
 }
diff --git a/pkg/cmd/version/version_suite_test.go b/pkg/cmd/version/version_suite_test.go
index fa25d588f..01cc5718a 100644
--- a/pkg/cmd/version/version_suite_test.go
+++ b/pkg/cmd/version/version_suite_test.go
@@ -3,11 +3,9 @@ package version_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestVersion(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Version Suite")
+	test.RunSpecs(t, "Version Suite")
 }
diff --git a/pkg/config/app/kuma-cp/suite_test.go b/pkg/config/app/kuma-cp/suite_test.go
index de339617d..89e9e03b5 100644
--- a/pkg/config/app/kuma-cp/suite_test.go
+++ b/pkg/config/app/kuma-cp/suite_test.go
@@ -3,11 +3,9 @@ package kuma_cp
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestCpConfig(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Control Plane Configuration Suite")
+	test.RunSpecs(t, "Control Plane Configuration Suite")
 }
diff --git a/pkg/config/app/kuma-dp/kuma_dp_suite_test.go b/pkg/config/app/kuma-dp/kuma_dp_suite_test.go
index 177298dd2..dc18ff11e 100644
--- a/pkg/config/app/kuma-dp/kuma_dp_suite_test.go
+++ b/pkg/config/app/kuma-dp/kuma_dp_suite_test.go
@@ -3,11 +3,9 @@ package kumadp_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestKumaDp(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "KumaDp Suite")
+	test.RunSpecs(t, "KumaDp Suite")
 }
diff --git a/pkg/config/app/kuma-prometheus-sd/kuma_prometheus_sd_test.go b/pkg/config/app/kuma-prometheus-sd/kuma_prometheus_sd_test.go
index af02aa188..763a11b1a 100644
--- a/pkg/config/app/kuma-prometheus-sd/kuma_prometheus_sd_test.go
+++ b/pkg/config/app/kuma-prometheus-sd/kuma_prometheus_sd_test.go
@@ -3,11 +3,9 @@ package kuma_prometheus_sd_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestKumaPrometheusSD(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Kuma Prometheus SD Suite")
+	test.RunSpecs(t, "Kuma Prometheus SD Suite")
 }
diff --git a/pkg/config/plugins/resources/postgres/postgres_suite_test.go b/pkg/config/plugins/resources/postgres/postgres_suite_test.go
index 600228b55..119e329a9 100644
--- a/pkg/config/plugins/resources/postgres/postgres_suite_test.go
+++ b/pkg/config/plugins/resources/postgres/postgres_suite_test.go
@@ -3,11 +3,9 @@ package postgres_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestPostgresConfig(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Postgres Config Suite")
+	test.RunSpecs(t, "Postgres Config Suite")
 }
diff --git a/pkg/config/plugins/runtime/k8s/kuma_injector_suite_test.go b/pkg/config/plugins/runtime/k8s/kuma_injector_suite_test.go
index e2a2ce639..475b7bd44 100644
--- a/pkg/config/plugins/runtime/k8s/kuma_injector_suite_test.go
+++ b/pkg/config/plugins/runtime/k8s/kuma_injector_suite_test.go
@@ -3,11 +3,9 @@ package k8s_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestKumaInjector(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "KumaInjector Suite")
+	test.RunSpecs(t, "KumaInjector Suite")
 }
diff --git a/pkg/config/plugins/runtime/universal/universal_suite_test.go b/pkg/config/plugins/runtime/universal/universal_suite_test.go
index d33efd155..05b955ab6 100644
--- a/pkg/config/plugins/runtime/universal/universal_suite_test.go
+++ b/pkg/config/plugins/runtime/universal/universal_suite_test.go
@@ -3,11 +3,9 @@ package universal_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestUniversalConfig(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Universal Config Suite")
+	test.RunSpecs(t, "Universal Config Suite")
 }
diff --git a/pkg/config/suite_test.go b/pkg/config/suite_test.go
index 2b3eb4af6..bcbba1506 100644
--- a/pkg/config/suite_test.go
+++ b/pkg/config/suite_test.go
@@ -3,11 +3,9 @@ package config_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestConfig(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Configuration Suite")
+	test.RunSpecs(t, "Configuration Suite")
 }
diff --git a/pkg/config/types/types_suite_test.go b/pkg/config/types/types_suite_test.go
index 4da242531..4fd0b35b2 100644
--- a/pkg/config/types/types_suite_test.go
+++ b/pkg/config/types/types_suite_test.go
@@ -3,11 +3,9 @@ package types_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestPflag(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Types Suite")
+	test.RunSpecs(t, "Types Suite")
 }
diff --git a/pkg/config/xds/bootstrap/bootstrap_suite_test.go b/pkg/config/xds/bootstrap/bootstrap_suite_test.go
index c5bb04dbf..15ae28647 100644
--- a/pkg/config/xds/bootstrap/bootstrap_suite_test.go
+++ b/pkg/config/xds/bootstrap/bootstrap_suite_test.go
@@ -3,11 +3,9 @@ package bootstrap_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestBootstrap(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Bootstrap Suite")
+	test.RunSpecs(t, "Bootstrap Suite")
 }
diff --git a/pkg/config/xds/xds_suite_test.go b/pkg/config/xds/xds_suite_test.go
index 8d5efb824..120947958 100644
--- a/pkg/config/xds/xds_suite_test.go
+++ b/pkg/config/xds/xds_suite_test.go
@@ -3,11 +3,9 @@ package xds_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestXds(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Xds Suite")
+	test.RunSpecs(t, "Xds Suite")
 }
diff --git a/pkg/core/bootstrap/bootstrap_suite_test.go b/pkg/core/bootstrap/bootstrap_suite_test.go
index d7ca1f957..6664566b5 100644
--- a/pkg/core/bootstrap/bootstrap_suite_test.go
+++ b/pkg/core/bootstrap/bootstrap_suite_test.go
@@ -3,11 +3,9 @@ package bootstrap
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestBootstrap(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Bootstrap Suite")
+	test.RunSpecs(t, "Bootstrap Suite")
 }
diff --git a/pkg/core/config/manager/manager_suite_test.go b/pkg/core/config/manager/manager_suite_test.go
index 220750755..2cc2f83b3 100644
--- a/pkg/core/config/manager/manager_suite_test.go
+++ b/pkg/core/config/manager/manager_suite_test.go
@@ -3,11 +3,9 @@ package manager_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestConfigManager(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Config Manager Suite")
+	test.RunSpecs(t, "Config Manager Suite")
 }
diff --git a/pkg/core/datasource/datasource_suite_test.go b/pkg/core/datasource/datasource_suite_test.go
index 3a17c5599..27428e181 100644
--- a/pkg/core/datasource/datasource_suite_test.go
+++ b/pkg/core/datasource/datasource_suite_test.go
@@ -3,11 +3,9 @@ package datasource_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestDataSource(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "DataSource Suite")
+	test.RunSpecs(t, "DataSource Suite")
 }
diff --git a/pkg/core/dns/lookup/cache_suite_test.go b/pkg/core/dns/lookup/cache_suite_test.go
index d87e15354..9cda3d997 100644
--- a/pkg/core/dns/lookup/cache_suite_test.go
+++ b/pkg/core/dns/lookup/cache_suite_test.go
@@ -3,11 +3,9 @@ package lookup_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestDNSCaching(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "DNS with cache Suite")
+	test.RunSpecs(t, "DNS with cache Suite")
 }
diff --git a/pkg/core/faultinjections/matcher_suite_test.go b/pkg/core/faultinjections/matcher_suite_test.go
index c6504b472..043344647 100644
--- a/pkg/core/faultinjections/matcher_suite_test.go
+++ b/pkg/core/faultinjections/matcher_suite_test.go
@@ -3,11 +3,9 @@ package faultinjections
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMatcher(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "FaultInjection Matcher Suite")
+	test.RunSpecs(t, "FaultInjection Matcher Suite")
 }
diff --git a/pkg/core/logs/matcher_suite_test.go b/pkg/core/logs/matcher_suite_test.go
index 234d0483b..078be4e6b 100644
--- a/pkg/core/logs/matcher_suite_test.go
+++ b/pkg/core/logs/matcher_suite_test.go
@@ -3,11 +3,9 @@ package logs_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMatcher(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Log Matcher Suite")
+	test.RunSpecs(t, "Log Matcher Suite")
 }
diff --git a/pkg/core/managers/apis/dataplane/dataplane_manager_suit_test.go b/pkg/core/managers/apis/dataplane/dataplane_manager_suit_test.go
index 53db455b6..47dcc574c 100644
--- a/pkg/core/managers/apis/dataplane/dataplane_manager_suit_test.go
+++ b/pkg/core/managers/apis/dataplane/dataplane_manager_suit_test.go
@@ -3,11 +3,9 @@ package dataplane_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestDataplaneManager(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Dataplane Manager Suite")
+	test.RunSpecs(t, "Dataplane Manager Suite")
 }
diff --git a/pkg/core/managers/apis/dataplaneinsight/dataplane_insight_manager_suit_test.go b/pkg/core/managers/apis/dataplaneinsight/dataplane_insight_manager_suit_test.go
index 07f8731d5..024ca9d07 100644
--- a/pkg/core/managers/apis/dataplaneinsight/dataplane_insight_manager_suit_test.go
+++ b/pkg/core/managers/apis/dataplaneinsight/dataplane_insight_manager_suit_test.go
@@ -3,11 +3,9 @@ package dataplaneinsight_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestDataplaneInsightManager(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Dataplane Insights Manager Suite")
+	test.RunSpecs(t, "Dataplane Insights Manager Suite")
 }
diff --git a/pkg/core/managers/apis/mesh/mesh_manager_suite_test.go b/pkg/core/managers/apis/mesh/mesh_manager_suite_test.go
index 362af0d48..489705f2e 100644
--- a/pkg/core/managers/apis/mesh/mesh_manager_suite_test.go
+++ b/pkg/core/managers/apis/mesh/mesh_manager_suite_test.go
@@ -3,11 +3,9 @@ package mesh
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMeshManager(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Mesh Manager Suite")
+	test.RunSpecs(t, "Mesh Manager Suite")
 }
diff --git a/pkg/core/managers/apis/zone/zone_manager_suite_test.go b/pkg/core/managers/apis/zone/zone_manager_suite_test.go
index 7f8965310..b9b9bf0a3 100644
--- a/pkg/core/managers/apis/zone/zone_manager_suite_test.go
+++ b/pkg/core/managers/apis/zone/zone_manager_suite_test.go
@@ -3,11 +3,9 @@ package zone_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestZoneManager(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Zone Manager Suite")
+	test.RunSpecs(t, "Zone Manager Suite")
 }
diff --git a/pkg/core/managers/apis/zoneinsight/zone_insight_manager_suit_test.go b/pkg/core/managers/apis/zoneinsight/zone_insight_manager_suit_test.go
index b2d2e76ad..535bf79fa 100644
--- a/pkg/core/managers/apis/zoneinsight/zone_insight_manager_suit_test.go
+++ b/pkg/core/managers/apis/zoneinsight/zone_insight_manager_suit_test.go
@@ -3,11 +3,9 @@ package zoneinsight_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestZoneInsightManager(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Zone Insights Manager Suite")
+	test.RunSpecs(t, "Zone Insights Manager Suite")
 }
diff --git a/pkg/core/permissions/matcher_suite_test.go b/pkg/core/permissions/matcher_suite_test.go
index 2a96a06d0..6cc90aff4 100644
--- a/pkg/core/permissions/matcher_suite_test.go
+++ b/pkg/core/permissions/matcher_suite_test.go
@@ -3,11 +3,9 @@ package permissions
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMatcher(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Matcher Suite")
+	test.RunSpecs(t, "Matcher Suite")
 }
diff --git a/pkg/core/policy/policy_suite_test.go b/pkg/core/policy/policy_suite_test.go
index b0b90b23d..9327005f9 100644
--- a/pkg/core/policy/policy_suite_test.go
+++ b/pkg/core/policy/policy_suite_test.go
@@ -3,11 +3,9 @@ package policy_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMesh(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Policy Suite")
+	test.RunSpecs(t, "Policy Suite")
 }
diff --git a/pkg/core/ratelimits/matcher_suite_test.go b/pkg/core/ratelimits/matcher_suite_test.go
index c805cca02..b1448449b 100644
--- a/pkg/core/ratelimits/matcher_suite_test.go
+++ b/pkg/core/ratelimits/matcher_suite_test.go
@@ -3,11 +3,9 @@ package ratelimits
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMatcher(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Matcher Suite")
+	test.RunSpecs(t, "Matcher Suite")
 }
diff --git a/pkg/core/resources/apis/mesh/mesh_suit_test.go b/pkg/core/resources/apis/mesh/mesh_suit_test.go
index cf9efad9c..7b558a8e6 100644
--- a/pkg/core/resources/apis/mesh/mesh_suit_test.go
+++ b/pkg/core/resources/apis/mesh/mesh_suit_test.go
@@ -3,11 +3,9 @@ package mesh_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMesh(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Mesh Suite")
+	test.RunSpecs(t, "Mesh Suite")
 }
diff --git a/pkg/core/resources/apis/system/system_suit_test.go b/pkg/core/resources/apis/system/system_suit_test.go
index 1a10de68a..aeda3bb6c 100644
--- a/pkg/core/resources/apis/system/system_suit_test.go
+++ b/pkg/core/resources/apis/system/system_suit_test.go
@@ -3,11 +3,9 @@ package system_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestSystem(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "System Suite")
+	test.RunSpecs(t, "System Suite")
 }
diff --git a/pkg/core/resources/manager/manager_suite_test.go b/pkg/core/resources/manager/manager_suite_test.go
index 2ad079e42..5c6f5f72d 100644
--- a/pkg/core/resources/manager/manager_suite_test.go
+++ b/pkg/core/resources/manager/manager_suite_test.go
@@ -3,11 +3,9 @@ package manager_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestManager(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Resources Manager")
+	test.RunSpecs(t, "Resources Manager")
 }
diff --git a/pkg/core/resources/model/rest/rest_suite_test.go b/pkg/core/resources/model/rest/rest_suite_test.go
index 270afccd8..f9944531f 100644
--- a/pkg/core/resources/model/rest/rest_suite_test.go
+++ b/pkg/core/resources/model/rest/rest_suite_test.go
@@ -3,11 +3,9 @@ package rest_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestRest(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Rest Suite")
+	test.RunSpecs(t, "Rest Suite")
 }
diff --git a/pkg/core/secrets/manager/manager_suite_test.go b/pkg/core/secrets/manager/manager_suite_test.go
index 28a72de87..58f266106 100644
--- a/pkg/core/secrets/manager/manager_suite_test.go
+++ b/pkg/core/secrets/manager/manager_suite_test.go
@@ -3,11 +3,9 @@ package manager_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestSecretManager(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Secret Manager Suite")
+	test.RunSpecs(t, "Secret Manager Suite")
 }
diff --git a/pkg/core/validators/validators_suit_test.go b/pkg/core/validators/validators_suit_test.go
index 3f2d71ef5..26fc0059c 100644
--- a/pkg/core/validators/validators_suit_test.go
+++ b/pkg/core/validators/validators_suit_test.go
@@ -3,11 +3,9 @@ package validators_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestValidators(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Validators")
+	test.RunSpecs(t, "Validators")
 }
diff --git a/pkg/core/xds/xds_suite_test.go b/pkg/core/xds/xds_suite_test.go
index 8d5efb824..120947958 100644
--- a/pkg/core/xds/xds_suite_test.go
+++ b/pkg/core/xds/xds_suite_test.go
@@ -3,11 +3,9 @@ package xds_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestXds(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Xds Suite")
+	test.RunSpecs(t, "Xds Suite")
 }
diff --git a/pkg/defaults/defaults_suite_test.go b/pkg/defaults/defaults_suite_test.go
index cf5e82a3e..f4e32d8da 100644
--- a/pkg/defaults/defaults_suite_test.go
+++ b/pkg/defaults/defaults_suite_test.go
@@ -3,11 +3,9 @@ package defaults_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestDefaults(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Defaults")
+	test.RunSpecs(t, "Defaults")
 }
diff --git a/pkg/defaults/mesh/mesh_suite_test.go b/pkg/defaults/mesh/mesh_suite_test.go
index 68a07ad43..70741d59e 100644
--- a/pkg/defaults/mesh/mesh_suite_test.go
+++ b/pkg/defaults/mesh/mesh_suite_test.go
@@ -3,11 +3,9 @@ package mesh_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMesh(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Defaults Mesh")
+	test.RunSpecs(t, "Defaults Mesh")
 }
diff --git a/pkg/dns/suite_test.go b/pkg/dns/suite_test.go
index e83ae1ce3..eb46411db 100644
--- a/pkg/dns/suite_test.go
+++ b/pkg/dns/suite_test.go
@@ -3,11 +3,9 @@ package dns_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestDNS(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "DNS Suite")
+	test.RunSpecs(t, "DNS Suite")
 }
diff --git a/pkg/dns/vips/vips_suite_test.go b/pkg/dns/vips/vips_suite_test.go
index 5eed07a16..4420aad59 100644
--- a/pkg/dns/vips/vips_suite_test.go
+++ b/pkg/dns/vips/vips_suite_test.go
@@ -3,11 +3,9 @@ package vips_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestVIPs(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "VIPs Suite")
+	test.RunSpecs(t, "VIPs Suite")
 }
diff --git a/pkg/envoy/accesslog/v3/accesslog_suite_test.go b/pkg/envoy/accesslog/v3/accesslog_suite_test.go
index 9c5328fec..88a7948ee 100644
--- a/pkg/envoy/accesslog/v3/accesslog_suite_test.go
+++ b/pkg/envoy/accesslog/v3/accesslog_suite_test.go
@@ -3,11 +3,9 @@ package v3_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestAccesslog(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Accesslog Suite")
+	test.RunSpecs(t, "Accesslog Suite")
 }
diff --git a/pkg/envoy/admin/admin_suite_test.go b/pkg/envoy/admin/admin_suite_test.go
index e2e7eeb3c..502c2d77b 100644
--- a/pkg/envoy/admin/admin_suite_test.go
+++ b/pkg/envoy/admin/admin_suite_test.go
@@ -4,21 +4,21 @@ import (
 	"context"
 	"testing"
 
+	. "github.com/onsi/ginkgo"
+	. "github.com/onsi/gomega"
+
 	kuma_cp "github.com/kumahq/kuma/pkg/config/app/kuma-cp"
 	core_mesh "github.com/kumahq/kuma/pkg/core/resources/apis/mesh"
 	"github.com/kumahq/kuma/pkg/core/resources/model"
 	core_store "github.com/kumahq/kuma/pkg/core/resources/store"
 	"github.com/kumahq/kuma/pkg/defaults/mesh"
 	"github.com/kumahq/kuma/pkg/envoy/admin"
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/pkg/test/runtime"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestEnvoyAdmin(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "EnvoyAdmin Suite")
+	test.RunSpecs(t, "EnvoyAdmin Suite")
 }
 
 const (
diff --git a/pkg/gc/gc_suite_test.go b/pkg/gc/gc_suite_test.go
index 4be5880c2..dc93cfae5 100644
--- a/pkg/gc/gc_suite_test.go
+++ b/pkg/gc/gc_suite_test.go
@@ -3,11 +3,9 @@ package gc_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestGC(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "GC Suite")
+	test.RunSpecs(t, "GC Suite")
 }
diff --git a/pkg/hds/authn/auth_suite_test.go b/pkg/hds/authn/auth_suite_test.go
index 88d18393c..d9cb4efff 100644
--- a/pkg/hds/authn/auth_suite_test.go
+++ b/pkg/hds/authn/auth_suite_test.go
@@ -3,11 +3,9 @@ package authn_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestAuthn(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "HDS Authn Suite")
+	test.RunSpecs(t, "HDS Authn Suite")
 }
diff --git a/pkg/hds/cache/cache_suite_test.go b/pkg/hds/cache/cache_suite_test.go
index 6493b3123..882f39936 100644
--- a/pkg/hds/cache/cache_suite_test.go
+++ b/pkg/hds/cache/cache_suite_test.go
@@ -3,11 +3,9 @@ package cache_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestHDSCache(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "HDS Cache Suite")
+	test.RunSpecs(t, "HDS Cache Suite")
 }
diff --git a/pkg/hds/tracker/hds_suite_test.go b/pkg/hds/tracker/hds_suite_test.go
index 44186a4fd..a8b308795 100644
--- a/pkg/hds/tracker/hds_suite_test.go
+++ b/pkg/hds/tracker/hds_suite_test.go
@@ -3,11 +3,9 @@ package tracker_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestHDSTracker(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "HDS Tracker Suite")
+	test.RunSpecs(t, "HDS Tracker Suite")
 }
diff --git a/pkg/insights/insights_suite_test.go b/pkg/insights/insights_suite_test.go
index fe0e7ee79..829147b11 100644
--- a/pkg/insights/insights_suite_test.go
+++ b/pkg/insights/insights_suite_test.go
@@ -3,11 +3,9 @@ package insights_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestInsights(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Insights Suite")
+	test.RunSpecs(t, "Insights Suite")
 }
diff --git a/pkg/kds/cache/cache_suite_test.go b/pkg/kds/cache/cache_suite_test.go
index 86e83bfbe..490ff0a76 100644
--- a/pkg/kds/cache/cache_suite_test.go
+++ b/pkg/kds/cache/cache_suite_test.go
@@ -3,11 +3,9 @@ package cache_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestCache(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Cache Suite")
+	test.RunSpecs(t, "Cache Suite")
 }
diff --git a/pkg/kds/client/client_suite_test.go b/pkg/kds/client/client_suite_test.go
index 049b7ac87..bf5ba4520 100644
--- a/pkg/kds/client/client_suite_test.go
+++ b/pkg/kds/client/client_suite_test.go
@@ -3,11 +3,9 @@ package client_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestKDSClient(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "KDS Client Suite")
+	test.RunSpecs(t, "KDS Client Suite")
 }
diff --git a/pkg/kds/global/global_suite_test.go b/pkg/kds/global/global_suite_test.go
index f269a581e..4ce328a77 100644
--- a/pkg/kds/global/global_suite_test.go
+++ b/pkg/kds/global/global_suite_test.go
@@ -3,11 +3,9 @@ package global_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestGlobalSync(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Global Sync Suite")
+	test.RunSpecs(t, "Global Sync Suite")
 }
diff --git a/pkg/kds/mux/mux_suite_test.go b/pkg/kds/mux/mux_suite_test.go
index 9cc5a8c11..52fb1902c 100644
--- a/pkg/kds/mux/mux_suite_test.go
+++ b/pkg/kds/mux/mux_suite_test.go
@@ -3,11 +3,9 @@ package mux_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMultiplexKDS(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Multiplex KDS Suite")
+	test.RunSpecs(t, "Multiplex KDS Suite")
 }
diff --git a/pkg/kds/server/server_suite_test.go b/pkg/kds/server/server_suite_test.go
index 428856f4e..31ca59b23 100644
--- a/pkg/kds/server/server_suite_test.go
+++ b/pkg/kds/server/server_suite_test.go
@@ -3,11 +3,9 @@ package server_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestKDS(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "KDS Suite")
+	test.RunSpecs(t, "KDS Suite")
 }
diff --git a/pkg/kds/store/store_suite_test.go b/pkg/kds/store/store_suite_test.go
index 0ed8ac773..3d4afee5b 100644
--- a/pkg/kds/store/store_suite_test.go
+++ b/pkg/kds/store/store_suite_test.go
@@ -3,11 +3,9 @@ package store_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestSyncResourceStore(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "SyncResourceStore Suite")
+	test.RunSpecs(t, "SyncResourceStore Suite")
 }
diff --git a/pkg/kds/zone/remote_suite_test.go b/pkg/kds/zone/remote_suite_test.go
index d9a241e9a..43550c262 100644
--- a/pkg/kds/zone/remote_suite_test.go
+++ b/pkg/kds/zone/remote_suite_test.go
@@ -3,11 +3,9 @@ package zone_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestZoneSync(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Zone Sync Suite")
+	test.RunSpecs(t, "Zone Sync Suite")
 }
diff --git a/pkg/mads/server/server_suite_test.go b/pkg/mads/server/server_suite_test.go
index 6c8cf3227..d5496e125 100644
--- a/pkg/mads/server/server_suite_test.go
+++ b/pkg/mads/server/server_suite_test.go
@@ -3,11 +3,9 @@ package server_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMADSServer(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "MADS Server Suite")
+	test.RunSpecs(t, "MADS Server Suite")
 }
diff --git a/pkg/mads/server/server_test.go b/pkg/mads/server/server_test.go
index 021d87361..51484d537 100644
--- a/pkg/mads/server/server_test.go
+++ b/pkg/mads/server/server_test.go
@@ -5,6 +5,8 @@ import (
 	"fmt"
 	"net/http"
 
+	"github.com/kumahq/kuma/pkg/test"
+
 	envoy_core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
 	v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
 	"github.com/golang/protobuf/jsonpb"
@@ -12,8 +14,6 @@ import (
 	. "github.com/onsi/gomega"
 	"github.com/prometheus/common/config"
 
-	"github.com/kumahq/kuma/pkg/util/net"
-
 	kuma_cp "github.com/kumahq/kuma/pkg/config/app/kuma-cp"
 	"github.com/kumahq/kuma/pkg/config/mads"
 	"github.com/kumahq/kuma/pkg/core/resources/manager"
@@ -67,7 +67,7 @@ var _ = Describe("MADS Server", func() {
 			metrics: m,
 		}
 
-		port, err = net.PickTCPPort("127.0.0.1", 10000, 20000)
+		port, err = test.FindFreePort("127.0.0.1")
 		Expect(err).ToNot(HaveOccurred())
 
 		rt.config.MonitoringAssignmentServer.Port = port
diff --git a/pkg/mads/v1/cache/cache_suite_test.go b/pkg/mads/v1/cache/cache_suite_test.go
index 86e83bfbe..490ff0a76 100644
--- a/pkg/mads/v1/cache/cache_suite_test.go
+++ b/pkg/mads/v1/cache/cache_suite_test.go
@@ -3,11 +3,9 @@ package cache_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestCache(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Cache Suite")
+	test.RunSpecs(t, "Cache Suite")
 }
diff --git a/pkg/mads/v1/generator/generator_suite_test.go b/pkg/mads/v1/generator/generator_suite_test.go
index d53fec8b3..08bbd7154 100644
--- a/pkg/mads/v1/generator/generator_suite_test.go
+++ b/pkg/mads/v1/generator/generator_suite_test.go
@@ -3,11 +3,9 @@ package generator_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestGenerator(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Generator Suite")
+	test.RunSpecs(t, "Generator Suite")
 }
diff --git a/pkg/mads/v1/reconcile/reconcile_suite_test.go b/pkg/mads/v1/reconcile/reconcile_suite_test.go
index 8e7ae5db6..338fbfca5 100644
--- a/pkg/mads/v1/reconcile/reconcile_suite_test.go
+++ b/pkg/mads/v1/reconcile/reconcile_suite_test.go
@@ -3,11 +3,9 @@ package reconcile_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestReconcile(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Reconcile Suite")
+	test.RunSpecs(t, "Reconcile Suite")
 }
diff --git a/pkg/mads/v1/v1_suite_test.go b/pkg/mads/v1/v1_suite_test.go
index 88053afce..7df2a3fd3 100644
--- a/pkg/mads/v1/v1_suite_test.go
+++ b/pkg/mads/v1/v1_suite_test.go
@@ -3,11 +3,9 @@ package v1_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestHttp(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "MADS v1 Suite")
+	test.RunSpecs(t, "MADS v1 Suite")
 }
diff --git a/pkg/mads/v1alpha1/cache/cache_suite_test.go b/pkg/mads/v1alpha1/cache/cache_suite_test.go
index 86e83bfbe..490ff0a76 100644
--- a/pkg/mads/v1alpha1/cache/cache_suite_test.go
+++ b/pkg/mads/v1alpha1/cache/cache_suite_test.go
@@ -3,11 +3,9 @@ package cache_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestCache(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Cache Suite")
+	test.RunSpecs(t, "Cache Suite")
 }
diff --git a/pkg/mads/v1alpha1/generator/generator_suite_test.go b/pkg/mads/v1alpha1/generator/generator_suite_test.go
index d53fec8b3..08bbd7154 100644
--- a/pkg/mads/v1alpha1/generator/generator_suite_test.go
+++ b/pkg/mads/v1alpha1/generator/generator_suite_test.go
@@ -3,11 +3,9 @@ package generator_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestGenerator(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Generator Suite")
+	test.RunSpecs(t, "Generator Suite")
 }
diff --git a/pkg/mads/v1alpha1/reconcile/reconcile_suite_test.go b/pkg/mads/v1alpha1/reconcile/reconcile_suite_test.go
index 8e7ae5db6..338fbfca5 100644
--- a/pkg/mads/v1alpha1/reconcile/reconcile_suite_test.go
+++ b/pkg/mads/v1alpha1/reconcile/reconcile_suite_test.go
@@ -3,11 +3,9 @@ package reconcile_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestReconcile(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Reconcile Suite")
+	test.RunSpecs(t, "Reconcile Suite")
 }
diff --git a/pkg/metrics/store/metrics_suite_test.go b/pkg/metrics/store/metrics_suite_test.go
index e8c099427..9cb74b873 100644
--- a/pkg/metrics/store/metrics_suite_test.go
+++ b/pkg/metrics/store/metrics_suite_test.go
@@ -3,11 +3,9 @@ package metrics_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMetrics(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Metrics Suite")
+	test.RunSpecs(t, "Metrics Suite")
 }
diff --git a/pkg/plugins/ca/builtin/builtin_suite_test.go b/pkg/plugins/ca/builtin/builtin_suite_test.go
index bf6695eff..33662eb95 100644
--- a/pkg/plugins/ca/builtin/builtin_suite_test.go
+++ b/pkg/plugins/ca/builtin/builtin_suite_test.go
@@ -3,11 +3,9 @@ package builtin_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestCaBuiltin(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "CA Builtin Suite")
+	test.RunSpecs(t, "CA Builtin Suite")
 }
diff --git a/pkg/plugins/ca/provided/provided_suite_test.go b/pkg/plugins/ca/provided/provided_suite_test.go
index 2cf9ad8e9..517905231 100644
--- a/pkg/plugins/ca/provided/provided_suite_test.go
+++ b/pkg/plugins/ca/provided/provided_suite_test.go
@@ -3,11 +3,9 @@ package provided_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestCaProvided(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "CA Provided Suite")
+	test.RunSpecs(t, "CA Provided Suite")
 }
diff --git a/pkg/plugins/common/k8s/k8s_suite_test.go b/pkg/plugins/common/k8s/k8s_suite_test.go
index 4b7eb1513..0c73a6e96 100644
--- a/pkg/plugins/common/k8s/k8s_suite_test.go
+++ b/pkg/plugins/common/k8s/k8s_suite_test.go
@@ -3,11 +3,9 @@ package k8s_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestK8s(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "K8s Suite")
+	test.RunSpecs(t, "K8s Suite")
 }
diff --git a/pkg/plugins/config/k8s/k8s_suite_test.go b/pkg/plugins/config/k8s/k8s_suite_test.go
index 24e06411e..ede73cca6 100644
--- a/pkg/plugins/config/k8s/k8s_suite_test.go
+++ b/pkg/plugins/config/k8s/k8s_suite_test.go
@@ -4,20 +4,15 @@ import (
 	"testing"
 	"time"
 
-	"sigs.k8s.io/controller-runtime/pkg/envtest"
-
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
 
+	kube_core "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/runtime"
 	"sigs.k8s.io/controller-runtime/pkg/client"
-	"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
+	"sigs.k8s.io/controller-runtime/pkg/envtest"
 
 	"github.com/kumahq/kuma/pkg/test"
-
-	kube_core "k8s.io/api/core/v1"
 	// +kubebuilder:scaffold:imports
 )
 
@@ -26,16 +21,10 @@ var testEnv *envtest.Environment
 var k8sClientScheme = runtime.NewScheme()
 
 func TestKubernetes(t *testing.T) {
-	RegisterFailHandler(Fail)
-
-	RunSpecsWithDefaultAndCustomReporters(t,
-		"Kubernetes Config Suite",
-		[]Reporter{printer.NewlineReporter{}})
+	test.RunSpecs(t, "Kubernetes Config Suite")
 }
 
 var _ = BeforeSuite(test.Within(time.Minute, func() {
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-
 	By("bootstrapping test environment")
 	testEnv = &envtest.Environment{}
 
diff --git a/pkg/plugins/leader/postgres/postgres_suite_test.go b/pkg/plugins/leader/postgres/postgres_suite_test.go
index 3875dfa81..a1b7b8f25 100644
--- a/pkg/plugins/leader/postgres/postgres_suite_test.go
+++ b/pkg/plugins/leader/postgres/postgres_suite_test.go
@@ -3,11 +3,9 @@ package postgres
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestPostgresLeader(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Postgres Leader Suite")
+	test.RunSpecs(t, "Postgres Leader Suite")
 }
diff --git a/pkg/plugins/resources/k8s/k8s_suite_test.go b/pkg/plugins/resources/k8s/k8s_suite_test.go
index 086e4001f..e77097f6d 100644
--- a/pkg/plugins/resources/k8s/k8s_suite_test.go
+++ b/pkg/plugins/resources/k8s/k8s_suite_test.go
@@ -24,14 +24,12 @@ import (
 
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
+
 	kube_core "k8s.io/api/core/v1"
 	kube_meta "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/runtime"
 	"sigs.k8s.io/controller-runtime/pkg/client"
 	"sigs.k8s.io/controller-runtime/pkg/envtest"
-	"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
 
 	mesh_k8s "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/api/v1alpha1"
 	k8s_registry "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/pkg/registry"
@@ -47,16 +45,10 @@ var testEnv *envtest.Environment
 var k8sClientScheme = runtime.NewScheme()
 
 func TestKubernetes(t *testing.T) {
-	RegisterFailHandler(Fail)
-
-	RunSpecsWithDefaultAndCustomReporters(t,
-		"Kubernetes Resources Suite",
-		[]Reporter{printer.NewlineReporter{}})
+	test.RunSpecs(t, "Kubernetes Resources Suite")
 }
 
 var _ = BeforeSuite(test.Within(time.Minute, func() {
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-
 	By("bootstrapping test environment")
 	testEnv = &envtest.Environment{
 		CRDDirectoryPaths: []string{
diff --git a/pkg/plugins/resources/k8s/native/api/v1alpha1/suite_test.go b/pkg/plugins/resources/k8s/native/api/v1alpha1/suite_test.go
index a954d1944..cfcc9ee30 100644
--- a/pkg/plugins/resources/k8s/native/api/v1alpha1/suite_test.go
+++ b/pkg/plugins/resources/k8s/native/api/v1alpha1/suite_test.go
@@ -21,20 +21,16 @@ import (
 	"testing"
 	"time"
 
-	"sigs.k8s.io/controller-runtime/pkg/envtest"
-
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
 
 	"k8s.io/client-go/kubernetes/scheme"
 	"k8s.io/client-go/rest"
 	"sigs.k8s.io/controller-runtime/pkg/client"
-	"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
+	"sigs.k8s.io/controller-runtime/pkg/envtest"
 
 	"github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/pkg/model"
-	"github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/pkg/test"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 var cfg *rest.Config
@@ -42,16 +38,10 @@ var k8sClient client.Client
 var testEnv *envtest.Environment
 
 func TestAPIs(t *testing.T) {
-	RegisterFailHandler(Fail)
-
-	RunSpecsWithDefaultAndCustomReporters(t,
-		"v1alpha1 Suite",
-		[]Reporter{printer.NewlineReporter{}})
+	test.RunSpecs(t, "v1alpha1 Suite")
 }
 
 var _ = BeforeSuite(test.Within(time.Minute, func() {
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-
 	By("bootstrapping test environment")
 	testEnv = &envtest.Environment{
 		CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
diff --git a/pkg/plugins/resources/k8s/native/controllers/suite_test.go b/pkg/plugins/resources/k8s/native/controllers/suite_test.go
index 25eca7ec1..7ccc58a5f 100644
--- a/pkg/plugins/resources/k8s/native/controllers/suite_test.go
+++ b/pkg/plugins/resources/k8s/native/controllers/suite_test.go
@@ -21,18 +21,16 @@ import (
 	"testing"
 	"time"
 
-	"sigs.k8s.io/controller-runtime/pkg/envtest"
-
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
+
+	"sigs.k8s.io/controller-runtime/pkg/envtest"
+
 	"k8s.io/client-go/kubernetes/scheme"
 	"sigs.k8s.io/controller-runtime/pkg/client"
-	"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
 
 	meshv1alpha1 "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/api/v1alpha1"
-	"github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/pkg/test"
+	"github.com/kumahq/kuma/pkg/test"
 	// +kubebuilder:scaffold:imports
 )
 
@@ -40,16 +38,10 @@ var k8sClient client.Client
 var testEnv *envtest.Environment
 
 func TestAPIs(t *testing.T) {
-	RegisterFailHandler(Fail)
-
-	RunSpecsWithDefaultAndCustomReporters(t,
-		"Controller Suite",
-		[]Reporter{printer.NewlineReporter{}})
+	test.RunSpecs(t, "Controller Suite")
 }
 
 var _ = BeforeSuite(test.Within(time.Minute, func() {
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-
 	By("bootstrapping test environment")
 	testEnv = &envtest.Environment{
 		CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
diff --git a/pkg/plugins/resources/k8s/native/pkg/test/within.go b/pkg/plugins/resources/k8s/native/pkg/test/within.go
deleted file mode 100644
index 6a1e418a9..000000000
--- a/pkg/plugins/resources/k8s/native/pkg/test/within.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package test
-
-import (
-	"time"
-
-	"github.com/onsi/ginkgo"
-	"github.com/onsi/gomega"
-)
-
-// Within returns a function that executes the given test task in
-// a dedicated goroutine, asserting that it must complete within
-// the given timeout.
-//
-// See https://github.com/onsi/ginkgo/blob/v2/docs/MIGRATING_TO_V2.md#removed-async-testing
-func Within(timeout time.Duration, task func()) func() {
-	return func() {
-		done := make(chan interface{})
-
-		go func() {
-			defer ginkgo.GinkgoRecover()
-			defer close(done)
-			task()
-		}()
-
-		gomega.Eventually(done, timeout).Should(gomega.BeClosed())
-	}
-}
diff --git a/pkg/plugins/resources/memory/memory_suite_test.go b/pkg/plugins/resources/memory/memory_suite_test.go
index 508bef4a6..d96678205 100644
--- a/pkg/plugins/resources/memory/memory_suite_test.go
+++ b/pkg/plugins/resources/memory/memory_suite_test.go
@@ -3,11 +3,9 @@ package memory_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestClient(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "In-memory ResourceStore Suite")
+	test.RunSpecs(t, "In-memory ResourceStore Suite")
 }
diff --git a/pkg/plugins/resources/postgres/store_suite_test.go b/pkg/plugins/resources/postgres/store_suite_test.go
index 1b2b00529..b20e40b32 100644
--- a/pkg/plugins/resources/postgres/store_suite_test.go
+++ b/pkg/plugins/resources/postgres/store_suite_test.go
@@ -3,11 +3,9 @@ package postgres
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestPostgresStore(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Postgres Resource Store Suite")
+	test.RunSpecs(t, "Postgres Resource Store Suite")
 }
diff --git a/pkg/plugins/resources/remote/remote_suite_test.go b/pkg/plugins/resources/remote/remote_suite_test.go
index e55a1a898..7cb5ead21 100644
--- a/pkg/plugins/resources/remote/remote_suite_test.go
+++ b/pkg/plugins/resources/remote/remote_suite_test.go
@@ -3,11 +3,9 @@ package remote_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestRemote(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Remote Suite")
+	test.RunSpecs(t, "Remote Suite")
 }
diff --git a/pkg/plugins/runtime/k8s/controllers/suite_test.go b/pkg/plugins/runtime/k8s/controllers/suite_test.go
index 193f948f6..a9d873696 100644
--- a/pkg/plugins/runtime/k8s/controllers/suite_test.go
+++ b/pkg/plugins/runtime/k8s/controllers/suite_test.go
@@ -5,17 +5,14 @@ import (
 	"testing"
 	"time"
 
-	"sigs.k8s.io/controller-runtime/pkg/envtest"
-
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
+
 	kube_core "k8s.io/api/core/v1"
 	apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
 	"k8s.io/apimachinery/pkg/runtime"
 	"sigs.k8s.io/controller-runtime/pkg/client"
-	"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
+	"sigs.k8s.io/controller-runtime/pkg/envtest"
 
 	meshv1alpha1 "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/api/v1alpha1"
 	k8scnicncfio "github.com/kumahq/kuma/pkg/plugins/runtime/k8s/apis/k8s.cni.cncf.io"
@@ -27,16 +24,10 @@ var testEnv *envtest.Environment
 var k8sClientScheme = runtime.NewScheme()
 
 func TestAPIs(t *testing.T) {
-	RegisterFailHandler(Fail)
-
-	RunSpecsWithDefaultAndCustomReporters(t,
-		"Namespace Controller Suite",
-		[]Reporter{printer.NewlineReporter{}})
+	test.RunSpecs(t, "Namespace Controller Suite")
 }
 
 var _ = BeforeSuite(test.Within(time.Minute, func() {
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-
 	By("bootstrapping test environment")
 	testEnv = &envtest.Environment{
 		CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "..", "resources", "k8s", "native", "config", "crd", "bases")},
diff --git a/pkg/plugins/runtime/k8s/metadata/metadata_suite_test.go b/pkg/plugins/runtime/k8s/metadata/metadata_suite_test.go
index e9eda2a95..206d96e84 100644
--- a/pkg/plugins/runtime/k8s/metadata/metadata_suite_test.go
+++ b/pkg/plugins/runtime/k8s/metadata/metadata_suite_test.go
@@ -3,11 +3,9 @@ package metadata_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMetadata(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Kubernetes Metadata")
+	test.RunSpecs(t, "Kubernetes Metadata")
 }
diff --git a/pkg/plugins/runtime/k8s/probes/suite_test.go b/pkg/plugins/runtime/k8s/probes/suite_test.go
index 59b9f0149..f1de5ea2b 100644
--- a/pkg/plugins/runtime/k8s/probes/suite_test.go
+++ b/pkg/plugins/runtime/k8s/probes/suite_test.go
@@ -3,15 +3,9 @@ package probes
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
-	"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestProbes(t *testing.T) {
-	RegisterFailHandler(Fail)
-
-	RunSpecsWithDefaultAndCustomReporters(t,
-		"Probe Suite",
-		[]Reporter{printer.NewlineReporter{}})
+	test.RunSpecs(t, "Probe Suite")
 }
diff --git a/pkg/plugins/runtime/k8s/util/util_suite_test.go b/pkg/plugins/runtime/k8s/util/util_suite_test.go
index 9a34451a4..734bf3aa0 100644
--- a/pkg/plugins/runtime/k8s/util/util_suite_test.go
+++ b/pkg/plugins/runtime/k8s/util/util_suite_test.go
@@ -3,11 +3,9 @@ package util_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestUtil(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Util Suite")
+	test.RunSpecs(t, "Util Suite")
 }
diff --git a/pkg/plugins/runtime/k8s/webhooks/injector/injector_suite_test.go b/pkg/plugins/runtime/k8s/webhooks/injector/injector_suite_test.go
index ed9c6b8bb..895261cd8 100644
--- a/pkg/plugins/runtime/k8s/webhooks/injector/injector_suite_test.go
+++ b/pkg/plugins/runtime/k8s/webhooks/injector/injector_suite_test.go
@@ -23,13 +23,11 @@ import (
 
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
+
 	kube_core "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/runtime"
 	"sigs.k8s.io/controller-runtime/pkg/client"
 	"sigs.k8s.io/controller-runtime/pkg/envtest"
-	"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
 
 	mesh_k8s "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/api/v1alpha1"
 	"github.com/kumahq/kuma/pkg/test"
@@ -41,16 +39,10 @@ var testEnv *envtest.Environment
 var k8sClientScheme = runtime.NewScheme()
 
 func TestInjector(t *testing.T) {
-	RegisterFailHandler(Fail)
-
-	RunSpecsWithDefaultAndCustomReporters(t,
-		"Kubernetes Resources Suite",
-		[]Reporter{printer.NewlineReporter{}})
+	test.RunSpecs(t, "Kubernetes Resources Suite")
 }
 
 var _ = BeforeSuite(test.Within(time.Minute, func() {
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-
 	By("bootstrapping test environment")
 	testEnv = &envtest.Environment{
 		CRDDirectoryPaths: []string{
diff --git a/pkg/plugins/runtime/k8s/webhooks/webhook_suite_test.go b/pkg/plugins/runtime/k8s/webhooks/webhook_suite_test.go
index f58769c4a..2befa0bc8 100644
--- a/pkg/plugins/runtime/k8s/webhooks/webhook_suite_test.go
+++ b/pkg/plugins/runtime/k8s/webhooks/webhook_suite_test.go
@@ -5,10 +5,9 @@ import (
 	"path/filepath"
 	"testing"
 
-	sample_k8s "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/test/api/sample/v1alpha1"
-
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
+
 	kube_core "k8s.io/api/core/v1"
 	kube_meta "k8s.io/apimachinery/pkg/apis/meta/v1"
 	kube_runtime "k8s.io/apimachinery/pkg/runtime"
@@ -17,11 +16,12 @@ import (
 	kube_admission "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
 
 	mesh_k8s "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/api/v1alpha1"
+	sample_k8s "github.com/kumahq/kuma/pkg/plugins/resources/k8s/native/test/api/sample/v1alpha1"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestWebhook(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Webhooks Suite")
+	test.RunSpecs(t, "Webhooks Suite")
 }
 
 var decoder *kube_admission.Decoder
diff --git a/pkg/plugins/runtime/universal/outbound/outbound_suite_test.go b/pkg/plugins/runtime/universal/outbound/outbound_suite_test.go
index 6fc91e01d..ccbe62e5d 100644
--- a/pkg/plugins/runtime/universal/outbound/outbound_suite_test.go
+++ b/pkg/plugins/runtime/universal/outbound/outbound_suite_test.go
@@ -3,11 +3,9 @@ package outbound_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestOutbound(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Universal outbound test")
+	test.RunSpecs(t, "Universal outbound test")
 }
diff --git a/pkg/plugins/runtime/universal/universal_suite_test.go b/pkg/plugins/runtime/universal/universal_suite_test.go
index f49125fc2..630f3a2cf 100644
--- a/pkg/plugins/runtime/universal/universal_suite_test.go
+++ b/pkg/plugins/runtime/universal/universal_suite_test.go
@@ -3,11 +3,9 @@ package universal_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestUniversal(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Universal Runtime Plugin")
+	test.RunSpecs(t, "Universal Runtime Plugin")
 }
diff --git a/pkg/plugins/secrets/k8s/k8s_suite_test.go b/pkg/plugins/secrets/k8s/k8s_suite_test.go
index 248c5c7d2..3635d5487 100644
--- a/pkg/plugins/secrets/k8s/k8s_suite_test.go
+++ b/pkg/plugins/secrets/k8s/k8s_suite_test.go
@@ -20,18 +20,13 @@ import (
 	"testing"
 	"time"
 
-	"sigs.k8s.io/controller-runtime/pkg/envtest"
-
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
 
+	kube_core "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/runtime"
 	"sigs.k8s.io/controller-runtime/pkg/client"
-	"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
-
-	kube_core "k8s.io/api/core/v1"
+	"sigs.k8s.io/controller-runtime/pkg/envtest"
 
 	"github.com/kumahq/kuma/pkg/test"
 	// +kubebuilder:scaffold:imports
@@ -42,16 +37,10 @@ var testEnv *envtest.Environment
 var k8sClientScheme = runtime.NewScheme()
 
 func TestKubernetes(t *testing.T) {
-	RegisterFailHandler(Fail)
-
-	RunSpecsWithDefaultAndCustomReporters(t,
-		"Kubernetes Secrets Suite",
-		[]Reporter{printer.NewlineReporter{}})
+	test.RunSpecs(t, "Kubernetes Secrets Suite")
 }
 
 var _ = BeforeSuite(test.Within(time.Minute, func() {
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-
 	By("bootstrapping test environment")
 	testEnv = &envtest.Environment{}
 
diff --git a/pkg/sds/server/v3/server_suite_test.go b/pkg/sds/server/v3/server_suite_test.go
index bd3a41b45..93241d511 100644
--- a/pkg/sds/server/v3/server_suite_test.go
+++ b/pkg/sds/server/v3/server_suite_test.go
@@ -3,11 +3,9 @@ package v3_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestServer(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "SDS Server Suite")
+	test.RunSpecs(t, "SDS Server Suite")
 }
diff --git a/pkg/test/ginkgo.go b/pkg/test/ginkgo.go
new file mode 100644
index 000000000..be3e42098
--- /dev/null
+++ b/pkg/test/ginkgo.go
@@ -0,0 +1,27 @@
+package test
+
+import (
+	"testing"
+
+	"github.com/go-logr/logr"
+	"github.com/onsi/ginkgo"
+	"github.com/onsi/gomega"
+	"sigs.k8s.io/controller-runtime/pkg/log"
+	"sigs.k8s.io/controller-runtime/pkg/log/zap"
+
+	"github.com/kumahq/kuma/pkg/core"
+)
+
+// RunSpecs wraps ginkgo+gomega test suite initialization.
+func RunSpecs(t *testing.T, description string) {
+	// Make resetting the core logger a no-op so that internal
+	// code doesn't interfere with testing.
+	core.SetLogger = func(l logr.Logger) {}
+
+	// Log to the Ginkgo writer. This makes Ginkgo emit logs on
+	// test failure.
+	log.SetLogger(zap.LoggerTo(ginkgo.GinkgoWriter, true))
+
+	gomega.RegisterFailHandlerWithT(t, ginkgo.Fail)
+	ginkgo.RunSpecs(t, description)
+}
diff --git a/pkg/tokens/builtin/server/server_suite_test.go b/pkg/tokens/builtin/server/server_suite_test.go
index 9f802a6a7..714a1b4fe 100644
--- a/pkg/tokens/builtin/server/server_suite_test.go
+++ b/pkg/tokens/builtin/server/server_suite_test.go
@@ -3,11 +3,9 @@ package server_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestServer(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Dataplane Token Server Suite")
+	test.RunSpecs(t, "Dataplane Token Server Suite")
 }
diff --git a/pkg/transparentproxy/firewalld/firewalld_suite_test.go b/pkg/transparentproxy/firewalld/firewalld_suite_test.go
index 85a0ab560..6c3e2aa8a 100644
--- a/pkg/transparentproxy/firewalld/firewalld_suite_test.go
+++ b/pkg/transparentproxy/firewalld/firewalld_suite_test.go
@@ -19,11 +19,9 @@ package firewalld_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestFirewalld(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Firewalld Suite")
+	test.RunSpecs(t, "Firewalld Suite")
 }
diff --git a/pkg/transparentproxy/kubernetes/kubernetes_suite_test.go b/pkg/transparentproxy/kubernetes/kubernetes_suite_test.go
index 87eed3ae2..2b83a20df 100644
--- a/pkg/transparentproxy/kubernetes/kubernetes_suite_test.go
+++ b/pkg/transparentproxy/kubernetes/kubernetes_suite_test.go
@@ -19,11 +19,9 @@ package kubernetes_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestKubernetes(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Kubernetes Suite")
+	test.RunSpecs(t, "Kubernetes Suite")
 }
diff --git a/pkg/util/http/http_suite_test.go b/pkg/util/http/http_suite_test.go
index a9c5b9f8c..a2ecfdfb5 100644
--- a/pkg/util/http/http_suite_test.go
+++ b/pkg/util/http/http_suite_test.go
@@ -3,11 +3,9 @@ package http_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestHttp(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Http Suite")
+	test.RunSpecs(t, "Http Suite")
 }
diff --git a/pkg/util/maps/maps_suite_test.go b/pkg/util/maps/maps_suite_test.go
index 04f7c8d2b..0b506526a 100644
--- a/pkg/util/maps/maps_suite_test.go
+++ b/pkg/util/maps/maps_suite_test.go
@@ -3,11 +3,9 @@ package maps_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMaps(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Maps Suite")
+	test.RunSpecs(t, "Maps Suite")
 }
diff --git a/pkg/util/net/net_suite_test.go b/pkg/util/net/net_suite_test.go
index 9427dbf3e..05d9f35fa 100644
--- a/pkg/util/net/net_suite_test.go
+++ b/pkg/util/net/net_suite_test.go
@@ -3,11 +3,9 @@ package net_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestNet(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Net Suite")
+	test.RunSpecs(t, "Net Suite")
 }
diff --git a/pkg/util/os/os_suite_test.go b/pkg/util/os/os_suite_test.go
index 091653cd8..15960552e 100644
--- a/pkg/util/os/os_suite_test.go
+++ b/pkg/util/os/os_suite_test.go
@@ -3,11 +3,9 @@ package os
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestOS(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "OS Suite")
+	test.RunSpecs(t, "OS Suite")
 }
diff --git a/pkg/util/proto/proto_suite_test.go b/pkg/util/proto/proto_suite_test.go
index 755d9d589..4744502b4 100644
--- a/pkg/util/proto/proto_suite_test.go
+++ b/pkg/util/proto/proto_suite_test.go
@@ -3,16 +3,9 @@ package proto_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
-
-	util_test "github.com/kumahq/kuma/pkg/util/test"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestProtoUtils(t *testing.T) {
-	RegisterFailHandler(Fail)
-
-	RunSpecsWithDefaultAndCustomReporters(t,
-		"Generator Suite",
-		[]Reporter{util_test.NewlineReporter{}})
+	test.RunSpecs(t, "Generator Suite")
 }
diff --git a/pkg/util/test/ginkgo.go b/pkg/util/test/ginkgo.go
deleted file mode 100644
index 7087213df..000000000
--- a/pkg/util/test/ginkgo.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package test
-
-import (
-	"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
-)
-
-type NewlineReporter = printer.NewlineReporter
diff --git a/pkg/util/watchdog/watchdog_suite_test.go b/pkg/util/watchdog/watchdog_suite_test.go
index 5495aa44c..429ac9be7 100644
--- a/pkg/util/watchdog/watchdog_suite_test.go
+++ b/pkg/util/watchdog/watchdog_suite_test.go
@@ -3,11 +3,9 @@ package watchdog_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestWatchdog(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Watchdog Suite")
+	test.RunSpecs(t, "Watchdog Suite")
 }
diff --git a/pkg/util/xds/v2/xds_suite_test.go b/pkg/util/xds/v2/xds_suite_test.go
index fcb3c2232..01f85fde5 100644
--- a/pkg/util/xds/v2/xds_suite_test.go
+++ b/pkg/util/xds/v2/xds_suite_test.go
@@ -3,11 +3,9 @@ package v2_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestXds(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Xds V2 Suite")
+	test.RunSpecs(t, "Xds V2 Suite")
 }
diff --git a/pkg/util/xds/v3/xds_suite_test.go b/pkg/util/xds/v3/xds_suite_test.go
index d9d5119fb..35bb42f7b 100644
--- a/pkg/util/xds/v3/xds_suite_test.go
+++ b/pkg/util/xds/v3/xds_suite_test.go
@@ -3,11 +3,9 @@ package v3_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestXds(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Xds V3 Suite")
+	test.RunSpecs(t, "Xds V3 Suite")
 }
diff --git a/pkg/util/xds/xds_suite_test.go b/pkg/util/xds/xds_suite_test.go
index 8d5efb824..120947958 100644
--- a/pkg/util/xds/xds_suite_test.go
+++ b/pkg/util/xds/xds_suite_test.go
@@ -3,11 +3,9 @@ package xds_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestXds(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Xds Suite")
+	test.RunSpecs(t, "Xds Suite")
 }
diff --git a/pkg/xds/auth/auth_suite_test.go b/pkg/xds/auth/auth_suite_test.go
index c6bf00e94..b31c803a2 100644
--- a/pkg/xds/auth/auth_suite_test.go
+++ b/pkg/xds/auth/auth_suite_test.go
@@ -3,11 +3,9 @@ package auth_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestAuth(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "XDS Auth Suite")
+	test.RunSpecs(t, "XDS Auth Suite")
 }
diff --git a/pkg/xds/auth/universal/universal_suite_test.go b/pkg/xds/auth/universal/universal_suite_test.go
index 61cb86751..52c9e7a04 100644
--- a/pkg/xds/auth/universal/universal_suite_test.go
+++ b/pkg/xds/auth/universal/universal_suite_test.go
@@ -3,11 +3,9 @@ package universal_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestUniversal(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Sds Auth Universal Suite")
+	test.RunSpecs(t, "Sds Auth Universal Suite")
 }
diff --git a/pkg/xds/bootstrap/bootstrap_suite_test.go b/pkg/xds/bootstrap/bootstrap_suite_test.go
index d7ca1f957..6664566b5 100644
--- a/pkg/xds/bootstrap/bootstrap_suite_test.go
+++ b/pkg/xds/bootstrap/bootstrap_suite_test.go
@@ -3,11 +3,9 @@ package bootstrap
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestBootstrap(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Bootstrap Suite")
+	test.RunSpecs(t, "Bootstrap Suite")
 }
diff --git a/pkg/xds/cache/cla/cla_suite_test.go b/pkg/xds/cache/cla/cla_suite_test.go
index b4e9d91a9..ece08723b 100644
--- a/pkg/xds/cache/cla/cla_suite_test.go
+++ b/pkg/xds/cache/cla/cla_suite_test.go
@@ -3,11 +3,9 @@ package cla_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestCLA(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "CLA Suite")
+	test.RunSpecs(t, "CLA Suite")
 }
diff --git a/pkg/xds/cache/mesh/mesh_suite_test.go b/pkg/xds/cache/mesh/mesh_suite_test.go
index a4e093f04..3154f44fe 100644
--- a/pkg/xds/cache/mesh/mesh_suite_test.go
+++ b/pkg/xds/cache/mesh/mesh_suite_test.go
@@ -3,11 +3,9 @@ package mesh_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMeshSnapshot(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "MeshSnapshot Suite")
+	test.RunSpecs(t, "MeshSnapshot Suite")
 }
diff --git a/pkg/xds/cache/once/once_suite_test.go b/pkg/xds/cache/once/once_suite_test.go
index f3264e424..d29b44283 100644
--- a/pkg/xds/cache/once/once_suite_test.go
+++ b/pkg/xds/cache/once/once_suite_test.go
@@ -3,11 +3,9 @@ package once_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestOnce(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Once Suite")
+	test.RunSpecs(t, "Once Suite")
 }
diff --git a/pkg/xds/envoy/clusters/v3/clusters_suite_test.go b/pkg/xds/envoy/clusters/v3/clusters_suite_test.go
index 0b1e17e78..28879daea 100644
--- a/pkg/xds/envoy/clusters/v3/clusters_suite_test.go
+++ b/pkg/xds/envoy/clusters/v3/clusters_suite_test.go
@@ -3,11 +3,9 @@ package clusters_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestClusters(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Clusters V3 Suite")
+	test.RunSpecs(t, "Clusters V3 Suite")
 }
diff --git a/pkg/xds/envoy/endpoints/v3/endpoints_suite_test.go b/pkg/xds/envoy/endpoints/v3/endpoints_suite_test.go
index 7eb53a0de..0c3a4a996 100644
--- a/pkg/xds/envoy/endpoints/v3/endpoints_suite_test.go
+++ b/pkg/xds/envoy/endpoints/v3/endpoints_suite_test.go
@@ -3,11 +3,9 @@ package endpoints_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestEndpoints(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Endpoints Suite")
+	test.RunSpecs(t, "Endpoints Suite")
 }
diff --git a/pkg/xds/envoy/envoy_suite_test.go b/pkg/xds/envoy/envoy_suite_test.go
index 73ba253a0..4e4d4e6ef 100644
--- a/pkg/xds/envoy/envoy_suite_test.go
+++ b/pkg/xds/envoy/envoy_suite_test.go
@@ -3,11 +3,9 @@ package envoy_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestSync(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Envoy Suite")
+	test.RunSpecs(t, "Envoy Suite")
 }
diff --git a/pkg/xds/envoy/listeners/listener_suite_test.go b/pkg/xds/envoy/listeners/listener_suite_test.go
index cfed434c0..2fbfd6cb5 100644
--- a/pkg/xds/envoy/listeners/listener_suite_test.go
+++ b/pkg/xds/envoy/listeners/listener_suite_test.go
@@ -3,11 +3,9 @@ package listeners_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestListener(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Listener Suite")
+	test.RunSpecs(t, "Listener Suite")
 }
diff --git a/pkg/xds/envoy/listeners/v3/listener_suite_test.go b/pkg/xds/envoy/listeners/v3/listener_suite_test.go
index b95055eae..45fc78c54 100644
--- a/pkg/xds/envoy/listeners/v3/listener_suite_test.go
+++ b/pkg/xds/envoy/listeners/v3/listener_suite_test.go
@@ -3,11 +3,9 @@ package v3_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestListener(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Listener V3 Suite")
+	test.RunSpecs(t, "Listener V3 Suite")
 }
diff --git a/pkg/xds/envoy/metadata/v3/metadata_suite_test.go b/pkg/xds/envoy/metadata/v3/metadata_suite_test.go
index 51f307449..25436107a 100644
--- a/pkg/xds/envoy/metadata/v3/metadata_suite_test.go
+++ b/pkg/xds/envoy/metadata/v3/metadata_suite_test.go
@@ -3,11 +3,9 @@ package envoy_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestMetadata(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Envoy Metadata V3 Suite")
+	test.RunSpecs(t, "Envoy Metadata V3 Suite")
 }
diff --git a/pkg/xds/envoy/names/names_suite_test.go b/pkg/xds/envoy/names/names_suite_test.go
index 381051f39..663b549eb 100644
--- a/pkg/xds/envoy/names/names_suite_test.go
+++ b/pkg/xds/envoy/names/names_suite_test.go
@@ -3,11 +3,9 @@ package names_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestNames(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Names Suite")
+	test.RunSpecs(t, "Names Suite")
 }
diff --git a/pkg/xds/envoy/routes/routes_suite_test.go b/pkg/xds/envoy/routes/routes_suite_test.go
index f3acae59b..a223b92dc 100644
--- a/pkg/xds/envoy/routes/routes_suite_test.go
+++ b/pkg/xds/envoy/routes/routes_suite_test.go
@@ -3,11 +3,9 @@ package routes_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestRoutes(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Routes Suite")
+	test.RunSpecs(t, "Routes Suite")
 }
diff --git a/pkg/xds/envoy/routes/v3/routes_suite_test.go b/pkg/xds/envoy/routes/v3/routes_suite_test.go
index 5bba435e8..8aa5f2ce5 100644
--- a/pkg/xds/envoy/routes/v3/routes_suite_test.go
+++ b/pkg/xds/envoy/routes/v3/routes_suite_test.go
@@ -3,11 +3,9 @@ package v3_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestRoutes(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Routes V3 Suite")
+	test.RunSpecs(t, "Routes V3 Suite")
 }
diff --git a/pkg/xds/envoy/tags/tags_suite_test.go b/pkg/xds/envoy/tags/tags_suite_test.go
index 531475d5f..f8a9965e5 100644
--- a/pkg/xds/envoy/tags/tags_suite_test.go
+++ b/pkg/xds/envoy/tags/tags_suite_test.go
@@ -3,11 +3,9 @@ package tags_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestTags(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Listener Suite")
+	test.RunSpecs(t, "Listener Suite")
 }
diff --git a/pkg/xds/envoy/tls/v3/tls_suite_test.go b/pkg/xds/envoy/tls/v3/tls_suite_test.go
index 9308f9091..52513db49 100644
--- a/pkg/xds/envoy/tls/v3/tls_suite_test.go
+++ b/pkg/xds/envoy/tls/v3/tls_suite_test.go
@@ -3,16 +3,9 @@ package v3_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
-
-	util_test "github.com/kumahq/kuma/pkg/util/test"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestTLS(t *testing.T) {
-	RegisterFailHandler(Fail)
-
-	RunSpecsWithDefaultAndCustomReporters(t,
-		"Envoy TLS Suite",
-		[]Reporter{util_test.NewlineReporter{}})
+	test.RunSpecs(t, "Envoy TLS Suite")
 }
diff --git a/pkg/xds/generator/generator_suite_test.go b/pkg/xds/generator/generator_suite_test.go
index 0c34879b6..08bbd7154 100644
--- a/pkg/xds/generator/generator_suite_test.go
+++ b/pkg/xds/generator/generator_suite_test.go
@@ -3,16 +3,9 @@ package generator_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
-
-	util_test "github.com/kumahq/kuma/pkg/util/test"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestGenerator(t *testing.T) {
-	RegisterFailHandler(Fail)
-
-	RunSpecsWithDefaultAndCustomReporters(t,
-		"Generator Suite",
-		[]Reporter{util_test.NewlineReporter{}})
+	test.RunSpecs(t, "Generator Suite")
 }
diff --git a/pkg/xds/generator/modifications/v3/modifications_suite_test.go b/pkg/xds/generator/modifications/v3/modifications_suite_test.go
index 4d5dcfa53..fc1eecaa3 100644
--- a/pkg/xds/generator/modifications/v3/modifications_suite_test.go
+++ b/pkg/xds/generator/modifications/v3/modifications_suite_test.go
@@ -3,17 +3,10 @@ package v3_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
-
-	util_test "github.com/kumahq/kuma/pkg/util/test"
+	"github.com/kumahq/kuma/pkg/test"
 	_ "github.com/kumahq/kuma/pkg/xds/envoy"
 )
 
 func TestModifications(t *testing.T) {
-	RegisterFailHandler(Fail)
-
-	RunSpecsWithDefaultAndCustomReporters(t,
-		"Modifications V3 Suite",
-		[]Reporter{util_test.NewlineReporter{}})
+	test.RunSpecs(t, "Modifications V3 Suite")
 }
diff --git a/pkg/xds/ingress/ingress_suite_test.go b/pkg/xds/ingress/ingress_suite_test.go
index 9da8d99a4..13ddc6397 100644
--- a/pkg/xds/ingress/ingress_suite_test.go
+++ b/pkg/xds/ingress/ingress_suite_test.go
@@ -3,16 +3,9 @@ package ingress_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
-
-	util_test "github.com/kumahq/kuma/pkg/util/test"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestIngress(t *testing.T) {
-	RegisterFailHandler(Fail)
-
-	RunSpecsWithDefaultAndCustomReporters(t,
-		"Ingress Suite",
-		[]Reporter{util_test.NewlineReporter{}})
+	test.RunSpecs(t, "Ingress Suite")
 }
diff --git a/pkg/xds/server/callbacks/callbacks_suite_test.go b/pkg/xds/server/callbacks/callbacks_suite_test.go
index 3a4e2695c..b3a63b598 100644
--- a/pkg/xds/server/callbacks/callbacks_suite_test.go
+++ b/pkg/xds/server/callbacks/callbacks_suite_test.go
@@ -3,11 +3,9 @@ package callbacks_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestCallbacks(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "XDS Callbacks Suite")
+	test.RunSpecs(t, "XDS Callbacks Suite")
 }
diff --git a/pkg/core/xds/v3/context.go b/pkg/xds/server/v3/context.go
similarity index 100%
rename from pkg/core/xds/v3/context.go
rename to pkg/xds/server/v3/context.go
diff --git a/pkg/xds/server/v3/reconcile_test.go b/pkg/xds/server/v3/reconcile_test.go
index 0310e3c85..c27252e34 100644
--- a/pkg/xds/server/v3/reconcile_test.go
+++ b/pkg/xds/server/v3/reconcile_test.go
@@ -15,7 +15,6 @@ import (
 	"github.com/kumahq/kuma/pkg/core"
 	mesh_core "github.com/kumahq/kuma/pkg/core/resources/apis/mesh"
 	xds_model "github.com/kumahq/kuma/pkg/core/xds"
-	core_xds_v3 "github.com/kumahq/kuma/pkg/core/xds/v3"
 	test_model "github.com/kumahq/kuma/pkg/test/resources/model"
 	xds_context "github.com/kumahq/kuma/pkg/xds/context"
 )
@@ -41,10 +40,10 @@ var _ = Describe("Reconcile", func() {
 			}
 		})
 
-		var xdsContext core_xds_v3.XdsContext
+		var xdsContext XdsContext
 
 		BeforeEach(func() {
-			xdsContext = core_xds_v3.NewXdsContext()
+			xdsContext = NewXdsContext()
 		})
 
 		snapshot := envoy_cache.Snapshot{
diff --git a/pkg/xds/server/v3/server_suite_test.go b/pkg/xds/server/v3/server_suite_test.go
index de418125d..c469da3e2 100644
--- a/pkg/xds/server/v3/server_suite_test.go
+++ b/pkg/xds/server/v3/server_suite_test.go
@@ -3,11 +3,9 @@ package v3_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestSync(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "XDS Server V2 Suite")
+	test.RunSpecs(t, "XDS Server V2 Suite")
 }
diff --git a/pkg/xds/server/v3/snapshot_generator_test.go b/pkg/xds/server/v3/snapshot_generator_test.go
index 504decdcc..7142cbac0 100644
--- a/pkg/xds/server/v3/snapshot_generator_test.go
+++ b/pkg/xds/server/v3/snapshot_generator_test.go
@@ -7,18 +7,18 @@ import (
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
 
-	"github.com/kumahq/kuma/pkg/test/matchers"
-
 	mesh_proto "github.com/kumahq/kuma/api/mesh/v1alpha1"
 	mesh_core "github.com/kumahq/kuma/pkg/core/resources/apis/mesh"
 	"github.com/kumahq/kuma/pkg/core/resources/manager"
 	model "github.com/kumahq/kuma/pkg/core/xds"
 	"github.com/kumahq/kuma/pkg/plugins/resources/memory"
+	"github.com/kumahq/kuma/pkg/test/matchers"
 	test_model "github.com/kumahq/kuma/pkg/test/resources/model"
 	util_cache_v3 "github.com/kumahq/kuma/pkg/util/cache/v3"
 	util_proto "github.com/kumahq/kuma/pkg/util/proto"
 	xds_context "github.com/kumahq/kuma/pkg/xds/context"
 	envoy_common "github.com/kumahq/kuma/pkg/xds/envoy"
+	"github.com/kumahq/kuma/pkg/xds/generator"
 	"github.com/kumahq/kuma/pkg/xds/template"
 )
 
@@ -26,10 +26,12 @@ var _ = Describe("Reconcile", func() {
 	Describe("templateSnapshotGenerator", func() {
 
 		gen := templateSnapshotGenerator{
-			ProxyTemplateResolver: &template.SimpleProxyTemplateResolver{
-				ReadOnlyResourceManager: manager.NewResourceManager(memory.NewStore()),
-				DefaultProxyTemplate:    template.DefaultProxyTemplate,
-			},
+			ProxyTemplateResolver: template.SequentialResolver(
+				&template.SimpleProxyTemplateResolver{
+					ReadOnlyResourceManager: manager.NewResourceManager(memory.NewStore()),
+				},
+				generator.DefaultTemplateResolver,
+			),
 		}
 
 		It("Generate Snapshot per Envoy Node", func() {
diff --git a/pkg/xds/sync/sync_suite_test.go b/pkg/xds/sync/sync_suite_test.go
index 9337d9b60..04ad889c4 100644
--- a/pkg/xds/sync/sync_suite_test.go
+++ b/pkg/xds/sync/sync_suite_test.go
@@ -3,11 +3,9 @@ package sync_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestSync(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Sync Suite")
+	test.RunSpecs(t, "Sync Suite")
 }
diff --git a/pkg/xds/template/proxy_template_resolver_test.go b/pkg/xds/template/proxy_template_resolver_test.go
index 3012a4ca9..2412553e6 100644
--- a/pkg/xds/template/proxy_template_resolver_test.go
+++ b/pkg/xds/template/proxy_template_resolver_test.go
@@ -18,7 +18,7 @@ import (
 
 var _ = Describe("Reconcile", func() {
 	Describe("SimpleProxyTemplateResolver", func() {
-		It("should fallback to the default ProxyTemplate when there are no other candidates", func() {
+		It("should return nil when there no other candidates", func() {
 			// given
 			proxy := &model.Proxy{
 				Dataplane: &mesh_core.DataplaneResource{
@@ -31,14 +31,13 @@ var _ = Describe("Reconcile", func() {
 			// setup
 			resolver := &SimpleProxyTemplateResolver{
 				ReadOnlyResourceManager: manager.NewResourceManager(memory.NewStore()),
-				DefaultProxyTemplate:    &mesh_proto.ProxyTemplate{},
 			}
 
 			// when
 			actual := resolver.GetTemplate(proxy)
 
 			// then
-			Expect(actual).To(BeIdenticalTo(resolver.DefaultProxyTemplate))
+			Expect(actual).To(BeNil())
 		})
 
 		It("should use Client to list ProxyTemplates in the same Mesh as Dataplane", func() {
@@ -95,7 +94,6 @@ var _ = Describe("Reconcile", func() {
 
 			resolver := &SimpleProxyTemplateResolver{
 				ReadOnlyResourceManager: manager.NewResourceManager(memStore),
-				DefaultProxyTemplate:    &mesh_proto.ProxyTemplate{},
 			}
 
 			// when
@@ -109,7 +107,7 @@ var _ = Describe("Reconcile", func() {
 			}))
 		})
 
-		It("should fallback to the default ProxyTemplate if there are no custom templates in a given Mesh", func() {
+		It("should return nil if there are no custom templates in a given Mesh", func() {
 			// given
 			proxy := &model.Proxy{
 				Dataplane: &mesh_core.DataplaneResource{
@@ -122,14 +120,13 @@ var _ = Describe("Reconcile", func() {
 			// setup
 			resolver := &SimpleProxyTemplateResolver{
 				ReadOnlyResourceManager: manager.NewResourceManager(memory.NewStore()),
-				DefaultProxyTemplate:    &mesh_proto.ProxyTemplate{},
 			}
 
 			// when
 			actual := resolver.GetTemplate(proxy)
 
 			// then
-			Expect(actual).To(BeIdenticalTo(resolver.DefaultProxyTemplate))
+			Expect(actual).To(BeNil())
 		})
 
 	})
diff --git a/pkg/xds/topology/topology_suite_test.go b/pkg/xds/topology/topology_suite_test.go
index 9e619ccd0..943d36779 100644
--- a/pkg/xds/topology/topology_suite_test.go
+++ b/pkg/xds/topology/topology_suite_test.go
@@ -3,11 +3,9 @@ package topology_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestTopology(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Topology Suite")
+	test.RunSpecs(t, "Topology Suite")
 }
diff --git a/test/e2e/compatibility/compatibility_suite_test.go b/test/e2e/compatibility/compatibility_suite_test.go
index aee80a084..0d5077d9e 100644
--- a/test/e2e/compatibility/compatibility_suite_test.go
+++ b/test/e2e/compatibility/compatibility_suite_test.go
@@ -3,28 +3,14 @@ package compatibility_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	"github.com/go-logr/logr"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
-
-	"github.com/kumahq/kuma/pkg/core"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2ECompatibility(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "E2E Deploy Suite")
+		test.RunSpecs(t, "E2E Deploy Suite")
 	} else {
 		t.SkipNow()
 	}
 }
-
-var _ = BeforeSuite(func() {
-	core.SetLogger = func(l logr.Logger) {}
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-})
diff --git a/test/e2e/deploy/deploy_suite_test.go b/test/e2e/deploy/deploy_suite_test.go
index 0c9029033..12a648a39 100644
--- a/test/e2e/deploy/deploy_suite_test.go
+++ b/test/e2e/deploy/deploy_suite_test.go
@@ -3,28 +3,14 @@ package deploy_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	"github.com/go-logr/logr"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
-
-	"github.com/kumahq/kuma/pkg/core"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2EDeploy(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "E2E Deploy Suite")
+		test.RunSpecs(t, "E2E Deploy Suite")
 	} else {
 		t.SkipNow()
 	}
 }
-
-var _ = BeforeSuite(func() {
-	core.SetLogger = func(l logr.Logger) {}
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-})
diff --git a/test/e2e/externalservices/externalservices_suite_test.go b/test/e2e/externalservices/externalservices_suite_test.go
index 9286ef054..7014d972a 100644
--- a/test/e2e/externalservices/externalservices_suite_test.go
+++ b/test/e2e/externalservices/externalservices_suite_test.go
@@ -3,28 +3,14 @@ package externalservices_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	"github.com/go-logr/logr"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
-
-	"github.com/kumahq/kuma/pkg/core"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2EExternalServices(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "E2E External Services Suite")
+		test.RunSpecs(t, "E2E External Services Suite")
 	} else {
 		t.SkipNow()
 	}
 }
-
-var _ = BeforeSuite(func() {
-	core.SetLogger = func(l logr.Logger) {}
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-})
diff --git a/test/e2e/healthcheck/hybrid/e2e_suite_test.go b/test/e2e/healthcheck/hybrid/e2e_suite_test.go
index 1f867f923..0cbfd9f57 100644
--- a/test/e2e/healthcheck/hybrid/e2e_suite_test.go
+++ b/test/e2e/healthcheck/hybrid/e2e_suite_test.go
@@ -3,16 +3,13 @@ package hybrid_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2EHealthCheckHybrid(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "Health Check Hybrid Suite")
+		test.RunSpecs(t, "Health Check Hybrid Suite")
 	} else {
 		t.SkipNow()
 	}
diff --git a/test/e2e/healthcheck/universal/e2e_suite_test.go b/test/e2e/healthcheck/universal/e2e_suite_test.go
index 3b8e19cda..9a232c4fd 100644
--- a/test/e2e/healthcheck/universal/e2e_suite_test.go
+++ b/test/e2e/healthcheck/universal/e2e_suite_test.go
@@ -3,16 +3,13 @@ package universal_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2EHealthCheckUniversal(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "Health Check Universal Suite")
+		test.RunSpecs(t, "Health Check Universal Suite")
 	} else {
 		t.SkipNow()
 	}
diff --git a/test/e2e/helm/helm_suite_test.go b/test/e2e/helm/helm_suite_test.go
index 0be128d9f..4148cc83b 100644
--- a/test/e2e/helm/helm_suite_test.go
+++ b/test/e2e/helm/helm_suite_test.go
@@ -3,28 +3,14 @@ package helm_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	"github.com/go-logr/logr"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
-
-	"github.com/kumahq/kuma/pkg/core"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2EHelm(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "E2E Helm Suite")
+		test.RunSpecs(t, "E2E Helm Suite")
 	} else {
 		t.SkipNow()
 	}
 }
-
-var _ = BeforeSuite(func() {
-	core.SetLogger = func(l logr.Logger) {}
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-})
diff --git a/test/e2e/hybrid/hybrid_suite_test.go b/test/e2e/hybrid/hybrid_suite_test.go
index 18d36065e..06b20fb21 100644
--- a/test/e2e/hybrid/hybrid_suite_test.go
+++ b/test/e2e/hybrid/hybrid_suite_test.go
@@ -3,28 +3,14 @@ package hybrid_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	"github.com/go-logr/logr"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
-
-	"github.com/kumahq/kuma/pkg/core"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2EDeploy(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "E2E Deploy Suite")
+		test.RunSpecs(t, "E2E Deploy Suite")
 	} else {
 		t.SkipNow()
 	}
 }
-
-var _ = BeforeSuite(func() {
-	core.SetLogger = func(l logr.Logger) {}
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-})
diff --git a/test/e2e/k8s_api_bypass/k8s_api_bypass_suite_test.go b/test/e2e/k8s_api_bypass/k8s_api_bypass_suite_test.go
index 65e2f0e41..fca9f1155 100644
--- a/test/e2e/k8s_api_bypass/k8s_api_bypass_suite_test.go
+++ b/test/e2e/k8s_api_bypass/k8s_api_bypass_suite_test.go
@@ -3,28 +3,14 @@ package k8s_api_bypass_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	"github.com/go-logr/logr"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
-
-	"github.com/kumahq/kuma/pkg/core"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2EExternalServices(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "Kubernetes API Bypass")
+		test.RunSpecs(t, "Kubernetes API Bypass")
 	} else {
 		t.SkipNow()
 	}
 }
-
-var _ = BeforeSuite(func() {
-	core.SetLogger = func(l logr.Logger) {}
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-})
diff --git a/test/e2e/kic/kubernetes/kubernetes_suite_test.go b/test/e2e/kic/kubernetes/kubernetes_suite_test.go
index 60c786d56..61f55e0e2 100644
--- a/test/e2e/kic/kubernetes/kubernetes_suite_test.go
+++ b/test/e2e/kic/kubernetes/kubernetes_suite_test.go
@@ -3,16 +3,13 @@ package kubernetes_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2EKICKubernetes(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "KIC Kubernetes Suite")
+		test.RunSpecs(t, "KIC Kubernetes Suite")
 	} else {
 		t.SkipNow()
 	}
diff --git a/test/e2e/ratelimit/ratelimit_suite_test.go b/test/e2e/ratelimit/ratelimit_suite_test.go
index 9edcbbf15..5ded00f17 100644
--- a/test/e2e/ratelimit/ratelimit_suite_test.go
+++ b/test/e2e/ratelimit/ratelimit_suite_test.go
@@ -3,16 +3,13 @@ package ratelimit_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2ERateLimit(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "E2E RateLimit Suite")
+		test.RunSpecs(t, "E2E RateLimit Suite")
 	} else {
 		t.SkipNow()
 	}
diff --git a/test/e2e/resilience/resilience_suite_test.go b/test/e2e/resilience/resilience_suite_test.go
index e5ee281bd..b5ad17e23 100644
--- a/test/e2e/resilience/resilience_suite_test.go
+++ b/test/e2e/resilience/resilience_suite_test.go
@@ -3,28 +3,14 @@ package resilience_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	"github.com/go-logr/logr"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
-
-	"github.com/kumahq/kuma/pkg/core"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2EResilience(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "Resilience tests")
+		test.RunSpecs(t, "Resilience tests")
 	} else {
 		t.SkipNow()
 	}
 }
-
-var _ = BeforeSuite(func() {
-	core.SetLogger = func(l logr.Logger) {}
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-})
diff --git a/test/e2e/retry/retry_suite_test.go b/test/e2e/retry/retry_suite_test.go
index 269c896e2..e0398b00f 100644
--- a/test/e2e/retry/retry_suite_test.go
+++ b/test/e2e/retry/retry_suite_test.go
@@ -3,28 +3,14 @@ package retry_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	"github.com/go-logr/logr"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
-
-	"github.com/kumahq/kuma/pkg/core"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2ERetry(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "E2E Retry Suite")
+		test.RunSpecs(t, "E2E Retry Suite")
 	} else {
 		t.SkipNow()
 	}
 }
-
-var _ = BeforeSuite(func() {
-	core.SetLogger = func(l logr.Logger) {}
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-})
diff --git a/test/e2e/timeout/timeout_suite_test.go b/test/e2e/timeout/timeout_suite_test.go
index 50b03deeb..1cdc254b8 100644
--- a/test/e2e/timeout/timeout_suite_test.go
+++ b/test/e2e/timeout/timeout_suite_test.go
@@ -3,28 +3,14 @@ package timeout_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	"github.com/go-logr/logr"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
-
-	"github.com/kumahq/kuma/pkg/core"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2EHealthCheck(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "E2E Health Check Suite")
+		test.RunSpecs(t, "E2E Health Check Suite")
 	} else {
 		t.SkipNow()
 	}
 }
-
-var _ = BeforeSuite(func() {
-	core.SetLogger = func(l logr.Logger) {}
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-})
diff --git a/test/e2e/tracing/tracing_suite_test.go b/test/e2e/tracing/tracing_suite_test.go
index 3b8f653ab..9f3e01a73 100644
--- a/test/e2e/tracing/tracing_suite_test.go
+++ b/test/e2e/tracing/tracing_suite_test.go
@@ -3,28 +3,14 @@ package tracing_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	"github.com/go-logr/logr"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
-
-	"github.com/kumahq/kuma/pkg/core"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2ETracing(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "E2E Tracing Suite")
+		test.RunSpecs(t, "E2E Tracing Suite")
 	} else {
 		t.SkipNow()
 	}
 }
-
-var _ = BeforeSuite(func() {
-	core.SetLogger = func(l logr.Logger) {}
-	logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-})
diff --git a/test/e2e/trafficpermission/hybrid/e2e_suite_test.go b/test/e2e/trafficpermission/hybrid/e2e_suite_test.go
index 9ff23d061..b012ac54c 100644
--- a/test/e2e/trafficpermission/hybrid/e2e_suite_test.go
+++ b/test/e2e/trafficpermission/hybrid/e2e_suite_test.go
@@ -3,16 +3,13 @@ package hybrid_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2ETrafficPermissionHybrid(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "Traffic Permission Hybrid Suite")
+		test.RunSpecs(t, "Traffic Permission Hybrid Suite")
 	} else {
 		t.SkipNow()
 	}
diff --git a/test/e2e/trafficpermission/universal/e2e_suite_test.go b/test/e2e/trafficpermission/universal/e2e_suite_test.go
index ae1b4c3c0..2cbdfcbcd 100644
--- a/test/e2e/trafficpermission/universal/e2e_suite_test.go
+++ b/test/e2e/trafficpermission/universal/e2e_suite_test.go
@@ -3,16 +3,13 @@ package universal_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2ETrafficPermissionUniversal(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "Traffic Permission Universal Suite")
+		test.RunSpecs(t, "Traffic Permission Universal Suite")
 	} else {
 		t.SkipNow()
 	}
diff --git a/test/e2e/trafficpermission/universal/traffic_permission_universal.go b/test/e2e/trafficpermission/universal/traffic_permission_universal.go
index 678f443bf..5ac6d76b9 100644
--- a/test/e2e/trafficpermission/universal/traffic_permission_universal.go
+++ b/test/e2e/trafficpermission/universal/traffic_permission_universal.go
@@ -1,14 +1,10 @@
 package universal
 
 import (
-	"github.com/go-logr/logr"
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
 
 	config_core "github.com/kumahq/kuma/pkg/config/core"
-	"github.com/kumahq/kuma/pkg/core"
 	. "github.com/kumahq/kuma/test/framework"
 )
 
@@ -27,9 +23,6 @@ mtls:
 `
 
 	E2EBeforeSuite(func() {
-		core.SetLogger = func(l logr.Logger) {}
-		logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))
-
 		universalCluster = NewUniversalCluster(NewTestingT(), Kuma1, Silent)
 		deployOptsFuncs = KumaUniversalDeployOpts
 
diff --git a/test/e2e/trafficroute/testutil/testutil_suite_test.go b/test/e2e/trafficroute/testutil/testutil_suite_test.go
index b8b512f68..e9a27281f 100644
--- a/test/e2e/trafficroute/testutil/testutil_suite_test.go
+++ b/test/e2e/trafficroute/testutil/testutil_suite_test.go
@@ -3,11 +3,9 @@ package testutil_test
 import (
 	"testing"
 
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/kumahq/kuma/pkg/test"
 )
 
 func TestApproximatelyMatcher(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "ApproximatelyEqual Matcher Suite")
+	test.RunSpecs(t, "ApproximatelyEqual Matcher Suite")
 }
diff --git a/test/e2e/trafficroute/universal_multizone/e2e_suite_test.go b/test/e2e/trafficroute/universal_multizone/e2e_suite_test.go
index 1dc7e06d7..bb48f0450 100644
--- a/test/e2e/trafficroute/universal_multizone/e2e_suite_test.go
+++ b/test/e2e/trafficroute/universal_multizone/e2e_suite_test.go
@@ -3,16 +3,13 @@ package universal_multizone_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2ETrafficRouteUniversalMultizone(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "Traffic Route Universal Multizone Suite")
+		test.RunSpecs(t, "Traffic Route Universal Multizone Suite")
 	} else {
 		t.SkipNow()
 	}
diff --git a/test/e2e/trafficroute/universal_standalone/e2e_suite_test.go b/test/e2e/trafficroute/universal_standalone/e2e_suite_test.go
index 596f13920..fcf2f3513 100644
--- a/test/e2e/trafficroute/universal_standalone/e2e_suite_test.go
+++ b/test/e2e/trafficroute/universal_standalone/e2e_suite_test.go
@@ -3,16 +3,13 @@ package universal_standalone_test
 import (
 	"testing"
 
+	"github.com/kumahq/kuma/pkg/test"
 	"github.com/kumahq/kuma/test/framework"
-
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
 )
 
 func TestE2ETrafficRouteUniversalStandalone(t *testing.T) {
 	if framework.IsK8sClustersStarted() {
-		RegisterFailHandler(Fail)
-		RunSpecs(t, "Traffic Route Universal Standalone Suite")
+		test.RunSpecs(t, "Traffic Route Universal Standalone Suite")
 	} else {
 		t.SkipNow()
 	}
diff --git a/test/framework/ginkgo.go b/test/framework/ginkgo.go
index ba9ff8060..1acb40911 100644
--- a/test/framework/ginkgo.go
+++ b/test/framework/ginkgo.go
@@ -1,13 +1,8 @@
 package framework
 
 import (
-	"github.com/go-logr/logr"
 	"github.com/onsi/ginkgo"
 	ginkgo_config "github.com/onsi/ginkgo/config"
-	logf "sigs.k8s.io/controller-runtime/pkg/log"
-	"sigs.k8s.io/controller-runtime/pkg/log/zap"
-
-	"github.com/kumahq/kuma/pkg/core"
 )
 
 func ShouldSkipCleanup() bool {
@@ -34,8 +29,6 @@ func E2EAfterSuite(fn func()) {
 
 func E2EBeforeSuite(fn func()) {
 	ginkgo.BeforeSuite(func() {
-		core.SetLogger = func(l logr.Logger) {}
-		logf.SetLogger(zap.LoggerTo(ginkgo.GinkgoWriter, true))
 		fn()
 	})
 }