Skip to content
Snippets Groups Projects
Commit 6bf72cc1 authored by zphrs's avatar zphrs
Browse files

added a run_id to allow running many test suites in parallel

parent 1c0c5cd7
No related branches found
No related tags found
No related merge requests found
......@@ -124,6 +124,11 @@ def main():
parser.add_argument(
"--num-threads", type=int, default=1, help="number of threads to run tests in"
)
parser.add_argument(
"--run-id",
default="",
help="Id for this run (prepended to docker containers & networks) (useful for running two versions of the test suite in parallel)",
)
parser.add_argument(
"--port-offset", type=int, default=1000, help="port offset for each test"
)
......@@ -177,7 +182,7 @@ def main():
if args.num_threads == 1:
print("Running tests sequentially")
for test in TEST_SET:
if not run_test(test, gid="0", port_offset=0):
if not run_test(test, gid=f"{args.run_id}0", port_offset=0):
if not args.run_all:
print("--run-all not set, stopping at first failure")
break
......@@ -186,7 +191,7 @@ def main():
pool = ThreadPool(processes=args.num_threads)
pool.map(
lambda a: run_test(
a[1], gid=f"{a[0]}", port_offset=a[0] * args.port_offset
a[1], gid=f"{args.run_id}{a[0]}", port_offset=a[0] * args.port_offset
),
enumerate(TEST_SET),
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment