Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8e8d7ac

Browse filesBrowse files
committed
Updated integration test
1 parent ed597ca commit 8e8d7ac
Copy full SHA for 8e8d7ac

File tree

1 file changed

+11
-10
lines changed
Filter options

1 file changed

+11
-10
lines changed

‎internal/integrationtest/upload_mock/upload_mock_test.go

Copy file name to clipboardExpand all lines: internal/integrationtest/upload_mock/upload_mock_test.go
+11-10Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.