Skip to content

Commit

Permalink
Exit 1 on syntax test error
Browse files Browse the repository at this point in the history
So the CI task fails.
  • Loading branch information
victor-gp committed Dec 7, 2022
1 parent 2006270 commit 9b25682
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ concurrency:
cancel-in-progress: true

jobs:
#fixme: it seems like syntax tests always pass?
syntax_tests:
name: Syntax tests
runs-on: "ubuntu-latest"
Expand Down
12 changes: 7 additions & 5 deletions tests/syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@
signal_lines = [line for line in output.splitlines() if line != noise_line]

last_line = signal_lines[-1]
if last_line == "exiting with code 0":
# colorize last line in green
success = last_line == "exiting with code 0"

if success: # colorize last line in green
signal_lines[-1] = f"\033[32m{last_line}\033[00m"
else:
# colorize last line in red
else: # colorize last line in red
signal_lines[-1] = f"\033[31m{last_line}\033[00m"

print("\n".join(signal_lines))

if not success:
exit(1)

0 comments on commit 9b25682

Please sign in to comment.