@@ -80,7 +80,7 @@ func TestCoreSearch(t *testing.T) {
80
80
// show all versions
81
81
out , _ , err = cli .Run ("core" , "search" , "test_core" , "--all" , "--format" , "json" , "--additional-urls=" + url .String ())
82
82
require .NoError (t , err )
83
- requirejson .Len (t , out , 2 )
83
+ requirejson .Len (t , out , 3 )
84
84
85
85
checkPlatformIsInJSONOutput := func (stdout []byte , id , version string ) {
86
86
jqquery := fmt .Sprintf (`[{id:"%s", latest:"%s"}]` , id , version )
@@ -150,7 +150,7 @@ func TestCoreSearchNoArgs(t *testing.T) {
150
150
// update custom index and install test core (installed cores affect `core search`)
151
151
_ , _ , err := cli .Run ("core" , "update-index" , "--additional-urls=" + url .String ())
152
152
require .NoError (t , err )
153
- _ , _ , err = cli .Run ("core" , "install" , "test:x86" , "--additional-urls=" + url .String ())
153
+ _ , _ , err = cli .Run ("core" , "install" , "test:x86@2.0.0 " , "--additional-urls=" + url .String ())
154
154
require .NoError (t , err )
155
155
156
156
// list all with no additional urls, ensure the test core won't show up
@@ -725,7 +725,7 @@ func TestCoreListSortedResults(t *testing.T) {
725
725
require .NoError (t , err )
726
726
727
727
// install some core for testing
728
- _ , _ , err = cli .Run ("core" , "install" , "test:x86" , "Retrokits-RK002:arm" , "Package:x86" , "--additional-urls=" + url .String ())
728
+ _ , _ , err = cli .Run ("core" , "install" , "test:x86@2.0.0 " , "Retrokits-RK002:arm" , "Package:x86" , "--additional-urls=" + url .String ())
729
729
require .NoError (t , err )
730
730
731
731
// list all with additional url specified
@@ -1006,3 +1006,21 @@ func TestCoreInstallRunsToolPostInstallScript(t *testing.T) {
1006
1006
require .NoError (t , err )
1007
1007
require .Contains (t , string (stdout ), "Skipping tool configuration." )
1008
1008
}
1009
+
1010
+ func TestCoreBrokenDependency (t * testing.T ) {
1011
+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
1012
+ defer env .CleanUp ()
1013
+
1014
+ // Set up an http server to serve our custom index file
1015
+ test_index := paths .New (".." , "testdata" , "test_index.json" )
1016
+ url := env .HTTPServeFile (8000 , test_index )
1017
+
1018
+ // Run update-index with our test index
1019
+ _ , _ , err := cli .Run ("core" , "update-index" , "--additional-urls=" + url .String ())
1020
+ require .NoError (t , err )
1021
+
1022
+ // Check that the download fails and the correct message is displayed
1023
+ _ ,
stderr ,
err := cli .
Run (
"core" ,
"install" ,
"test:[email protected] " ,
"--additional-urls=" + url .
String ())
1024
+ require .Error (t , err )
1025
+ require .
Contains (
t ,
string (
stderr ),
"try contacting [email protected] " )
1026
+ }
0 commit comments