From f058209962b5608e4ec7cecb64a0e8d6b4a4899f Mon Sep 17 00:00:00 2001 From: Gokhan Gulbiz Date: Mon, 5 Dec 2022 10:01:16 +0300 Subject: [PATCH] Move run-test.py to citus-tests --- .../regress/{bin => citus_tests}/run_test.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) rename src/test/regress/{bin => citus_tests}/run_test.py (90%) diff --git a/src/test/regress/bin/run_test.py b/src/test/regress/citus_tests/run_test.py similarity index 90% rename from src/test/regress/bin/run_test.py rename to src/test/regress/citus_tests/run_test.py index 48f2a14bd..d1f6f46be 100755 --- a/src/test/regress/bin/run_test.py +++ b/src/test/regress/citus_tests/run_test.py @@ -8,6 +8,7 @@ import argparse import shutil import random import re +import common args = argparse.ArgumentParser() args.add_argument("-t", "--test", required=True, help="Relative path for test file (must have a .sql or .spec extension)", type=pathlib.Path) @@ -79,11 +80,12 @@ else: test_command = f"make -C {regress_dir} {make_recipe} SCHEDULE='{pathlib.Path(tmp_schedule_path).stem}'" # run test command n times -for i in range(args['ntimes']): - print(f"Execution#{i}/{args['ntimes']} of {test_command}") - result = os.system(test_command) - if result != 0: - sys.exit(2) - -# remove temp schedule file -os.remove(tmp_schedule_path) +try: + for i in range(args['ntimes']): + print(f"Execution#{i}/{args['ntimes']} of {test_command}") + result = common.run(test_command) + if result != 0: + sys.exit(2) +finally: + # remove temp schedule file + os.remove(tmp_schedule_path)