From 44c2b65372804866fa1946a4b6fb784d86c32cb6 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 2 Sep 2020 17:31:32 +0300 Subject: [PATCH] Show ignored project environments only in the verbose mode // Resolve #3641 --- HISTORY.rst | 1 + platformio/commands/run/command.py | 6 ++++-- tests/commands/test_lib.py | 34 ++++++++++++++++++------------ 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 6148e40f..286890f9 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -90,6 +90,7 @@ PlatformIO Core 5 - Display system-wide information using a new `pio system info `__ command (`issue #3521 `_) - Remove unused data using a new `pio system prune `__ command (`issue #3522 `_) + - Show ignored project environments only in the verbose mode (`issue #3641 `_) - Do not escape compiler arguments in VSCode template on Windows. .. _release_notes_4: diff --git a/platformio/commands/run/command.py b/platformio/commands/run/command.py index 00e129af..db4b4121 100644 --- a/platformio/commands/run/command.py +++ b/platformio/commands/run/command.py @@ -147,7 +147,7 @@ def cli( command_failed = any(r.get("succeeded") is False for r in results) if not is_test_running and (command_failed or not silent) and len(results) > 1: - print_processing_summary(results) + print_processing_summary(results, verbose) if command_failed: raise exception.ReturnErrorCode(1) @@ -220,7 +220,7 @@ def print_processing_footer(result): ) -def print_processing_summary(results): +def print_processing_summary(results, verbose=False): tabular_data = [] succeeded_nums = 0 failed_nums = 0 @@ -232,6 +232,8 @@ def print_processing_summary(results): failed_nums += 1 status_str = click.style("FAILED", fg="red") elif result.get("succeeded") is None: + if not verbose: + continue status_str = "IGNORED" else: succeeded_nums += 1 diff --git a/tests/commands/test_lib.py b/tests/commands/test_lib.py index b077f63b..b2541841 100644 --- a/tests/commands/test_lib.py +++ b/tests/commands/test_lib.py @@ -51,15 +51,19 @@ lib_deps = validate_cliresult(result) aj_pkg_data = regclient.get_package(PackageType.LIBRARY, "bblanchon", "ArduinoJson") config = ProjectConfig(os.path.join(str(project_dir), "platformio.ini")) - assert config.get("env:one", "lib_deps") == [ - "bblanchon/ArduinoJson@^%s" % aj_pkg_data["version"]["name"], - "knolleary/PubSubClient@~2.7", - ] - assert config.get("env:two", "lib_deps") == [ - "CustomLib", - "bblanchon/ArduinoJson@^%s" % aj_pkg_data["version"]["name"], - "knolleary/PubSubClient@~2.7", - ] + assert sorted(config.get("env:one", "lib_deps")) == sorted( + [ + "bblanchon/ArduinoJson@^%s" % aj_pkg_data["version"]["name"], + "knolleary/PubSubClient@~2.7", + ] + ) + assert sorted(config.get("env:two", "lib_deps")) == sorted( + [ + "CustomLib", + "bblanchon/ArduinoJson@^%s" % aj_pkg_data["version"]["name"], + "knolleary/PubSubClient@~2.7", + ] + ) # ensure "build" version without NPM spec result = clirunner.invoke( @@ -71,11 +75,13 @@ lib_deps = PackageType.LIBRARY, "mbed-sam-grove", "LinkedList" ) config = ProjectConfig(os.path.join(str(project_dir), "platformio.ini")) - assert config.get("env:one", "lib_deps") == [ - "bblanchon/ArduinoJson@^%s" % aj_pkg_data["version"]["name"], - "knolleary/PubSubClient@~2.7", - "mbed-sam-grove/LinkedList@%s" % ll_pkg_data["version"]["name"], - ] + assert sorted(config.get("env:one", "lib_deps")) == sorted( + [ + "bblanchon/ArduinoJson@^%s" % aj_pkg_data["version"]["name"], + "knolleary/PubSubClient@~2.7", + "mbed-sam-grove/LinkedList@%s" % ll_pkg_data["version"]["name"], + ] + ) # check external package via Git repo result = clirunner.invoke(