Skip to content

Commit

Permalink
Merge pull request #428 from DataRecce/feature/drc-648-from-recce-ins…
Browse files Browse the repository at this point in the history
…ight-failed-recce-run-blocks-ci-job

[Feature] Modified recce run return code
  • Loading branch information
wcchang1115 authored Sep 26, 2024
2 parents d9c6794 + 1e780f5 commit 5b12701
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions recce/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def process_failed_checks(failed_checks: List[dict], error_log=None):
if error_log:
with open(error_log, 'w') as f:
f.write(content)
print('The failed checks are stored at [{}]'.format(error_log))
print(f"The failed checks are stored at '{error_log}'")
else:
print(content, file=sys.stderr)

Expand Down Expand Up @@ -235,8 +235,9 @@ async def cli_run(output_state_file: str, **kwargs):
pass
else:
console.rule("Preset checks")
rc, failed_checks = await execute_preset_checks(preset_checks)
if rc != 0 and failed_checks:
_, failed_checks = await execute_preset_checks(preset_checks)
if failed_checks:
console.print("[[yellow]Warning[/yellow]] Preset checks failed. Please see the failed reason.")
process_failed_checks(failed_checks, error_log)
else:
state_checks = ctx.state_loader.state.checks
Expand All @@ -245,8 +246,9 @@ async def cli_run(output_state_file: str, **kwargs):
pass
else:
console.rule("Checks")
rc, failed_checks = await execute_state_checks(state_checks)
if rc != 0 and failed_checks:
_, failed_checks = await execute_state_checks(state_checks)
if failed_checks:
console.print("[[yellow]Warning[/yellow]] Checks failed. Please see the failed reason.")
process_failed_checks(failed_checks, error_log)

from recce.event import log_load_state
Expand Down

0 comments on commit 5b12701

Please sign in to comment.