Skip to content

Commit 036dcef

Browse files
committed
Record the variables a run depends on in result.json
1 parent ef8d26c commit 036dcef

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎9pm.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,8 @@ def write_json_result(data, agent_prompt=None):
492492
'9pm_version': ninepm_sha[:10] if ninepm_sha else 'unknown',
493493
'log_dir': LOGDIR,
494494
'scratch_dir': SCRATCHDIR,
495-
'root_path': ROOT_PATH
495+
'root_path': ROOT_PATH,
496+
'variables': run_variables()
496497
}
497498
},
498499
'summary': summary,
@@ -507,6 +508,11 @@ def write_json_result(data, agent_prompt=None):
507508

508509
return json_path
509510

511+
def run_variables():
512+
"""Environment variables needed to repeat the run"""
513+
names = ('PYTHONHASHSEED',)
514+
return {name: os.environ[name] for name in names if name in os.environ}
515+
510516
def print_result_tree(data, base):
511517
i = 1
512518
llen = len(data['suite'])

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ o Execution
129129

130130
Every test run generates a comprehensive `result.json` file containing:
131131
- Test metadata and timestamps
132+
- Variables needed to repeat the run, e.g. `PYTHONHASHSEED`
132133
- Complete hierarchical test structure
133134
- Embedded test output logs
134135
- Summary statistics

0 commit comments

Comments
 (0)