-
-
Notifications
You must be signed in to change notification settings - Fork 406
[breaking] fix: remove tree config lookup #2085
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
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4d787f1
revert: removed config file lookup in cwd and parents
8aec70c
test: remove obsolete case
6c5b706
fix: old function name
d9d32a7
test: use command line flag in tests
81b52c4
docs: removed tree config lookup docs
bf6da0a
docs: modified upgrading.md
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -526,7 +526,7 @@ func compileWithExportBinariesConfig(t *testing.T, env *integrationtest.Environm | |
defer cli.WorkingDir().Join("arduino-cli.yaml").Remove() | ||
|
||
// Test if arduino-cli config file written in the previous run has the `always_export_binaries` flag set. | ||
stdout, _, err := cli.Run("config", "dump", "--format", "json") | ||
stdout, _, err := cli.Run("config", "dump", "--format", "json", "--config-file", "arduino-cli.yaml") | ||
require.NoError(t, err) | ||
requirejson.Contains(t, stdout, ` | ||
{ | ||
|
@@ -536,7 +536,7 @@ func compileWithExportBinariesConfig(t *testing.T, env *integrationtest.Environm | |
}`) | ||
|
||
// Test compilation with export binaries env var set | ||
_, _, err = cli.Run("compile", "-b", fqbn, sketchPath.String()) | ||
_, _, err = cli.Run("compile", "-b", fqbn, "--config-file", "arduino-cli.yaml", sketchPath.String()) | ||
require.NoError(t, err) | ||
require.DirExists(t, sketchPath.Join("build").String()) | ||
|
||
|
@@ -563,7 +563,7 @@ func compileWithInvalidUrl(t *testing.T, env *integrationtest.Environment, cli * | |
require.NoError(t, err) | ||
defer cli.WorkingDir().Join("arduino-cli.yaml").Remove() | ||
|
||
_, stderr, err := cli.Run("compile", "-b", fqbn, sketchPath.String()) | ||
_, stderr, err := cli.Run("compile", "-b", fqbn, "--config-file", "arduino-cli.yaml", sketchPath.String()) | ||
require.NoError(t, err) | ||
require.Contains(t, string(stderr), "Error initializing instance: Loading index file: loading json index file") | ||
expectedIndexfile := cli.DataDir().Join("package_example_index.json") | ||
|
@@ -813,10 +813,10 @@ func TestCompileWithCustomLibraries(t *testing.T) { | |
require.NoError(t, err) | ||
|
||
// Init the environment explicitly | ||
_, _, err = cli.Run("update") | ||
_, _, err = cli.Run("update", "--config-file", "arduino-cli.yaml") | ||
require.NoError(t, err) | ||
|
||
_, _, err = cli.Run("core", "install", "esp8266:esp8266") | ||
_, _, err = cli.Run("core", "install", "esp8266:esp8266", "--config-file", "arduino-cli.yaml") | ||
require.NoError(t, err) | ||
|
||
sketchName := "sketch_with_multiple_custom_libraries" | ||
|
@@ -825,7 +825,12 @@ func TestCompileWithCustomLibraries(t *testing.T) { | |
|
||
firstLib := sketchPath.Join("libraries1") | ||
secondLib := sketchPath.Join("libraries2") | ||
_, _, err = cli.Run("compile", "--libraries", firstLib.String(), "--libraries", secondLib.String(), "-b", fqbn, sketchPath.String()) | ||
_, _, err = cli.Run("compile", "--libraries", | ||
firstLib.String(), | ||
"--libraries", secondLib.String(), | ||
"-b", fqbn, | ||
"--config-file", "arduino-cli.yaml", | ||
sketchPath.String()) | ||
require.NoError(t, err) | ||
} | ||
|
||
|
@@ -839,26 +844,26 @@ func TestCompileWithArchivesAndLongPaths(t *testing.T) { | |
require.NoError(t, err) | ||
|
||
// Init the environment explicitly | ||
_, _, err = cli.Run("update") | ||
_, _, err = cli.Run("update", "--config-file", "arduino-cli.yaml") | ||
require.NoError(t, err) | ||
|
||
// Install core to compile | ||
_, _, err = cli.Run("core", "install", "esp8266:[email protected]") | ||
_, _, err = cli.Run("core", "install", "esp8266:[email protected]", "--config-file", "arduino-cli.yaml") | ||
require.NoError(t, err) | ||
|
||
// Install test library | ||
_, _, err = cli.Run("lib", "install", "ArduinoIoTCloud") | ||
_, _, err = cli.Run("lib", "install", "ArduinoIoTCloud", "--config-file", "arduino-cli.yaml") | ||
require.NoError(t, err) | ||
|
||
stdout, _, err := cli.Run("lib", "examples", "ArduinoIoTCloud", "--format", "json") | ||
stdout, _, err := cli.Run("lib", "examples", "ArduinoIoTCloud", "--format", "json", "--config-file", "arduino-cli.yaml") | ||
require.NoError(t, err) | ||
var libOutput []map[string]interface{} | ||
err = json.Unmarshal(stdout, &libOutput) | ||
require.NoError(t, err) | ||
sketchPath := paths.New(libOutput[0]["library"].(map[string]interface{})["install_dir"].(string)) | ||
sketchPath = sketchPath.Join("examples", "ArduinoIoTCloud-Advanced") | ||
|
||
_, _, err = cli.Run("compile", "-b", "esp8266:esp8266:huzzah", sketchPath.String()) | ||
_, _, err = cli.Run("compile", "-b", "esp8266:esp8266:huzzah", sketchPath.String(), "--config-file", "arduino-cli.yaml") | ||
require.NoError(t, err) | ||
} | ||
|
||
|
@@ -908,16 +913,19 @@ func TestCompileWithFullyPrecompiledLibrary(t *testing.T) { | |
// https://arduino.github.io/arduino-cli/latest/library-specification/#precompiled-binaries | ||
wd, err := paths.Getwd() | ||
require.NoError(t, err) | ||
_, _, err = cli.Run("lib", "install", "--zip-path", wd.Parent().Join("testdata", "Arduino_TensorFlowLite-2.1.0-ALPHA-precompiled.zip").String()) | ||
_, _, err = cli.Run("lib", "install", | ||
"--zip-path", wd.Parent().Join("testdata", "Arduino_TensorFlowLite-2.1.0-ALPHA-precompiled.zip").String(), | ||
"--config-file", "arduino-cli.yaml", | ||
) | ||
require.NoError(t, err) | ||
sketchFolder := cli.SketchbookDir().Join("libraries", "Arduino_TensorFlowLite", "examples", "hello_world") | ||
|
||
// Install example dependency | ||
_, _, err = cli.Run("lib", "install", "Arduino_LSM9DS1") | ||
_, _, err = cli.Run("lib", "install", "Arduino_LSM9DS1", "--config-file", "arduino-cli.yaml") | ||
require.NoError(t, err) | ||
|
||
// Compile and verify dependencies detection for fully precompiled library is skipped | ||
stdout, _, err := cli.Run("compile", "-b", fqbn, sketchFolder.String(), "-v") | ||
stdout, _, err := cli.Run("compile", "-b", fqbn, "--config-file", "arduino-cli.yaml", sketchFolder.String(), "-v") | ||
require.NoError(t, err) | ||
require.Contains(t, string(stdout), "Skipping dependencies detection for precompiled library Arduino_TensorFlowLite") | ||
} | ||
|
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.