chore(scripts): relocate Tier 2 state paths to project-relative
Honor the user's NEVER USE APPDATA directive. The Tier 2 state and failure report directories now default to project-relative gitignored locations under tests/artifacts/ instead of C:\\Users\\Ed\\AppData\\. - failcount.py: _state_dir() now defaults to tests/artifacts/tier2_state/<track>/ (gitignored) - write_report.py: _failures_dir() now defaults to tests/artifacts/tier2_failures/ (gitignored) The TIER2_STATE_DIR and TIER2_FAILURES_DIR env vars still override the defaults when set (preserves the existing escape hatch).
This commit is contained in:
@@ -114,11 +114,11 @@ def from_dict(d: dict[str, Any]) -> FailcountState:
|
||||
|
||||
|
||||
def _state_dir(track_name: str) -> Path:
|
||||
base = os.environ.get(
|
||||
"TIER2_STATE_DIR",
|
||||
r"C:\Users\Ed\AppData\Local\manual_slop\tier2",
|
||||
)
|
||||
return Path(base) / track_name
|
||||
env_base = os.environ.get("TIER2_STATE_DIR")
|
||||
if env_base:
|
||||
return Path(env_base) / track_name
|
||||
project_root = Path(__file__).resolve().parents[2]
|
||||
return project_root / "tests" / "artifacts" / "tier2_state" / track_name
|
||||
|
||||
|
||||
def load_state(track_name: str) -> FailcountState:
|
||||
|
||||
@@ -16,10 +16,11 @@ from scripts.tier2.failcount import FailcountState
|
||||
|
||||
|
||||
def _failures_dir() -> Path:
|
||||
return Path(os.environ.get(
|
||||
"TIER2_FAILURES_DIR",
|
||||
r"C:\Users\Ed\AppData\Local\manual_slop\tier2_failures",
|
||||
))
|
||||
env_base = os.environ.get("TIER2_FAILURES_DIR")
|
||||
if env_base:
|
||||
return Path(env_base)
|
||||
project_root = Path(__file__).resolve().parents[2]
|
||||
return project_root / "tests" / "artifacts" / "tier2_failures"
|
||||
|
||||
|
||||
def compute_report_path(track_name: str, now: datetime) -> Path:
|
||||
|
||||
Reference in New Issue
Block a user