Skip to content

Commit 0fd789d

Browse files
committed
Do not use shared download dir for 'cache clean' command tests
1 parent c10727e commit 0fd789d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Diff for: internal/integrationtest/arduino-cli.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,18 @@ func FindRepositoryRootPath(t *testing.T) *paths.Path {
4747
return repoRootPath
4848
}
4949

50+
// FindArduinoCLIPath returns the path to the arduino-cli executable
51+
func FindArduinoCLIPath(t *testing.T) *paths.Path {
52+
return FindRepositoryRootPath(t).Join("arduino-cli")
53+
}
54+
5055
// CreateArduinoCLIWithEnvironment performs the minimum amount of actions
5156
// to build the default test environment.
5257
func CreateArduinoCLIWithEnvironment(t *testing.T) (*Environment, *ArduinoCLI) {
5358
env := NewEnvironment(t)
5459

5560
cli := NewArduinoCliWithinEnvironment(env, &ArduinoCLIConfig{
56-
ArduinoCLIPath: FindRepositoryRootPath(t).Join("arduino-cli"),
61+
ArduinoCLIPath: FindArduinoCLIPath(t),
5762
UseSharedStagingFolder: true,
5863
})
5964

Diff for: internal/integrationtest/cache/cache_test.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ import (
2323
)
2424

2525
func TestCacheClean(t *testing.T) {
26-
// Clean the cache under arduino caching file directory which is "<Arduino configure file path>/staging"
27-
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
26+
// This test do not use shared download directory becuase it will be cleaned up with 'cache clean' command
27+
env := integrationtest.NewEnvironment(t)
28+
cli := integrationtest.NewArduinoCliWithinEnvironment(env, &integrationtest.ArduinoCLIConfig{
29+
ArduinoCLIPath: integrationtest.FindArduinoCLIPath(t),
30+
})
2831
defer env.CleanUp()
2932

3033
_, _, err := cli.Run("cache", "clean")

0 commit comments

Comments
 (0)