Skip to content

Commit

Permalink
feat: added --verbose flag to pass -vv to spread from charmcraft test
Browse files Browse the repository at this point in the history
  • Loading branch information
Pietro Pasotti committed Nov 13, 2024
1 parent 02539ab commit 53b9019
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions charmcraft/application/commands/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@


class TestCommand(base.CharmcraftCommand):
"""Initialize a directory to be a charm project."""
"""Run charm tests with spread."""

name = "test"
help_msg = "Execute charm test suites"
help_msg = "Execute charm test suites with spread"
overview = _overview
common = True

Expand Down Expand Up @@ -67,6 +67,12 @@ def fill_parser(self, parser: argparse.ArgumentParser) -> None:
help="Just show the list of jobs that would run.",
)

parser.add_argument(
"--verbose",
action="store_true",
help="Run spread in verbose mode.",
)

parser.add_argument(
"spread_tasks",
metavar="tasks",
Expand All @@ -84,6 +90,9 @@ def run(self, parsed_args: argparse.Namespace):
else:
cmd = ["spread"]

if vars(parsed_args).get("verbose"):
cmd.append("-vv")

for arg in ("shell", "shell-after", "debug", "list"):
if vars(parsed_args).get(arg):
cmd.append("-" + arg)
Expand Down

0 comments on commit 53b9019

Please sign in to comment.