Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Werni2A committed Jul 13, 2024
1 parent 656f1b6 commit 62b6667
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@


class TestThread(threading.Thread):
def __init__(self, shard_count: int, shard_index: int):
def __init__(self, test_file: Path, shard_count: int, shard_index: int):
threading.Thread.__init__(self)
self.shard_count = shard_count
self.shard_index = shard_index
self.test_file = test_file

def run(self):
global tests_ran_successfully
Expand All @@ -49,9 +50,16 @@ def run(self):
print(f"Starting shard {self.shard_index + 1} / {self.shard_count}")
lock.release()

cmd = [
str(self.test_file),
"--shard-count",
str(self.shard_count),
"--shard-index",
str(self.shard_index),
]

result = subprocess.run(
f"{test_file} --shard-count {self.shard_count} --shard-index {self.shard_index}",
shell=True,
cmd,
capture_output=True,
text=True,
)
Expand Down Expand Up @@ -84,7 +92,7 @@ def run(self):

TEST_SHARDS = 8
for idx in range(TEST_SHARDS):
threads += [TestThread(TEST_SHARDS, idx)]
threads += [TestThread(test_file, TEST_SHARDS, idx)]

start_time = datetime.now()

Expand Down

0 comments on commit 62b6667

Please sign in to comment.