Skip to content

Commit

Permalink
[QA] Check command-line arguments for test runner
Browse files Browse the repository at this point in the history
Before this change, if you made a typo such as `-parellel-8` when trying to run
tests, you'd get a backtrace that's difficult to interpret. With this change,
you'll get a better error message and a non-zero exit code.
  • Loading branch information
chromatic committed Feb 18, 2024
1 parent ad6a62b commit 17e899d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions qa/pull-tester/rpc-tests.py
Expand Up @@ -222,6 +222,10 @@ def runtests():
if t in opts or re.sub(".py$", "", t) in opts:
test_list.append(t)

if len(test_list) == 0:
print(f"No tests selected; do you have a typo in {opts}?")
sys.exit(1)

if print_help:
# Only print help of the first script and exit
subprocess.check_call((RPC_TESTS_DIR + test_list[0]).split() + ['-h'])
Expand Down

0 comments on commit 17e899d

Please sign in to comment.