8000 Refined the definition of `build_cache.path` and the `--build-path` behaviour by cmaglie · Pull Request #2673 · arduino/arduino-cli · GitHub
[go: up one dir, main page]

Skip to content

Refined the definition of build_cache.path and the --build-path behaviour #2673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Sep 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Updated integration test
  • Loading branch information
cmaglie committed Sep 18, 2024
commit ec3a9cd6b7e4d4f407f62386ac2de83488fd3669
21 changes: 11 additions & 10 deletions internal/integrationtest/upload_mock/upload_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,17 @@ func TestUploadSketch(t *testing.T) {
sketchPath := cli.SketchbookDir().Join(sketchName)
_, _, err := cli.Run("sketch", "new", sketchPath.String())
require.NoError(t, err)
buildDir := generateBuildDir(sketchPath, t)

out, _, err := cli.Run("config", "get", "build_cache.path")
require.NoError(t, err)
cacheDir := paths.New(strings.TrimSpace(string(out)))

md5 := md5.Sum(([]byte(sketchPath.String())))
sketchPathMd5 := strings.ToUpper(hex.EncodeToString(md5[:]))
buildDir := cacheDir.Join("sketches", sketchPathMd5)
require.NoError(t, buildDir.MkdirAll())
require.NoError(t, buildDir.ToAbs())

t.Cleanup(func() { buildDir.RemoveAll() })

for i, _test := range testParameters {
Expand Down Expand Up @@ -718,15 +728,6 @@ func TestUploadSketch(t *testing.T) {
}
}

func generateBuildDir(sketchPath *paths.Path, t *testing.T) *paths.Path {
md5 := md5.Sum(([]byte(sketchPath.String())))
sketchPathMd5 := strings.ToUpper(hex.EncodeToString(md5[:]))
buildDir := paths.TempDir().Join("arduino", "sketches", sketchPathMd5)
require.NoError(t, buildDir.MkdirAll())
require.NoError(t, buildDir.ToAbs())
return buildDir
}

func TestUploadWithInputDirFlag(t *testing.T) {
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
defer env.CleanUp()
Expand Down
Loading
0