fix: keep async idle benchmark artifacts in scratch#683
Conversation
Greptile SummaryThis PR moves the default output directories for the async idle benchmark scripts into
|
| Filename | Overview |
|---|---|
| scripts/benchmarks/generate_async_scheduling_idle_report.py | Redirects default output paths to .scratch/ and fixes _relative_href to use os.path.relpath instead of hardcoded ../ prefix. |
| scripts/benchmarks/run_async_scheduling_idle_regression.py | Mirrors the default path change from generate_async_scheduling_idle_report.py, redirecting output to .scratch/async-scheduling-idle-regression/. |
| packages/data-designer-engine/tests/engine/test_async_scheduling_benchmark.py | Adds two regression tests: one asserting default paths are under .scratch/, and one asserting _relative_href computes correct relative paths in sibling and parent-directory cases. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Script invoked] --> B{artifact_dir / report_path\nprovided via CLI?}
B -- Yes --> C[Use supplied paths]
B -- No --> D[Use DEFAULT_ARTIFACT_DIR\nDEFAULT_REPORT_PATH]
D --> E[.scratch/async-scheduling-idle-*/artifacts\n.scratch/async-scheduling-idle-*.html]
C --> F[_relative_href\nreport_path x target_path]
E --> F
F --> G{target_path\nabsolute?}
G -- Yes --> H[target_path.as_uri]
G -- No --> I[os.path.relpath\ntarget_path, start=report_path.parent]
I --> J[Path.as_posix - relative href in HTML]
H --> J
Reviews (1): Last reviewed commit: "fix: keep async idle benchmark artifacts..." | Re-trigger Greptile
Summary
.scratch/pathsWhy
The idle benchmark scripts previously wrote generated artifacts and reports into tracked repository paths by default. Running the documented smoke flow could leave an untracked worktree.
Validation
.venv/bin/pytest packages/data-designer-engine/tests/engine/test_async_scheduling_benchmark.py.venv/bin/ruff check --fix ..venv/bin/ruff format .