Fix packaged project archive command
This commit is contained in:
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import importlib.util
|
import importlib.util
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
@@ -132,6 +133,21 @@ def test_cleanup_script_is_packaged_and_readiness_checked() -> None:
|
|||||||
assert "py_compile scripts/archive_technical_projects.py" in readiness
|
assert "py_compile scripts/archive_technical_projects.py" in readiness
|
||||||
|
|
||||||
|
|
||||||
|
def test_cleanup_script_can_start_as_a_direct_operator_command() -> None:
|
||||||
|
result = subprocess.run(
|
||||||
|
[sys.executable, str(ROOT / "scripts/archive_technical_projects.py"), "--help"],
|
||||||
|
cwd=ROOT,
|
||||||
|
capture_output=True,
|
||||||
|
check=False,
|
||||||
|
text=True,
|
||||||
|
timeout=20,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert result.returncode == 0, result.stderr
|
||||||
|
assert "--apply" in result.stdout
|
||||||
|
assert "--show-names" in result.stdout
|
||||||
|
|
||||||
|
|
||||||
def test_frontend_lifecycle_and_component_boundaries_are_wired() -> None:
|
def test_frontend_lifecycle_and_component_boundaries_are_wired() -> None:
|
||||||
app_source = (ROOT / "frontend/src/App.tsx").read_text(encoding="utf-8")
|
app_source = (ROOT / "frontend/src/App.tsx").read_text(encoding="utf-8")
|
||||||
project_panel = (ROOT / "frontend/src/components/project/ProjectPanel.tsx").read_text(encoding="utf-8")
|
project_panel = (ROOT / "frontend/src/components/project/ProjectPanel.tsx").read_text(encoding="utf-8")
|
||||||
|
|||||||
@@ -2,12 +2,21 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
|
from pathlib import Path
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
|
|
||||||
|
# Direct execution from /app/scripts must resolve the repository's backend
|
||||||
|
# package before similarly named installed packages.
|
||||||
|
ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
BACKEND_ROOT = ROOT / "backend" if (ROOT / "backend" / "app").is_dir() else ROOT
|
||||||
|
if str(BACKEND_ROOT) not in sys.path:
|
||||||
|
sys.path.insert(0, str(BACKEND_ROOT))
|
||||||
|
|
||||||
from app.db.session import SessionLocal
|
from app.db.session import SessionLocal
|
||||||
from app.models import Project
|
from app.models import Project
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user