Skip to content

Fixed integration test TestLibInstallMultipleSameLibrary #1967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions internal/integrationtest/lib/lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ func TestLibInstallMultipleSameLibrary(t *testing.T) {
require.NoError(t, err)
jsonOut, _, err := cli.Run("lib", "list", "--format", "json")
require.NoError(t, err)
requirejson.Len(t, jsonOut, 1, "A duplicate library install has been detected")
// Count how many libraries with the name "Arduino SigFox for MKRFox1200" are installed
requirejson.Parse(t, jsonOut).
Query(`[.[].library.name | select(. == "Arduino SigFox for MKRFox1200")]`).
LengthMustEqualTo(1, "Found multiple installations of Arduino SigFox for MKRFox1200'")

// Check that 'lib upgrade' didn't create a double install
// https://github.com/arduino/arduino-cli/issues/1870
Expand All @@ -109,7 +112,10 @@ func TestLibInstallMultipleSameLibrary(t *testing.T) {
require.NoError(t, err)
jsonOut, _, err = cli.Run("lib", "list", "--format", "json")
require.NoError(t, err)
requirejson.Len(t, jsonOut, 1, "A duplicate library install has been detected")
// Count how many libraries with the name "Arduino SigFox for MKRFox1200" are installed
requirejson.Parse(t, jsonOut).
Query(`[.[].library.name | select(. == "Arduino SigFox for MKRFox1200")]`).
LengthMustEqualTo(1, "Found multiple installations of Arduino SigFox for MKRFox1200'")
}

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