[Jamie] Fix stale test fixture: consolidated-run mock should use runType "consolidated" - #5206
Open
pitoi wants to merge 3 commits into
Open
[Jamie] Fix stale test fixture: consolidated-run mock should use runType "consolidated"#5206pitoi wants to merge 3 commits into
pitoi wants to merge 3 commits into
Conversation
…ype "consolidated" ## Problem PR #5204 ("Stop Consolidated Report runs from appearing in the Legal Benchmarks Runs tab") renamed the `runType` tag used for `LEGAL_BENCHMARK_CONSOLIDATED` rows from `"recursion"` to a new distinct `"consolidated"` value, and updated `RecursionBox.tsx`'s `existingConsolidated` lookup to match on `runType === "consolidated"`. The unit test fixture `makeConsolidatedRow` in `src/__tests__/unit/components/RecursionBox.test.tsx` was not updated and still hardcodes `runType: "recursion" as const`, so it no longer matches the component's filter. This makes `existingConsolidated` resolve to `null` for the fixture, which fails the test `"detects a PENDING in-flight consolidated run via the allRuns prop"` (assertion on `getByTestId("consolidated-generating")` at line ~1007) — currently blocking PR #5204's `unit-tests` CI check. ## Fix Update `makeConsolidatedRow`'s `runType` field from `"recursion"` to `"consolidated"` so the fixture matches the renamed tag the component now checks for. No other test logic or assertions change. ## Scope Single test file, one field value. This targets the same branch/PR as #5204 (branch `swarm/swarm-change-dd464ee9`) to unblock its failing CI check.
pitoi
added a commit
that referenced
this pull request
Aug 31, 2026
…chmarks Runs tab (complete fix) (#5209) ## Problem The Legal Benchmarks "Runs" tab for a task shows `LEGAL_BENCHMARK_CONSOLIDATED` runs (cross-run Consolidated Report comparisons, a separate Stakwork workflow/ID) mixed in with the task's actual `LEGAL_BENCHMARK_RUNNER` runs (workflow 57179). ## Root cause `src/hooks/useLegalBenchmarkRunList.ts` tags fetched Consolidated Report rows with the same `"recursion"` `runType` used for genuine eval/recursion rows. A code comment claims this tag keeps them "invisible" in the Runs tab table, but `src/components/legal/BenchmarkRunsHistory.tsx`'s `secondaryRows` filter is a deny-list (`runType !== "manual"`) that does not actually exclude `"recursion"`-tagged rows — so Consolidated rows render there. ## Fix (single, complete change — supersedes two abandoned prior attempts, PR #5204 and #5206, which split this across mismatched branches) 1. `src/hooks/useLegalBenchmarkRunList.ts`: add a new `"consolidated"` value to the `BenchmarkRunType` union; tag `rawConsolidatedRows` with `"consolidated"` instead of `"recursion"` when merging. Keep fetching/merging them (still needed for the Recursion tab's Pusher-driven live status after a page refresh). 2. `src/components/legal/RecursionBox.tsx`: update `existingConsolidated`'s filter to match the new `runType === "consolidated"` tag (instead of `"recursion"`), so the Recursion tab's own in-flight-consolidated-run lookup keeps working correctly with the renamed tag. 3. `src/components/legal/BenchmarkRunsHistory.tsx`: change `secondaryRows`'s filter from a deny-list (`runType !== "manual"`) to an explicit allow-list (`runType === "recursion"`), so only genuine eval/recursion rows land in the table; the new `"consolidated"` tag is excluded by construction. 4. `src/__tests__/unit/components/RecursionBox.test.tsx`: update the `makeConsolidatedRow` test fixture's `runType` field from `"recursion"` to `"consolidated"` to match the renamed tag, so the existing "detects a PENDING in-flight consolidated run via the allRuns prop" test continues to pass against the new logic. ## Scope Client-side/UI + test-fixture only — no API route, Prisma schema, or dispatch/webhook changes. All four edits land together in this one PR/branch, avoiding the split-branch mismatch that broke the two earlier attempts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PR #5204 ("Stop Consolidated Report runs from appearing in the Legal Benchmarks Runs tab") renamed the
runTypetag used forLEGAL_BENCHMARK_CONSOLIDATEDrows from"recursion"to a new distinct"consolidated"value, and updatedRecursionBox.tsx'sexistingConsolidatedlookup to match onrunType === "consolidated".The unit test fixture
makeConsolidatedRowinsrc/__tests__/unit/components/RecursionBox.test.tsxwas not updated and still hardcodesrunType: "recursion" as const, so it no longer matches the component's filter. This makesexistingConsolidatedresolve tonullfor the fixture, which fails the test"detects a PENDING in-flight consolidated run via the allRuns prop"(assertion ongetByTestId("consolidated-generating")at line ~1007) — currently blocking PR #5204'sunit-testsCI check.Fix
Update
makeConsolidatedRow'srunTypefield from"recursion"to"consolidated"so the fixture matches the renamed tag the component now checks for. No other test logic or assertions change.Scope
Single test file, one field value. This targets the same branch/PR as #5204 (branch
swarm/swarm-change-dd464ee9) to unblock its failing CI check.