Skip to content

Commit 093239b

Browse files
committed
fix tests
Signed-off-by: Pravin Pushkar <[email protected]>
1 parent e73ec7d commit 093239b

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

pkg/standalone/common.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ import (
1919
"runtime"
2020

2121
"github.com/dapr/cli/pkg/print"
22+
"github.com/dapr/cli/utils"
2223
)
2324

2425
const (
25-
DefaultComponentsDirName = "components"
26-
DefaultResourcesDirName = "resources"
27-
2826
defaultDaprDirName = ".dapr"
2927
defaultDaprBinDirName = "bin"
3028
defaultConfigFileName = "config.yaml"
@@ -48,11 +46,11 @@ func binaryFilePath(binaryDir string, binaryFilePrefix string) string {
4846
}
4947

5048
func DefaultComponentsDirPath() string {
51-
return path_filepath.Join(defaultDaprDirPath(), DefaultComponentsDirName)
49+
return path_filepath.Join(defaultDaprDirPath(), utils.DefaultComponentsDirName)
5250
}
5351

5452
func DefaultResourcesDirPath() string {
55-
return path_filepath.Join(defaultDaprDirPath(), DefaultResourcesDirName)
53+
return path_filepath.Join(defaultDaprDirPath(), utils.DefaultResourcesDirName)
5654
}
5755

5856
// DefaultResourcesDirPrecedence returns the path to the resources directory if it exists, or otherwise the components directory.

tests/e2e/standalone/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import (
2828
"github.com/stretchr/testify/assert"
2929
"github.com/stretchr/testify/require"
3030

31-
"github.com/dapr/cli/pkg/standalone"
3231
"github.com/dapr/cli/tests/e2e/common"
32+
"github.com/dapr/cli/utils"
3333
)
3434

3535
// getSocketCases return different unix socket paths for testing across Dapr commands.
@@ -143,7 +143,7 @@ func ensureDaprInstallation(t *testing.T) {
143143
// Slim mode does not have any resources by default.
144144
// Install the resources required by the tests.
145145
if isSlimMode() {
146-
err = createSlimComponents(filepath.Join(daprPath, standalone.DefaultResourcesDirName))
146+
err = createSlimComponents(filepath.Join(daprPath, utils.DefaultResourcesDirName))
147147
require.NoError(t, err, "failed to create resources directory for slim mode")
148148
}
149149
}

utils/utils.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ const (
4141
DOCKER ContainerRuntime = "docker"
4242
PODMAN ContainerRuntime = "podman"
4343

44+
DefaultComponentsDirName = "components"
45+
DefaultResourcesDirName = "resources"
46+
4447
marinerImageVariantName = "mariner"
4548

4649
socketFormat = "%s/dapr-%s-%s.socket"

0 commit comments

Comments
 (0)