Skip to content

Commit 8e8d7ac

Browse files
committed
Updated integration test
1 parent ed597ca commit 8e8d7ac

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

internal/integrationtest/upload_mock/upload_mock_test.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,17 @@ func TestUploadSketch(t *testing.T) {
655655
sketchPath := cli.SketchbookDir().Join(sketchName)
656656
_, _, err := cli.Run("sketch", "new", sketchPath.String())
657657
require.NoError(t, err)
658-
buildDir := generateBuildDir(sketchPath, t)
658+
659+
out, _, err := cli.Run("config", "get", "build_cache.path")
660+
require.NoError(t, err)
661+
cacheDir := paths.New(strings.TrimSpace(string(out)))
662+
663+
md5 := md5.Sum(([]byte(sketchPath.String())))
664+
sketchPathMd5 := strings.ToUpper(hex.EncodeToString(md5[:]))
665+
buildDir := cacheDir.Join("sketches", sketchPathMd5)
666+
require.NoError(t, buildDir.MkdirAll())
667+
require.NoError(t, buildDir.ToAbs())
668+
659669
t.Cleanup(func() { buildDir.RemoveAll() })
660670

661671
for i, _test := range testParameters {
@@ -718,15 +728,6 @@ func TestUploadSketch(t *testing.T) {
718728
}
719729
}
720730

721-
func generateBuildDir(sketchPath *paths.Path, t *testing.T) *paths.Path {
722-
md5 := md5.Sum(([]byte(sketchPath.String())))
723-
sketchPathMd5 := strings.ToUpper(hex.EncodeToString(md5[:]))
724-
buildDir := paths.TempDir().Join("arduino", "sketches", sketchPathMd5)
725-
require.NoError(t, buildDir.MkdirAll())
726-
require.NoError(t, buildDir.ToAbs())
727-
return buildDir
728-
}
729-
730731
func TestUploadWithInputDirFlag(t *testing.T) {
731732
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
732733
defer env.CleanUp()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy