Skip to content

[Jamie] Fix stale test fixture: consolidated-run mock should use runType "consolidated" - #5206

Open
pitoi wants to merge 3 commits into
masterfrom
swarm/swarm-change-338d2003
Open

[Jamie] Fix stale test fixture: consolidated-run mock should use runType "consolidated"#5206
pitoi wants to merge 3 commits into
masterfrom
swarm/swarm-change-338d2003

Conversation

@pitoi

@pitoi pitoi commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

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.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jamie Automated PR opened by Jamie

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants