Skip to content

Commit 6756cda

Browse files
committed
Prepend env vars for single node, single process executions
1 parent 415b2c7 commit 6756cda

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tools/scripts/test_runner/lib/test_executor.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,20 +445,24 @@ def run_test(self, test_config, suite_config):
445445

446446
# Build command based on test type
447447
if num_ranks == 1:
448-
# Non-MPI test
448+
# Non-MPI test - prepend environment variables to the command
449+
env_prefix = ""
450+
for key, value in merged_env.items():
451+
env_prefix += f"{key}={value} "
452+
449453
if is_gtest:
450454
# GTest-based test - use --gtest_filter syntax
451455
if test_filter == "ALL" or test_filter == "*":
452-
cmd = f"./{binary}"
456+
cmd = f"{env_prefix}./{binary}"
453457
else:
454-
cmd = f"./{binary} --gtest_filter={test_filter}"
458+
cmd = f"{env_prefix}./{binary} --gtest_filter={test_filter}"
455459

456460
# Add custom arguments if provided
457461
if custom_args:
458462
cmd += f" {custom_args}"
459463
else:
460464
# Non-gtest test (perf, custom, etc.) - run binary with args
461-
cmd = f"./{binary}"
465+
cmd = f"{env_prefix}./{binary}"
462466
if custom_args:
463467
cmd += f" {custom_args}"
464468

0 commit comments

Comments
 (0)