-
-
Notifications
You must be signed in to change notification settings - Fork 398
[skip-changelog] Add remediation path when tool is not available for an OS #2092
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
MatteoPologruto
merged 2 commits into
arduino:master
from
MatteoPologruto:correct-error-dependency-fail
Mar 6, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,7 @@ func TestCoreSearch(t *testing.T) { | |
// show all versions | ||
out, _, err = cli.Run("core", "search", "test_core", "--all", "--format", "json", "--additional-urls="+url.String()) | ||
require.NoError(t, err) | ||
requirejson.Len(t, out, 2) | ||
requirejson.Len(t, out, 3) | ||
|
||
checkPlatformIsInJSONOutput := func(stdout []byte, id, version string) { | ||
jqquery := fmt.Sprintf(`[{id:"%s", latest:"%s"}]`, id, version) | ||
|
@@ -150,7 +150,7 @@ func TestCoreSearchNoArgs(t *testing.T) { | |
// update custom index and install test core (installed cores affect `core search`) | ||
_, _, err := cli.Run("core", "update-index", "--additional-urls="+url.String()) | ||
require.NoError(t, err) | ||
_, _, err = cli.Run("core", "install", "test:x86", "--additional-urls="+url.String()) | ||
_, _, err = cli.Run("core", "install", "test:x86@2.0.0", "--additional-urls="+url.String()) | ||
require.NoError(t, err) | ||
|
||
// list all with no additional urls, ensure the test core won't show up | ||
|
@@ -161,7 +161,7 @@ func TestCoreSearchNoArgs(t *testing.T) { | |
lines = append(lines, strings.Fields(strings.TrimSpace(v))) | ||
} | ||
// The header is printed on the first lines | ||
require.Equal(t, []string{"test:x86", "2.0.0", "test_core"}, lines[20]) | ||
require.Equal(t, []string{"test:x86", "2.0.0", "test_core"}, lines[21]) | ||
numPlatforms := len(lines) - 1 | ||
|
||
// same thing in JSON format, also check the number of platforms found is the same | ||
|
@@ -178,7 +178,7 @@ func TestCoreSearchNoArgs(t *testing.T) { | |
lines = append(lines, strings.Fields(strings.TrimSpace(v))) | ||
} | ||
// The header is printed on the first lines | ||
require.Equal(t, []string{"test:x86", "2.0.0", "test_core"}, lines[21]) | ||
require.Equal(t, []string{"test:x86", "3.0.0", "test_core"}, lines[22]) | ||
numPlatforms = len(lines) - 1 | ||
|
||
// same thing in JSON format, also check the number of platforms found is the same | ||
|
@@ -725,7 +725,7 @@ func TestCoreListSortedResults(t *testing.T) { | |
require.NoError(t, err) | ||
|
||
// install some core for testing | ||
_, _, err = cli.Run("core", "install", "test:x86", "Retrokits-RK002:arm", "Package:x86", "--additional-urls="+url.String()) | ||
_, _, err = cli.Run("core", "install", "test:x86@2.0.0", "Retrokits-RK002:arm", "Package:x86", "--additional-urls="+url.String()) | ||
require.NoError(t, err) | ||
|
||
// list all with additional url specified | ||
|
@@ -1006,3 +1006,21 @@ func TestCoreInstallRunsToolPostInstallScript(t *testing.T) { | |
require.NoError(t, err) | ||
require.Contains(t, string(stdout), "Skipping tool configuration.") | ||
} | ||
|
||
func TestCoreBrokenDependency(t *testing.T) { | ||
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t) | ||
defer env.CleanUp() | ||
|
||
// Set up an http server to serve our custom index file | ||
test_index := paths.New("..", "testdata", "test_index.json") | ||
url := env.HTTPServeFile(8000, test_index) | ||
|
||
// Run update-index with our test index | ||
_, _, err := cli.Run("core", "update-index", "--additional-urls="+url.String()) | ||
require.NoError(t, err) | ||
|
||
// Check that the download fails and the correct message is displayed | ||
_, stderr, err := cli.Run("core", "install", "test:[email protected]", "--additional-urls="+url.String()) | ||
require.Error(t, err) | ||
require.Contains(t, string(stderr), "try contacting [email protected]") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,9 +44,40 @@ | |
"name": "Test Board" | ||
} | ||
] | ||
}, | ||
{ | ||
"category": "Test Category", | ||
"help": { | ||
"online": "https://github.com/Arduino/arduino-cli" | ||
}, | ||
"url": "https://raw.githubusercontent.com/arduino/arduino-cli/master/internal/integrationtest/testdata/core.zip", | ||
"checksum": "SHA-256:6a338cf4d6d501176a2d352c87a8d72ac7488b8c5b82cdf2a4e2cef630391092", | ||
"name": "test_core", | ||
"version": "3.0.0", | ||
"architecture": "x86", | ||
"archiveFileName": "core.zip", | ||
"size": "486", | ||
"toolsDependencies": [ | ||
{ | ||
"packager": "test", | ||
"version": "1.0.6", | ||
"name": "rp2040tools" | ||
} | ||
], | ||
"boards": [ | ||
{ | ||
"name": "Test Board" | ||
} | ||
] | ||
} | ||
], | ||
"tools": [ | ||
{ | ||
"name": "rp2040tools", | ||
"version": "1.0.6", | ||
"systems": [] | ||
} | ||
], | ||
"tools": [], | ||
"email": "[email protected]", | ||
"name": "test" | ||
}, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This string can not be correctly translated, you must replace unindexed
%s
with%[1]s
and%[2]s
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified here: #2099