Skip to content

Commit 7356014

Browse files
chore: skip proxy tests on k0s < 1.29 (#1198)
proxy installations are not supported on k0s < 1.29.
1 parent 4387b51 commit 7356014

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,11 @@ vet: static
219219

220220
.PHONY: e2e-tests
221221
e2e-tests: embedded-release
222-
go test -timeout 60m -parallel 1 -failfast -v ./e2e
222+
go test -timeout 60m -ldflags="$(LD_FLAGS)" -parallel 1 -failfast -v ./e2e
223223

224224
.PHONY: e2e-test
225225
e2e-test:
226-
go test -timeout 60m -v ./e2e -run $(TEST_NAME)$
226+
go test -timeout 60m -ldflags="$(LD_FLAGS)" -v ./e2e -run $(TEST_NAME)$
227227

228228
.PHONY: build-ttl.sh
229229
build-ttl.sh:

e2e/proxy_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,26 @@ import (
77
"testing"
88
"time"
99

10+
"github.com/Masterminds/semver/v3"
1011
"github.com/replicatedhq/embedded-cluster/e2e/cluster"
12+
"github.com/replicatedhq/embedded-cluster/pkg/versions"
1113
"github.com/stretchr/testify/require"
1214
)
1315

16+
// SkipProxyTest returns true if the k0s version in use does not support
17+
// proxied environments.
18+
func SkipProxyTest() bool {
19+
supportedVersion := semver.MustParse("1.29.0")
20+
currentVersion := semver.MustParse(versions.K0sVersion)
21+
return currentVersion.LessThan(supportedVersion)
22+
}
23+
1424
// TestProxiedEnvironment tests the installation behind a proxy server
1525
func TestProxiedEnvironment(t *testing.T) {
1626
t.Parallel()
27+
if SkipProxyTest() {
28+
t.Skip("skipping test for k0s versions < 1.29.0")
29+
}
1730

1831
tc := cluster.NewTestCluster(&cluster.Input{
1932
T: t,
@@ -125,6 +138,9 @@ func TestProxiedEnvironment(t *testing.T) {
125138
// TestProxiedCustomCIDR tests the installation behind a proxy server while using a custom pod and service CIDR
126139
func TestProxiedCustomCIDR(t *testing.T) {
127140
t.Parallel()
141+
if SkipProxyTest() {
142+
t.Skip("skipping test for k0s versions < 1.29.0")
143+
}
128144

129145
tc := cluster.NewTestCluster(&cluster.Input{
130146
T: t,
@@ -244,6 +260,10 @@ func TestProxiedCustomCIDR(t *testing.T) {
244260
}
245261

246262
func TestInstallWithMITMProxy(t *testing.T) {
263+
if SkipProxyTest() {
264+
t.Skip("skipping test for k0s versions < 1.29.0")
265+
}
266+
247267
tc := cluster.NewTestCluster(&cluster.Input{
248268
T: t,
249269
Nodes: 4,

e2e/restore_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ func TestSingleNodeDisasterRecovery(t *testing.T) {
9696

9797
func TestSingleNodeDisasterRecoveryWithProxy(t *testing.T) {
9898
t.Parallel()
99+
if SkipProxyTest() {
100+
t.Skip("skipping test for k0s versions < 1.29.0")
101+
}
99102

100103
requiredEnvVars := []string{
101104
"DR_AWS_S3_ENDPOINT",

0 commit comments

Comments
 (0)