Skip to content

Commit 5baf11b

Browse files
Use mocked serial discovery in TestBoardListWithFqbnFilter
1 parent 354464f commit 5baf11b

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Diff for: internal/integrationtest/board/board_test.go

+4-9
Original file line numberDiff line numberDiff line change
@@ -130,22 +130,17 @@ func TestBoardListMock(t *testing.T) {
130130
}
131131

132132
func TestBoardListWithFqbnFilter(t *testing.T) {
133-
if os.Getenv("CI") != "" {
134-
t.Skip("VMs have no serial ports")
135-
}
136-
137133
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
138134
defer env.CleanUp()
139135

140136
_, _, err := cli.Run("core", "update-index")
141137
require.NoError(t, err)
138+
139+
cli.InstallMockedSerialDiscovery(t)
140+
142141
stdout, _, err := cli.Run("board", "list", "-b", "foo:bar:baz", "--format", "json")
143142
require.NoError(t, err)
144-
// this is a bit of a passpartout test, it actually filters the "bluetooth boards" locally
145-
// but it would succeed even if the filtering wasn't working properly
146-
// TODO: find a way to simulate connected boards or create a unit test which
147-
// mocks or initializes multiple components
148-
requirejson.Query(t, stdout, `.boards | length`, `0`)
143+
requirejson.Query(t, stdout, `.detected_ports | length`, `0`)
149144
}
150145

151146
func TestBoardListWithFqbnFilterInvalid(t *testing.T) {

0 commit comments

Comments
 (0)