fixed top priority tests and start with correct device

This commit is contained in:
2026-07-27 14:52:39 -04:00
parent d4b974617c
commit 0e7f55ed8b
3 changed files with 14 additions and 15 deletions
+2 -11
View File
@@ -428,22 +428,13 @@ def compile_schedule_endpoint(request: CompileScheduleRequest) -> dict[str, Any]
ref_top_priority_ids = {item.strip() for item in request.top_priority_tests_ref if item.strip()}
status_lookup = {(test.test_id, test.device): test.status for test in stored_tests}
# Backward compatibility: if only legacy top_priority_tests was sent,
# keep previous behavior by applying IDs to whichever device has that test.
if not dut_top_priority_ids and not ref_top_priority_ids and request.top_priority_tests:
for test_id in {item.strip() for item in request.top_priority_tests if item.strip()}:
if any(t.test_id == test_id and t.device == DUT for t in stored_tests):
dut_top_priority_ids.add(test_id)
if any(t.test_id == test_id and t.device == REF for t in stored_tests):
ref_top_priority_ids.add(test_id)
for test_id in dut_top_priority_ids:
if any(t.test_id == test_id and t.device == DUT for t in stored_tests):
top_priority_pairs.add((DUT, test_id))
top_priority_pairs.add((test_id, DUT))
for test_id in ref_top_priority_ids:
if any(t.test_id == test_id and t.device == REF for t in stored_tests):
top_priority_pairs.add((REF, test_id))
top_priority_pairs.add((test_id, REF))
scheduler = Scheduler(
all_tests=all_tests,