Skip to content

Commit 0e95497

Browse files
committed
[no-relnote] Allow local tests
Signed-off-by: Evan Lezar <[email protected]>
1 parent 23068fc commit 0e95497

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

tests/e2e/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ GINKGO_BIN := $(CURDIR)/bin/ginkgo
2323
test: $(GINKGO_BIN)
2424
$(GINKGO_BIN) $(GINKGO_ARGS) -v --json-report ginkgo.json ./tests/e2e/...
2525

26+
# test-reinstalled runs the test cases against the version of the toolkit that
27+
# is already installed (and configured for docker) on the host.
28+
.PHONY: test-preinstalled
29+
test-preinstalled: test
30+
test-preinstalled: E2E_INSTALL_CTK = false
31+
test-preinstalled: E2E_SSH_HOST =
32+
33+
2634
$(GINKGO_BIN):
2735
mkdir -p $(CURDIR)/bin
2836
GOBIN=$(CURDIR)/bin go install github.com/onsi/ginkgo/v2/ginkgo@latest

tests/e2e/e2e_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,13 @@ func getTestEnv() {
6969

7070
}
7171

72-
sshKey = getRequiredEnvvar[string]("E2E_SSH_KEY")
73-
sshUser = getRequiredEnvvar[string]("E2E_SSH_USER")
74-
sshHost = getRequiredEnvvar[string]("E2E_SSH_HOST")
72+
sshHost = getEnvVarOrDefault("E2E_SSH_HOST", "")
73+
if sshHost != "" {
74+
sshKey = getRequiredEnvvar[string]("E2E_SSH_KEY")
75+
sshUser = getRequiredEnvvar[string]("E2E_SSH_USER")
76+
sshPort = getEnvVarOrDefault("E2E_SSH_PORT", "22")
77+
}
7578

76-
sshPort = getEnvVarOrDefault("E2E_SSH_PORT", "22")
7779
}
7880

7981
// getRequiredEnvvar returns the specified envvar if set or raises an error.

0 commit comments

Comments
 (0)