Skip to content

Commit b7c77fe

Browse files
committed
Fix unit tests
1 parent eadda13 commit b7c77fe

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

arduino/cores/packagemanager/loader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (pm *PackageManager) loadPlatform(targetPackage *cores.Package, platformPat
199199
platformTxtPath := platformPath.Join("platform.txt")
200200
platformProperties, err := properties.SafeLoad(platformTxtPath.String())
201201
if err != nil {
202-
return status.Newf(codes.FailedPrecondition, "loading platform.txt: %w", err)
202+
return status.Newf(codes.FailedPrecondition, "loading platform.txt: %v", err)
203203
}
204204

205205
version := semver.MustParse(platformProperties.Get("version"))

arduino/cores/packagemanager/package_manager_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ func TestFindToolsRequiredForBoard(t *testing.T) {
228228
loadIndex("https://dl.espressif.com/dl/package_esp32_index.json")
229229
loadIndex("http://arduino.esp8266.com/stable/package_esp8266com_index.json")
230230
loadIndex("https://adafruit.github.io/arduino-board-index/package_adafruit_index.json")
231-
require.NoError(t, pm.LoadHardware())
231+
errs := pm.LoadHardware()
232+
require.Len(t, errs, 0)
232233
esp32, err := pm.FindBoardWithFQBN("esp32:esp32:esp32")
233234
require.NoError(t, err)
234235
esptool231 := pm.FindToolDependency(&cores.ToolDependency{

commands/core/search_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ func TestPlatformSearch(t *testing.T) {
4141

4242
configuration.Settings = configuration.Init(paths.TempDir().Join("test", "arduino-cli.yaml").String())
4343

44-
inst, err := instance.CreateInstance()
45-
require.Nil(t, err)
44+
inst := instance.CreateAndInit()
4645
require.NotNil(t, inst)
4746

4847
res, err := PlatformSearch(&rpc.PlatformSearchRequest{

commands/upload/upload_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ func TestDetermineBuildPathAndSketchName(t *testing.T) {
127127

128128
func TestUploadPropertiesComposition(t *testing.T) {
129129
pm := packagemanager.NewPackageManager(nil, nil, nil, nil)
130-
err := pm.LoadHardwareFromDirectory(paths.New("testdata", "hardware"))
131-
require.NoError(t, err)
130+
errs := pm.LoadHardwareFromDirectory(paths.New("testdata", "hardware"))
131+
require.Len(t, errs, 0)
132132
buildPath1 := paths.New("testdata", "build_path_1")
133133
logrus.SetLevel(logrus.TraceLevel)
134134
type test struct {

0 commit comments

Comments
 (0)