From 6bf72cc1f44f2bd657d84606a6ce6ac9523e3607 Mon Sep 17 00:00:00 2001
From: zphrs <z@zephiris.dev>
Date: Sat, 15 Mar 2025 16:21:02 -0700
Subject: [PATCH] added a run_id to allow running many test suites in parallel

---
 __main__.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/__main__.py b/__main__.py
index bd8360a..b4b32de 100755
--- a/__main__.py
+++ b/__main__.py
@@ -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),
         )
-- 
GitLab