Skip to content

Commit

Permalink
Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Jan 16, 2025
1 parent 133c821 commit 4de49d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions commands/service_upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,12 @@ func TestDetermineBuildPathAndSketchName(t *testing.T) {
}

func TestUploadPropertiesComposition(t *testing.T) {
pmb := packagemanager.NewBuilder(nil, nil, nil, nil, nil, "test", downloader.GetDefaultConfig())
errs := pmb.LoadHardwareFromDirectory(paths.New("testdata", "upload", "hardware"))
userdir := paths.New("testdata", "upload")
hwdir := userdir.Join("hardware")
pmb := packagemanager.NewBuilder(nil, nil, hwdir, nil, nil, "test", downloader.GetDefaultConfig())
errs := pmb.LoadHardwareFromDirectory(hwdir)
require.Len(t, errs, 0)
buildPath1 := paths.New("testdata", "upload", "build_path_1")
buildPath1 := userdir.Join("build_path_1")
logrus.SetLevel(logrus.TraceLevel)
type test struct {
importDir *paths.Path
Expand Down
4 changes: 2 additions & 2 deletions internal/arduino/cores/packagemanager/package_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var dataDir1 = paths.New("testdata", "data_dir_1")
var extraHardware = paths.New("testdata", "extra_hardware")

func TestFindBoardWithFQBN(t *testing.T) {
pmb := NewBuilder(customHardware, customHardware, nil, customHardware, customHardware, "test", downloader.GetDefaultConfig())
pmb := NewBuilder(customHardware, customHardware, customHardware, customHardware, customHardware, "test", downloader.GetDefaultConfig())
pmb.LoadHardwareFromDirectory(customHardware)
pm := pmb.Build()
pme, release := pm.NewExplorer()
Expand All @@ -57,7 +57,7 @@ func TestFindBoardWithFQBN(t *testing.T) {

func TestResolveFQBN(t *testing.T) {
// Pass nil, since these paths are only used for installing
pmb := NewBuilder(nil, nil, nil, nil, nil, "test", downloader.GetDefaultConfig())
pmb := NewBuilder(nil, nil, customHardware, nil, nil, "test", downloader.GetDefaultConfig())
// Hardware from main packages directory
pmb.LoadHardwareFromDirectory(dataDir1.Join("packages"))
// This contains the arduino:avr core
Expand Down

0 comments on commit 4de49d3

Please sign in to comment.