Skip to content

Commit d6f35e8

Browse files
committed
feat: add shared utilities for e2e tests
Add common test infrastructure that both cluster and envtest modes will use. This includes helper functions for running kubectl commands and comparing JSON outputs, a provider registry that maps test directories to their provider types, resource cleanup logic that respects Kubernetes finalizers, and centralized timeout constants so all tests behave consistently.
1 parent 1fd82be commit d6f35e8

5 files changed

Lines changed: 735 additions & 0 deletions

File tree

‎.license-scan-overrides.jsonl‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{"name": "github.com/chzyer/logex", "licenceType": "MIT"}
22
{"name": "github.com/grpc-ecosystem/go-grpc-middleware/v2", "licenceType": "Apache-2.0"}
33
{"name": "github.com/hashicorp/vault/api/auth/approle", "licenceType": "MPL-2.0"}
4+
{"name": "github.com/ironcore-dev/gnmi-test-server", "licenceType": "Apache-2.0"}
45
{"name": "github.com/jpillora/longestcommon", "licenceType": "MIT"}
56
{"name": "github.com/logrusorgru/aurora", "licenceType": "Unlicense"}
67
{"name": "github.com/mattn/go-localereader", "licenceType": "MIT"}

‎test/e2e/testutil/doc.go‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and IronCore contributors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
// Package testutil provides test infrastructure for e2e tests.
5+
//
6+
// It supports two test modes selected by build tags:
7+
//
8+
// - Envtest (build tag: envtest): Uses controller-runtime's envtest.Environment
9+
// with an in-process gNMI test server. Fast (~10s) but doesn't test deployment.
10+
//
11+
// - Cluster (default): Uses a real Kubernetes cluster (typically Kind) with a
12+
// deployed operator and gnmi-test-server pod. Slower (~2-5min) but tests full stack.
13+
//
14+
// The concrete types ClusterEnvironment and EnvtestEnvironment provide the same
15+
// methods, allowing test logic to work with either mode via build tag selection.
16+
package testutil

0 commit comments

Comments
 (0)