Move run-test.py to citus-tests

test-6495
Gokhan Gulbiz 2022-12-05 10:01:16 +03:00
parent 28ad9940ad
commit f058209962
No known key found for this signature in database
GPG Key ID: 608EF06B6BD1B45B
1 changed files with 10 additions and 8 deletions

View File

@ -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)