show completed tests on calendar
This commit is contained in:
+7
-9
@@ -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()
|
||||
|
||||
@@ -473,14 +473,12 @@ def get_schedule_week(start: str | None = None, version: int | None = None) -> d
|
||||
raise HTTPException(status_code=404, detail=f"Schedule version {version} was not found")
|
||||
|
||||
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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user