Skip to content

Commit

Permalink
Show ignored project environments only in the verbose mode // Resolve #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Sep 2, 2020
1 parent 5cc2151 commit 44c2b65
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ PlatformIO Core 5

- Display system-wide information using a new `pio system info <https://docs.platformio.org/page/core/userguide/system/cmd_info.html>`__ command (`issue #3521 <https://github.com/platformio/platformio-core/issues/3521>`_)
- Remove unused data using a new `pio system prune <https://docs.platformio.org/page/core/userguide/system/cmd_prune.html>`__ command (`issue #3522 <https://github.com/platformio/platformio-core/issues/3522>`_)
- Show ignored project environments only in the verbose mode (`issue #3641 <https://github.com/platformio/platformio-core/issues/3641>`_)
- Do not escape compiler arguments in VSCode template on Windows.

.. _release_notes_4:
Expand Down
6 changes: 4 additions & 2 deletions platformio/commands/run/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
34 changes: 20 additions & 14 deletions tests/commands/test_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,19 @@ def test_saving_deps(clirunner, validate_cliresult, isolated_pio_core, tmpdir_fa
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(
Expand All @@ -71,11 +75,13 @@ def test_saving_deps(clirunner, validate_cliresult, isolated_pio_core, tmpdir_fa
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(
Expand Down

0 comments on commit 44c2b65

Please sign in to comment.