Skip to content

[CI] test: avoid loading the full Store for renderer fixture builders - #26217

Merged
nwparker merged 1 commit into
mainfrom
nwparker/renderer-session-fixture-leaves-clock-fixed
Oct 7, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/renderer-session-fixture-leaves-clock-fixed

Conversation

@nwparker

@nwparker nwparker commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Tests that only need a sample tab or worktree now load those builders directly, avoiding the full application Store and its dependencies. The existing Store tests still construct the real Store.

What Changed

Move five tab/editor builders into the existing session fixture module, reuse the existing worktree builder, and expose the same constants and functions through the original module. Update 29 test imports. Preserve original test cases, assertions, constructors, cleanup, and builder defaults.

Why

Many small tests were loading the application Store just to construct plain sample data. Reusing existing fixture modules reduces repeated imports while preserving isolation and real runtime contracts.

Measured whole pnpm test command, four workers, transform cache disabled, four existing renderer files / 39 original cases:

Before After Improvement
Mean of three counted runs 3.6333 s 2.5102 s 30.91% less time; 1.45× speed
Run 1 4.0509 s 2.5189 s 37.82% less time
Run 2 3.4427 s 2.5162 s 26.91% less time
Run 3 3.4063 s 2.4955 s 26.74% less time

All six timing attempts qualified; none excluded. First runs counted. This is a selected-cohort result, not a full-suite or historical 2× claim. Measurements used source 8897cf6; the rebased PR preserves all 32 changed-file hashes. The only guarded dependency change on latest main adds an unrelated SSH command file to the actual-Node registry; all 48 selected renderer routes remain unchanged. Incoming composer, clock-test and README changes are covered by final PR CI rather than a repeated local benchmark.

Linked Issue

N/A — maintainer performance work.

Visual Proof

N/A — test fixture imports only; application UI and interactions do not change.

Testing

  • Automated tests checked locally on macOS; no application UI change to manually test.
  • Existing tests retained; no additional shipping tests needed for moving existing builders.
  • 48 consumer suites retain exactly 410 original passing cases under Bun and Node, with two shuffle seeds. Separate qualification adds one temporary check proving all seven public builder/constant bindings are identical, for 411 passing cases. Three protected lifetime suites still run under actual Node.
  • The shipping-only 410-case reports passed under both runtimes, but overlapping unrelated local test coordinators rejected their process-noise guards. These reports are retained and are not counted as fully qualified benchmarks. The six shipping-source timing runs passed all case, route, setup, isolation, source, and process guards.
  • Web typecheck, changed-code-quality checks, formatting, and normal commit hooks passed. Full Linux ARM unit CI and all required checks passed on the rebased head.
  • Existing browser/editor/terminal, SSH hydration, hidden workspace, and mobile-close consumers are included. One session-first consumer now evaluates the existing i18n module earlier; the consumer qualifications cover that ordering change.

Review

Self-reviewed original case bodies and moved builder bodies for exact preservation. The first full CI run preserved all 11,678 files but failed two unchanged real PowerShell cases. A later Bun run passed those cases, so no crash cause is established. PR #26226 corrects that native contract’s runtime to production Node. This PR is rebased onto that change and the clock PR, with all 32 shipping bytes preserved; fresh exact-head CI passed and independent source review verified the unchanged rebased patch. The failed run is retained, not replaced or reported as passing.

Agent skill upstream boundary

  • Not applicable; no upstream skill code or fixtures copied.

Notes

No production behavior, native runtime routing, wire format, platform-specific behavior, or test isolation changes. Local raw measurements and qualification reports are retained in the ignored notes/bun-migration/performance directory.

Checklist

  • This PR is small and focused
  • Explained before/after, mechanism, and why
  • Visual proof N/A with reason
  • Self-reviewed correctness and performance
  • Cross-platform and SSH impact considered
  • Full required CI checks passed before merge

Final full CI: run 37632813645, synthetic source 82099512b76883013af665f4832ae8fedfefb5f3 with parents 40d35fb7 + exact head d9056fe5. All 11,678 physical files ran exactly once across five passing shards: 11,538 passed files and 140 existing skipped files; 112,609 passed cases, one expected failure and 1,052 existing skips. No unhandled errors, omitted failures, added or missing files. Source-configured routes: 10,551 Bun, 1,126 actual-Node runtime, one Node measurement. All 18 stock launcher/configuration/registry/setup guards match incoming main. Stock artifacts prove enrollment and raw totals, not complete named-case parity; local qualifications supply the selected exact case maps. The earlier failed full run remains recorded above.

Bot review disposition: CodeRabbit covers prior head 5d3, with zero actionable findings and no open review threads. Its generic documentation-coverage advisory was assessed: the 11 touched test-fixture functions have unchanged bodies; adding repetitive docstrings solely to reach its threshold would conflict with the repository's concise-comment rule. No code change is warranted for that advisory. The bot has not reviewed rebase head d905; no claim of exact-head bot coverage is made. An independent current-head review verified all 32 before/after file bytes and the full proposal diff are identical to the bot-reviewed patch, only the base changed, and all selected runtime routes are unchanged. Combined with passing fresh exact-head full CI, this pure-base rebase warrants merge without triggering a duplicate bot review.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0f7c4a86-e57c-4dd2-a012-b6d14399e5fa
📥 Commits

Reviewing files that changed from the base of the PR and between 0d82899 and 5d3c5d6b36052c8ccf98ac9c2cf0f0ba29141134.

📒 Files selected for processing (32)
  • src/renderer/src/app-shell/remote-workspace-unplaced-upload-suppression.test.tsx
  • src/renderer/src/components/activity/activity-clear-completed-state-lifetime.test.ts
  • src/renderer/src/components/editor/restored-editor-workspace-runtime-owner.test.tsx
  • src/renderer/src/components/floating-terminal/use-floating-terminal-close-actions.test.tsx
  • src/renderer/src/components/native-chat/StructuredAgentSessionAttentionBridge.test.tsx
  • src/renderer/src/components/right-sidebar/use-checks-panel-terminal-worktree.test.ts
  • src/renderer/src/components/right-sidebar/useGitStatusPolling.rerender.test.ts
  • src/renderer/src/components/sidebar/WorkspaceKanbanCard.host-identity.test.tsx
  • src/renderer/src/components/sidebar/stale-agent-row-unverifiable.test.ts
  • src/renderer/src/components/sidebar/worktree-card-compact-agent-row-stopping.test.ts
  • src/renderer/src/components/sidebar/worktree-delete-host-qualification.test.ts
  • src/renderer/src/components/tab-group/workspace-tab-close-commands.floating-reclaim.test.ts
  • src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts
  • src/renderer/src/components/terminal/terminal-provider-snapshot-bound-pty-ids.test.ts
  • src/renderer/src/components/workspace-cleanup/workspace-cleanup-scanned-host-confirmation-removal.test.tsx
  • src/renderer/src/hooks/useAutoAckViewedAgent.away.test.ts
  • src/renderer/src/hooks/useAutoAckViewedAgent.clock-skew.test.ts
  • src/renderer/src/hooks/useAutoAckViewedAgent.floating-panel.test.ts
  • src/renderer/src/hooks/useAutoAckViewedAgent.focus-group.test.ts
  • src/renderer/src/hooks/useUnreadDockBadge.test.ts
  • src/renderer/src/lib/host-mirror-handle-gap-snapshot-lifetime.test.ts
  • src/renderer/src/lib/resume-sleeping-agent-session-direct-ssh-hydration-gap.test.ts
  • src/renderer/src/lib/resume-sleeping-agent-session-execution-host-scope.test.ts
  • src/renderer/src/lib/ssh-failed-target-sleeping-agent-resume.test.ts
  • src/renderer/src/lib/unread-badge-count-migration.test.ts
  • src/renderer/src/lib/unread-badge-count.test.ts
  • src/renderer/src/runtime/use-runtime-session-mirror-environment-key.test.ts
  • src/renderer/src/store/slices/editor-tab-host-ownership.test.ts
  • src/renderer/src/store/slices/new-markdown.test.ts
  • src/renderer/src/store/slices/store-session-test-harness.ts
  • src/renderer/src/store/slices/store-test-helpers.ts
  • src/renderer/src/store/slices/worktrees-slice-test-fixtures.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The change adds session and worktree test fixture modules, moves fixture definitions into those modules, and re-exports them from the shared test helper. Tests across renderer components, hooks, libraries, and store slices now import fixtures from the dedicated modules. Test behavior and assertions remain unchanged.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 5d3c5

The fixture extraction leaves test behavior unchanged while keeping the dedicated fixture imports outside the renderer Store. No change-specific merge risk remains, subject to normal CI completion.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 32 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the primary change: renderer fixture tests avoid loading the full Store.
Description check ✅ Passed The description covers the required sections, explains the change and rationale, documents testing and CI results, states that visual proof is not applicable, and addresses compatibility and review co…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker force-pushed the nwparker/renderer-session-fixture-leaves-clock-fixed branch from 5d3c5d6 to d9056fe Compare October 7, 2026 13:58
@nwparker
nwparker merged commit 39710c7 into main Oct 7, 2026
30 checks passed
@nwparker nwparker changed the title test: avoid loading the full Store for renderer fixture builders [CI] test: avoid loading the full Store for renderer fixture builders Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant