Skip to content

Commit

Permalink
[core][fix] Render empty sections (#2131)
Browse files Browse the repository at this point in the history
  • Loading branch information
aquamatthias authored Jul 3, 2024
1 parent a2cd15f commit 9e329d4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion fixcore/fixcore/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5087,7 +5087,7 @@ def name(self) -> str:
return "report"

def args_info(self) -> ArgsInfo:
run_args = [
load_args = [
ArgInfo("--accounts", True, help_text="Space delimited list of accounts"),
ArgInfo(
"--severity",
Expand All @@ -5097,6 +5097,8 @@ def args_info(self) -> ArgsInfo:
),
ArgInfo("--only-failing", False, help_text="Filter only failing checks."),
ArgInfo("--only-check-results", False, help_text="Only dump results."),
]
run_args = load_args + [
ArgInfo("--sync-security-section", False, help_text="Sync security section."),
ArgInfo("--run-id", False, help_text="Identifier for this specific run."),
]
Expand All @@ -5105,6 +5107,7 @@ def args_info(self) -> ArgsInfo:
"list": [],
"run": [ArgInfo(None, help_text="<benchmark-id>"), *run_args],
"show": [ArgInfo(None, help_text="<benchmark-id>")],
"load": [ArgInfo(None, help_text="<benchmark-id>"), *load_args],
},
"checks": {
"list": [],
Expand Down
1 change: 0 additions & 1 deletion fixcore/fixcore/report/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ def filter_result(
c.filter_result(filter_failed, failed_for_account)
for c in self.children
if (not filter_failed or c.has_failed())
and (c.checks or c.children)
and (failed_for_account is None or c.has_failed_for_account(failed_for_account))
],
)
Expand Down
2 changes: 1 addition & 1 deletion fixcore/tests/fixcore/cli/command_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ async def execute(cmd: str, _: Type[T]) -> List[T]:
# execute the test benchmark
assert len((await execute("report benchmark run test --sync-security-section | dump", Json))) == 9
assert len((await execute("report benchmark run test --only-failing | dump", Json))) == 9
assert len((await execute("report benchmark run test --severity critical | dump", Json))) == 5
assert len((await execute("report benchmark run test --severity critical | dump", Json))) == 7
# load the benchmark from the last sync
assert len((await execute("report benchmark load test | dump", Json))) == 9
# list failing resources for a specific check
Expand Down

0 comments on commit 9e329d4

Please sign in to comment.