show completed tests on calendar

This commit is contained in:
2026-07-15 14:56:40 -04:00
parent 0646daf235
commit 195d2b01ff
4 changed files with 15 additions and 12 deletions
+6 -8
View File
@@ -22,7 +22,7 @@ from watcher import configure_result_watcher, stop_result_watcher
APP_ROOT = Path(__file__).resolve().parent
DB_PATH = APP_ROOT / "scheduler.db"
DB_PATH = Path(os.getenv("DB_PATH", str(APP_ROOT / "scheduler.db")))
DUT = os.getenv("DUT", "CGW453").strip()
REF = os.getenv("REF", "CGW452").strip()
@@ -474,13 +474,11 @@ def get_schedule_week(start: str | None = None, version: int | None = None) -> d
rows = db.get_schedule_week(week_start, selected_version, DB_PATH)
# Log completed tests on the current schedule
completed_count = sum(1 for row in rows if row.status == 'completed')
if completed_count > 0:
print(f"[api] /schedule/week: {completed_count} test(s) marked as completed on calendar")
for row in rows:
if row.status == 'completed':
print(f" - {row.test_id} on {row.device} (scheduled {row.scheduled_date})")
completed_rows = [row for row in rows if str(row.status).strip().lower() == "completed"]
rerun_rows = [row for row in rows if str(row.status).strip().lower() == "rerun"]
print(
f"[api] /schedule/week: completed={len(completed_rows)} rerun_required={len(rerun_rows)}"
)
all_rows = db.get_schedule_rows(selected_version, DB_PATH)
completion_date = max((row.scheduled_date for row in all_rows), default=None)
+4 -1
View File
@@ -203,7 +203,10 @@ def upsert_tests(records: list[TestRecord], db_path: str | Path = DB_PATH) -> in
victim_band = excluded.victim_band,
throttled = excluded.throttled,
estimated_minutes = excluded.estimated_minutes,
status = excluded.status,
status = CASE
WHEN tests.status IN ('completed', 'rerun') THEN tests.status
ELSE excluded.status
END,
excluded = excluded.excluded,
raw_payload = excluded.raw_payload,
station_testpoint_map = excluded.station_testpoint_map,
+2 -1
View File
@@ -7,9 +7,10 @@ services:
environment:
HOST_BROWSE_ROOT: ${HOST_BROWSE_ROOT}
HOST_MOUNT_ROOT: /host
DB_PATH: /app/runtime/scheduler.db
volumes:
- ${HOST_BROWSE_ROOT}:/host
- scheduler-db:/app
- scheduler-db:/app/runtime
expose:
- "8000"
restart: unless-stopped
+2 -1
View File
@@ -47,7 +47,8 @@ function formatConfig(config) {
}
export default function TestCard({ test }) {
const style = STATUS_STYLES[test.status] ?? STATUS_STYLES.pending
const normalizedStatus = String(test?.status ?? 'pending').trim().toLowerCase()
const style = STATUS_STYLES[normalizedStatus] ?? STATUS_STYLES.pending
const deviceAccentClass = getDeviceAccentClass(test.device)
const cardRef = useRef(null)
const [tooltipPos, setTooltipPos] = useState({ top: '0px', left: '0px' })