Skip to content

Commit

Permalink
Updated integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Sep 18, 2024
1 parent d6fc941 commit 3747166
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions internal/integrationtest/core/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
package core_test

import (
"crypto/md5"
"encoding/hex"
"encoding/json"
"fmt"
"os"
Expand Down Expand Up @@ -277,13 +275,17 @@ func TestCoreInstallEsp32(t *testing.T) {
sketchPath := cli.SketchbookDir().Join(sketchName)
_, _, err = cli.Run("sketch", "new", sketchPath.String())
require.NoError(t, err)
_, _, err = cli.Run("compile", "-b", "esp32:esp32:esp32", sketchPath.String())
out, _, err := cli.Run("compile", "-b", "esp32:esp32:esp32", sketchPath.String(), "--json")
require.NoError(t, err)
var builderOutput struct {
BuilderResult struct {
BuildPath string `json:"build_path"`
} `json:"builder_result"`
}
require.NoError(t, json.Unmarshal(out, &builderOutput))
buildDir := paths.New(builderOutput.BuilderResult.BuildPath)

// prevent regressions for https://github.com/arduino/arduino-cli/issues/163
md5 := md5.Sum(([]byte(sketchPath.String())))
sketchPathMd5 := strings.ToUpper(hex.EncodeToString(md5[:]))
require.NotEmpty(t, sketchPathMd5)
buildDir := paths.TempDir().Join("arduino", "sketches", sketchPathMd5)
require.FileExists(t, buildDir.Join(sketchName+".ino.partitions.bin").String())
}

Expand Down

0 comments on commit 3747166

Please sign in to comment.