TestRunFolder
Test run folder organization.
Creates and manages the output folder structure for test runs.
Classes
- class TestRunFolder
Manages the folder structure for a test run.
- Structure:
test_runs/2026-01-24_143025_algorithms/ ├── metadata.json # Run config, summary ├── results.json # Test results ├── metrics.json # Performance metrics ├── manual_actions.jsonl # Recorded manual testing ├── screenshots/ │ ├── manifest.json # Screenshot descriptions │ └── *.png # Captured screenshots └── logs/
├── test_run.log # Test execution log └── slicer_session.log # Copy of Slicer log
Methods:
- __init__()
Initialize test run folder.
- create()
Create a new test run folder with timestamp.
- path()
Path to the test run folder.
- screenshots_folder()
Path to screenshots subfolder.
- logs_folder()
Path to logs subfolder.
- save_metadata()
Save test run metadata.
- save_results()
Save test results to JSON.
- save_screenshot_manifest()
Save screenshot manifest.
- copy_slicer_log()
Copy Slicer session log to test run folder.
- append_manual_action()
Append a manual action to the actions log.
Functions
- create()
Create a new test run folder with timestamp.
- Args:
base_path: Base directory for test runs. run_name: Name of the test run (e.g., “algorithms”, “ui”).
- Returns:
New TestRunFolder instance.
- path()
Path to the test run folder.
- screenshots_folder()
Path to screenshots subfolder.
- logs_folder()
Path to logs subfolder.
- save_metadata()
Save test run metadata.
- Args:
metadata: Metadata dictionary to save.
- save_results()
Save test results to JSON.
- Args:
results: List of TestResult objects.
- save_screenshot_manifest()
Save screenshot manifest.
- Args:
screenshots: List of screenshot info dictionaries.
- copy_slicer_log()
Copy Slicer session log to test run folder.
- Returns:
Path to copied log file, or None if not found.
- append_manual_action()
Append a manual action to the actions log.
- Args:
action: Action dictionary with type, timestamp, and details.