diff --git a/backend/app.py b/backend/app.py index 9a25ca3..d8944a1 100644 --- a/backend/app.py +++ b/backend/app.py @@ -439,11 +439,11 @@ def compile_schedule_endpoint(request: CompileScheduleRequest) -> dict[str, Any] 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((test_id, DUT)) + top_priority_pairs.add((DUT, test_id)) 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((test_id, REF)) + top_priority_pairs.add((REF, test_id)) scheduler = Scheduler( all_tests=all_tests, diff --git a/backend/test_bundle.py b/backend/test_bundle.py index 0309883..82f1b6b 100644 --- a/backend/test_bundle.py +++ b/backend/test_bundle.py @@ -91,7 +91,7 @@ def build_test_bundles(active_dut: dict[str, Test], active_ref: dict[str, Test], priority = BUNDLE_PRIORITY_USER_TOP # Check if any of the DUT tests in this bundle are reruns - if any((dut_test.status == "rerun" for dut_test_id in dut_bundled_tests if (dut_test := active_dut.get(dut_test_id)))): + elif any((dut_test.status == "rerun" for dut_test_id in dut_bundled_tests if (dut_test := active_dut.get(dut_test_id)))): priority = BUNDLE_PRIORITY_RERUN test_bundles.append( @@ -111,7 +111,7 @@ def build_test_bundles(active_dut: dict[str, Test], active_ref: dict[str, Test], if any((REF, ref_test_id) in top_priority_tests for ref_test_id in ref_bundled_tests): priority = BUNDLE_PRIORITY_USER_TOP # Check if any of the REF tests in this bundle are reruns - if any((ref_test.status == "rerun" for ref_test_id in ref_bundled_tests if (ref_test := active_ref.get(ref_test_id)))): + elif any((ref_test.status == "rerun" for ref_test_id in ref_bundled_tests if (ref_test := active_ref.get(ref_test_id)))): priority = BUNDLE_PRIORITY_RERUN test_bundles.append( @@ -141,7 +141,7 @@ def build_test_bundles(active_dut: dict[str, Test], active_ref: dict[str, Test], priority = BUNDLE_PRIORITY_USER_TOP # Check if any of the DUT tests in this bundle are reruns - if any((dut_test.status == "rerun" for dut_test_id in dut_bundled_tests if (dut_test := active_dut.get(dut_test_id)))): + elif any((dut_test.status == "rerun" for dut_test_id in dut_bundled_tests if (dut_test := active_dut.get(dut_test_id)))): priority = BUNDLE_PRIORITY_RERUN test_bundles.append( @@ -158,7 +158,7 @@ def build_test_bundles(active_dut: dict[str, Test], active_ref: dict[str, Test], if any((REF, ref_test_id) in top_priority_tests for ref_test_id in ref_bundled_tests): priority = BUNDLE_PRIORITY_USER_TOP # Check if any of the REF tests in this bundle are reruns - if any((ref_test.status == "rerun" for ref_test_id in ref_bundled_tests if (ref_test := active_ref.get(ref_test_id)))): + elif any((ref_test.status == "rerun" for ref_test_id in ref_bundled_tests if (ref_test := active_ref.get(ref_test_id)))): priority = BUNDLE_PRIORITY_RERUN if ref_bundled_tests: