Skip to content

Commit

Permalink
Use mocked serial discovery in TestBoardListWithFqbnFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio-perugini committed Nov 14, 2023
1 parent 354464f commit 5baf11b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions internal/integrationtest/board/board_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,17 @@ func TestBoardListMock(t *testing.T) {
}

func TestBoardListWithFqbnFilter(t *testing.T) {
if os.Getenv("CI") != "" {
t.Skip("VMs have no serial ports")
}

env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
defer env.CleanUp()

_, _, err := cli.Run("core", "update-index")
require.NoError(t, err)

cli.InstallMockedSerialDiscovery(t)

stdout, _, err := cli.Run("board", "list", "-b", "foo:bar:baz", "--format", "json")
require.NoError(t, err)
// this is a bit of a passpartout test, it actually filters the "bluetooth boards" locally
// but it would succeed even if the filtering wasn't working properly
// TODO: find a way to simulate connected boards or create a unit test which
// mocks or initializes multiple components
requirejson.Query(t, stdout, `.boards | length`, `0`)
requirejson.Query(t, stdout, `.detected_ports | length`, `0`)
}

func TestBoardListWithFqbnFilterInvalid(t *testing.T) {
Expand Down

0 comments on commit 5baf11b

Please sign in to comment.