Skip to content

Commit ed597ca

Browse files
committed
Updated integration test
1 parent 0210d00 commit ed597ca

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

internal/integrationtest/core/core_test.go

+9-7
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
package core_test
1717

1818
import (
19-
"crypto/md5"
20-
"encoding/hex"
2119
"encoding/json"
2220
"fmt"
2321
"os"
@@ -277,13 +275,17 @@ func TestCoreInstallEsp32(t *testing.T) {
277275
sketchPath := cli.SketchbookDir().Join(sketchName)
278276
_, _, err = cli.Run("sketch", "new", sketchPath.String())
279277
require.NoError(t, err)
280-
_, _, err = cli.Run("compile", "-b", "esp32:esp32:esp32", sketchPath.String())
278+
out, _, err := cli.Run("compile", "-b", "esp32:esp32:esp32", sketchPath.String(), "--json")
281279
require.NoError(t, err)
280+
var builderOutput struct {
281+
BuilderResult struct {
282+
BuildPath string `json:"build_path"`
283+
} `json:"builder_result"`
284+
}
285+
require.NoError(t, json.Unmarshal(out, &builderOutput))
286+
buildDir := paths.New(builderOutput.BuilderResult.BuildPath)
287+
282288
// prevent regressions for https://github.com/arduino/arduino-cli/issues/163
283-
md5 := md5.Sum(([]byte(sketchPath.String())))
284-
sketchPathMd5 := strings.ToUpper(hex.EncodeToString(md5[:]))
285-
require.NotEmpty(t, sketchPathMd5)
286-
buildDir := paths.TempDir().Join("arduino", "sketches", sketchPathMd5)
287289
require.FileExists(t, buildDir.Join(sketchName+".ino.partitions.bin").String())
288290
}
289291

0 commit comments

Comments
 (0)