Skip to content

Commit db712e7

Browse files
authored
Fixing e2e tests, podman and scheduler fail with mariner images (#1450)
* Fix standalone e2e tests Fix podman e2e install Fix scheduler start failure on standalone mariner image variant Signed-off-by: Anton Troshin <[email protected]> * fix test Signed-off-by: Anton Troshin <[email protected]> * revert Signed-off-by: Anton Troshin <[email protected]> * Fix podman machine settings Add cleanups Remove parallel tests Fix mariner volume mount location Remove old build tags Signed-off-by: Anton Troshin <[email protected]> --------- Signed-off-by: Anton Troshin <[email protected]>
1 parent e08443b commit db712e7

18 files changed

+102
-51
lines changed

.github/workflows/kind_e2e.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@ jobs:
5050
name: E2E tests for K8s (KinD)
5151
runs-on: ubuntu-latest
5252
env:
53-
DAPR_RUNTIME_PINNED_VERSION: 1.13.0-rc.2
53+
DAPR_RUNTIME_PINNED_VERSION: 1.13.5
5454
DAPR_DASHBOARD_PINNED_VERSION: 0.14.0
5555
DAPR_RUNTIME_LATEST_STABLE_VERSION:
5656
DAPR_DASHBOARD_LATEST_STABLE_VERSION:
57-
DAPR_TGZ: dapr-1.13.0-rc.2.tgz
5857
strategy:
5958
fail-fast: false # Keep running if one leg fails.
6059
matrix:

.github/workflows/self_hosted_e2e.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ jobs:
3838
GOARCH: ${{ matrix.target_arch }}
3939
GOPROXY: https://proxy.golang.org
4040
ARCHIVE_OUTDIR: dist/archives
41-
DAPR_RUNTIME_PINNED_VERSION: "1.13.0-rc.2"
41+
DAPR_RUNTIME_PINNED_VERSION: "1.13.5"
4242
DAPR_DASHBOARD_PINNED_VERSION: 0.14.0
4343
DAPR_RUNTIME_LATEST_STABLE_VERSION: ""
4444
DAPR_DASHBOARD_LATEST_STABLE_VERSION: ""
4545
GOLANG_PROTOBUF_REGISTRATION_CONFLICT: warn
46-
PODMAN_VERSION: 4.4.4
46+
PODMAN_VERSION: 4.9.3
4747
strategy:
4848
# TODO: Remove this when our E2E tests are stable for podman on MacOS.
4949
fail-fast: false # Keep running if one leg fails.
@@ -122,6 +122,7 @@ jobs:
122122
sudo podman-mac-helper install
123123
podman machine init
124124
podman machine start --log-level debug
125+
podman machine ssh sudo sysctl -w kernel.keys.maxkeys=20000
125126
echo "CONTAINER_RUNTIME=podman" >> $GITHUB_ENV
126127
- name: Determine latest Dapr Runtime version including Pre-releases
127128
if: github.base_ref == 'master'

pkg/standalone/standalone.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,11 @@ func runSchedulerService(wg *sync.WaitGroup, errorChan chan<- error, info initIn
652652
// /var/lock and can therefore mount the Docker volume here.
653653
// TODO: update the Dapr scheduler dockerfile to create a scheduler user id writeable
654654
// directory at /var/lib/dapr/scheduler, then update the path here.
655-
args = append(args, "--volume", *info.schedulerVolume+":/var/lock")
655+
if strings.EqualFold(info.imageVariant, "mariner") {
656+
args = append(args, "--volume", *info.schedulerVolume+":/var/tmp")
657+
} else {
658+
args = append(args, "--volume", *info.schedulerVolume+":/var/lock")
659+
}
656660
}
657661

658662
if info.dockerNetwork != "" {
@@ -673,7 +677,11 @@ func runSchedulerService(wg *sync.WaitGroup, errorChan chan<- error, info initIn
673677
)
674678
}
675679

676-
args = append(args, image, "--etcd-data-dir=/var/lock/dapr/scheduler")
680+
if strings.EqualFold(info.imageVariant, "mariner") {
681+
args = append(args, image, "--etcd-data-dir=/var/tmp/dapr/scheduler")
682+
} else {
683+
args = append(args, image, "--etcd-data-dir=/var/lock/dapr/scheduler")
684+
}
677685

678686
_, err = utils.RunCmdAndWait(runtimeCmd, args...)
679687
if err != nil {

tests/e2e/standalone/commands.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build e2e || template
2-
// +build e2e template
32

43
/*
54
Copyright 2022 The Dapr Authors

tests/e2e/standalone/init_negative_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build e2e && !template
2-
// +build e2e,!template
32

43
/*
54
Copyright 2022 The Dapr Authors
@@ -33,7 +32,6 @@ func TestStandaloneInitNegatives(t *testing.T) {
3332
require.NoError(t, err, "expected no error on querying for os home dir")
3433

3534
t.Run("run without install", func(t *testing.T) {
36-
t.Parallel()
3735
output, err := cmdRun("")
3836
require.Error(t, err, "expected error status on run without install")
3937
path := filepath.Join(homeDir, ".dapr", "components")
@@ -45,21 +43,18 @@ func TestStandaloneInitNegatives(t *testing.T) {
4543
})
4644

4745
t.Run("list without install", func(t *testing.T) {
48-
t.Parallel()
4946
output, err := cmdList("")
5047
require.NoError(t, err, "expected no error status on list without install")
5148
require.Equal(t, "No Dapr instances found.\n", output)
5249
})
5350

5451
t.Run("stop without install", func(t *testing.T) {
55-
t.Parallel()
5652
output, err := cmdStopWithAppID("test")
5753
require.NoError(t, err, "expected no error on stop without install")
5854
require.Contains(t, output, "failed to stop app id test: couldn't find app id test", "expected output to match")
5955
})
6056

6157
t.Run("uninstall without install", func(t *testing.T) {
62-
t.Parallel()
6358
output, err := cmdUninstall()
6459
require.NoError(t, err, "expected no error on uninstall without install")
6560
require.Contains(t, output, "Removing Dapr from your machine...", "expected output to contain message")

tests/e2e/standalone/init_run_custom_path_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build e2e && !template
2-
// +build e2e,!template
32

43
/*
54
Copyright 2022 The Dapr Authors

tests/e2e/standalone/init_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build e2e && !template
2-
// +build e2e,!template
32

43
/*
54
Copyright 2022 The Dapr Authors
@@ -167,15 +166,17 @@ func TestStandaloneInit(t *testing.T) {
167166
placementPort = 6050
168167
}
169168

170-
verifyTCPLocalhost(t, placementPort)
169+
verifyTCPLocalhost(t, placementPort)
171170
})
172171

173172
t.Run("init version with scheduler", func(t *testing.T) {
174173
// Ensure a clean environment
175174
must(t, cmdUninstall, "failed to uninstall Dapr")
176175

176+
latestDaprRuntimeVersion, latestDaprDashboardVersion := common.GetVersionsFromEnv(t, true)
177+
177178
args := []string{
178-
"--runtime-version", "1.14.0-rc.3",
179+
"--runtime-version", latestDaprRuntimeVersion,
179180
"--dev",
180181
}
181182
output, err := cmdInit(args...)
@@ -189,9 +190,8 @@ func TestStandaloneInit(t *testing.T) {
189190
daprPath := filepath.Join(homeDir, ".dapr")
190191
require.DirExists(t, daprPath, "Directory %s does not exist", daprPath)
191192

192-
_, latestDaprDashboardVersion := common.GetVersionsFromEnv(t, true)
193-
verifyContainers(t, "1.14.0-rc.3")
194-
verifyBinaries(t, daprPath, "1.14.0-rc.3", latestDaprDashboardVersion)
193+
verifyContainers(t, latestDaprRuntimeVersion)
194+
verifyBinaries(t, daprPath, latestDaprRuntimeVersion, latestDaprDashboardVersion)
195195
verifyConfigs(t, daprPath)
196196

197197
placementPort := 50005
@@ -201,8 +201,8 @@ func TestStandaloneInit(t *testing.T) {
201201
schedulerPort = 6060
202202
}
203203

204-
verifyTCPLocalhost(t, placementPort)
205-
verifyTCPLocalhost(t, schedulerPort)
204+
verifyTCPLocalhost(t, placementPort)
205+
verifyTCPLocalhost(t, schedulerPort)
206206
})
207207

208208
t.Run("init without runtime-version flag with mariner images", func(t *testing.T) {

tests/e2e/standalone/invoke_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build e2e && !template
2-
// +build e2e,!template
32

43
/*
54
Copyright 2022 The Dapr Authors

tests/e2e/standalone/list_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build e2e && !template
2-
// +build e2e,!template
32

43
/*
54
Copyright 2022 The Dapr Authors
@@ -137,6 +136,13 @@ func TestStandaloneList(t *testing.T) {
137136
t.Log(output)
138137
require.NoError(t, err, "expected no error status on list")
139138
require.Equal(t, "No Dapr instances found.\n", output)
139+
140+
// This test is skipped on Windows, but just in case, try to terminate dashboard process only on non-Windows OSs
141+
// stopProcess uses kill command, won't work on windows
142+
if runtime.GOOS != "windows" {
143+
err = stopProcess("dashboard", "--port", "5555")
144+
require.NoError(t, err, "failed to stop dashboard process")
145+
}
140146
})
141147
}
142148

tests/e2e/standalone/publish_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build e2e && !template
2-
// +build e2e,!template
32

43
/*
54
Copyright 2022 The Dapr Authors

0 commit comments

Comments
 (0)