Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
narrieta committed Jul 28, 2023
1 parent aa6ff62 commit 1d00e13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions tests_e2e/tests/lib/remote_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env pypy3

# Microsoft Azure Linux Agent
#
Expand Down Expand Up @@ -28,14 +28,19 @@


def run_remote_test(test_method: Callable[[], int]) -> None:
"""
Helper function to run a remote test; implements coding conventions for remote tests, e.g. error message goes
to stderr, test log goes to stdout, etc.
"""
try:
test_method()
log.error("*** PASSED")
log.info("*** PASSED")
except AssertionError as e:
print(f"{e}", file=sys.stderr)
log.error("%s", e)
sys.exit(FAIL_EXIT_CODE)
except Exception as e:
print(f"UNEXPECTED ERROR: {e}", file=sys.stderr)
log.exception("*** UNEXPECTED ERROR")
sys.exit(ERROR_EXIT_CODE)

Expand Down
2 changes: 1 addition & 1 deletion tests_e2e/tests/scripts/samples-pass_remote_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#

#
# A sample remote test that simulates an unexpected error
# A sample remote test that passes
#

from tests_e2e.tests.lib.logging import log
Expand Down

0 comments on commit 1d00e13

Please sign in to comment.