Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

Commit 7ae59a4

Browse files
authored
Add check in test-e2e testing to ensure there's a cluster (#474)
Signed-off-by: Todd Short <[email protected]>
1 parent afd5ffb commit 7ae59a4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/e2e/e2e_suite_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package e2e
22

33
import (
4+
"fmt"
5+
"os"
46
"testing"
57
"time"
68

@@ -24,6 +26,11 @@ var (
2426
)
2527

2628
func TestE2E(t *testing.T) {
29+
_, err := ctrl.GetConfig()
30+
if err != nil {
31+
fmt.Println("Error: Could not get current Kubernetes context. Verify the cluster configuration")
32+
os.Exit(0)
33+
}
2734
RegisterFailHandler(Fail)
2835
SetDefaultEventuallyTimeout(1 * time.Minute)
2936
SetDefaultEventuallyPollingInterval(1 * time.Second)

0 commit comments

Comments
 (0)