@@ -526,7 +526,7 @@ func compileWithExportBinariesConfig(t *testing.T, env *integrationtest.Environm
526526 defer cli .WorkingDir ().Join ("arduino-cli.yaml" ).Remove ()
527527
528528 // Test if arduino-cli config file written in the previous run has the `always_export_binaries` flag set.
529- stdout , _ , err := cli .Run ("config" , "dump" , "--format" , "json" )
529+ stdout , _ , err := cli .Run ("config" , "dump" , "--format" , "json" , "--config-file" , "arduino-cli.yaml" )
530530 require .NoError (t , err )
531531 requirejson .Contains (t , stdout , `
532532 {
@@ -536,7 +536,7 @@ func compileWithExportBinariesConfig(t *testing.T, env *integrationtest.Environm
536536 }` )
537537
538538 // Test compilation with export binaries env var set
539- _ , _ , err = cli .Run ("compile" , "-b" , fqbn , sketchPath .String ())
539+ _ , _ , err = cli .Run ("compile" , "-b" , fqbn , "--config-file" , "arduino-cli.yaml" , sketchPath .String ())
540540 require .NoError (t , err )
541541 require .DirExists (t , sketchPath .Join ("build" ).String ())
542542
@@ -563,7 +563,7 @@ func compileWithInvalidUrl(t *testing.T, env *integrationtest.Environment, cli *
563563 require .NoError (t , err )
564564 defer cli .WorkingDir ().Join ("arduino-cli.yaml" ).Remove ()
565565
566- _ , stderr , err := cli .Run ("compile" , "-b" , fqbn , sketchPath .String ())
566+ _ , stderr , err := cli .Run ("compile" , "-b" , fqbn , "--config-file" , "arduino-cli.yaml" , sketchPath .String ())
567567 require .NoError (t , err )
568568 require .Contains (t , string (stderr ), "Error initializing instance: Loading index file: loading json index file" )
569569 expectedIndexfile := cli .DataDir ().Join ("package_example_index.json" )
@@ -813,10 +813,10 @@ func TestCompileWithCustomLibraries(t *testing.T) {
813813 require .NoError (t , err )
814814
815815 // Init the environment explicitly
816- _ , _ , err = cli .Run ("update" )
816+ _ , _ , err = cli .Run ("update" , "--config-file" , "arduino-cli.yaml" )
817817 require .NoError (t , err )
818818
819- _ , _ , err = cli .Run ("core" , "install" , "esp8266:esp8266" )
819+ _ , _ , err = cli .Run ("core" , "install" , "esp8266:esp8266" , "--config-file" , "arduino-cli.yaml" )
820820 require .NoError (t , err )
821821
822822 sketchName := "sketch_with_multiple_custom_libraries"
@@ -825,7 +825,12 @@ func TestCompileWithCustomLibraries(t *testing.T) {
825825
826826 firstLib := sketchPath .Join ("libraries1" )
827827 secondLib := sketchPath .Join ("libraries2" )
828- _ , _ , err = cli .Run ("compile" , "--libraries" , firstLib .String (), "--libraries" , secondLib .String (), "-b" , fqbn , sketchPath .String ())
828+ _ , _ , err = cli .Run ("compile" , "--libraries" ,
829+ firstLib .String (),
830+ "--libraries" , secondLib .String (),
831+ "-b" , fqbn ,
832+ "--config-file" , "arduino-cli.yaml" ,
833+ sketchPath .String ())
829834 require .NoError (t , err )
830835}
831836
@@ -839,26 +844,26 @@ func TestCompileWithArchivesAndLongPaths(t *testing.T) {
839844 require .NoError (t , err )
840845
841846 // Init the environment explicitly
842- _ , _ , err = cli .Run ("update" )
847+ _ , _ , err = cli .Run ("update" , "--config-file" , "arduino-cli.yaml" )
843848 require .NoError (t , err )
844849
845850 // Install core to compile
846- _ , _ , err = cli .Run ("core" , "install" , "esp8266:esp8266@2.7.4" )
851+ _ , _ , err = cli .Run ("core" , "install" , "esp8266:esp8266@2.7.4" , "--config-file" , "arduino-cli.yaml" )
847852 require .NoError (t , err )
848853
849854 // Install test library
850- _ , _ , err = cli .Run ("lib" , "install" , "ArduinoIoTCloud" )
855+ _ , _ , err = cli .Run ("lib" , "install" , "ArduinoIoTCloud" , "--config-file" , "arduino-cli.yaml" )
851856 require .NoError (t , err )
852857
853- stdout , _ , err := cli .Run ("lib" , "examples" , "ArduinoIoTCloud" , "--format" , "json" )
858+ stdout , _ , err := cli .Run ("lib" , "examples" , "ArduinoIoTCloud" , "--format" , "json" , "--config-file" , "arduino-cli.yaml" )
854859 require .NoError (t , err )
855860 var libOutput []map [string ]interface {}
856861 err = json .Unmarshal (stdout , & libOutput )
857862 require .NoError (t , err )
858863 sketchPath := paths .New (libOutput [0 ]["library" ].(map [string ]interface {})["install_dir" ].(string ))
859864 sketchPath = sketchPath .Join ("examples" , "ArduinoIoTCloud-Advanced" )
860865
861- _ , _ , err = cli .Run ("compile" , "-b" , "esp8266:esp8266:huzzah" , sketchPath .String ())
866+ _ , _ , err = cli .Run ("compile" , "-b" , "esp8266:esp8266:huzzah" , sketchPath .String (), "--config-file" , "arduino-cli.yaml" )
862867 require .NoError (t , err )
863868}
864869
@@ -908,16 +913,19 @@ func TestCompileWithFullyPrecompiledLibrary(t *testing.T) {
908913 // https://arduino.github.io/arduino-cli/latest/library-specification/#precompiled-binaries
909914 wd , err := paths .Getwd ()
910915 require .NoError (t , err )
911- _ , _ , err = cli .Run ("lib" , "install" , "--zip-path" , wd .Parent ().Join ("testdata" , "Arduino_TensorFlowLite-2.1.0-ALPHA-precompiled.zip" ).String ())
916+ _ , _ , err = cli .Run ("lib" , "install" ,
917+ "--zip-path" , wd .Parent ().Join ("testdata" , "Arduino_TensorFlowLite-2.1.0-ALPHA-precompiled.zip" ).String (),
918+ "--config-file" , "arduino-cli.yaml" ,
919+ )
912920 require .NoError (t , err )
913921 sketchFolder := cli .SketchbookDir ().Join ("libraries" , "Arduino_TensorFlowLite" , "examples" , "hello_world" )
914922
915923 // Install example dependency
916- _ , _ , err = cli .Run ("lib" , "install" , "Arduino_LSM9DS1" )
924+ _ , _ , err = cli .Run ("lib" , "install" , "Arduino_LSM9DS1" , "--config-file" , "arduino-cli.yaml" )
917925 require .NoError (t , err )
918926
919927 // Compile and verify dependencies detection for fully precompiled library is skipped
920- stdout , _ , err := cli .Run ("compile" , "-b" , fqbn , sketchFolder .String (), "-v" )
928+ stdout , _ , err := cli .Run ("compile" , "-b" , fqbn , "--config-file" , "arduino-cli.yaml" , sketchFolder .String (), "-v" )
921929 require .NoError (t , err )
922930 require .Contains (t , string (stdout ), "Skipping dependencies detection for precompiled library Arduino_TensorFlowLite" )
923931}
0 commit comments