Skip to content

[CI] test: reduce terminal topology suite time by 40.98% - #26166

Merged
nwparker merged 1 commit into
mainfrom
nwparker/terminal-tab-fixture-reuse
Oct 7, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/terminal-tab-fixture-reuse

Conversation

@nwparker

@nwparker nwparker commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Terminal topology tests can load their terminal-tab fixture without loading the persistence Store and SQLite. Their test data and assertions stay the same.

What Changed

Move the existing pure makeTerminalTab declaration into the existing persistence-session-fixtures module. The persistence harness reexports that same function, preserving its public import path. All defaults, overrides, Store constructors and cleanup stay unchanged. One existing Store lifecycle suite checks that both import paths expose the identical function.

Why

The session fixture module previously imported this small builder from the broad persistence harness, pulling in its entire dependency graph. Placing the builder beside the session fixtures removes that unnecessary dependency and follows the existing implementation rather than creating a second builder.

Complete 20-case command Before After Less time
Pair 1 3.711s 2.222s 40.12%
Pair 2 3.904s 2.230s 42.90%
Pair 3 3.534s 2.128s 39.77%
Mean 3.716s 2.193s 40.98%

Three matched pairs used frozen source 6d90d51802dd, four workers, fsModuleCache=false, all six stock setup files and original isolation. Times include the entire pnpm test process through exit. Two suites stayed on Bun forks; the persistence ownership suite stayed on actual Node. Order was before/after, after/before, before/after. Every qualified sample was retained. External contention rejections and raw logs remain recorded separately. The new identity case is outside this unchanged timed cohort.

This is a 1.694× improvement for three selected suites; it does not establish the whole-suite 2× goal.

Linked Issue

Maintainer-requested test performance follow-up.

Visual Proof

N/A — only test fixture dependency changes; no application rendering or interaction change.

Testing

  • Automated qualification on macOS under both Bun and stock Node.
  • Existing assertions retained and one public export-identity assertion added.

Six suites cover terminal projection/publishing/ownership, real Store lifecycle, session scrollback and initial loading. Both runtimes passed all 87 original cases before and after, plus the one new identity case after. Exact original case/status maps, runtime routes, setup files, isolation and cold reload behavior matched. pnpm tc:node, formatting, changed-code quality and pre-commit checks passed. After rebasing onto main e6bcc5a6e0fd, both changed helper files and all three timed test files remained byte-identical to the measured inputs. Both runtimes then passed the same 88 cases again with fsModuleCache=true; exact original case/status maps and routing matched. Typecheck and the changed-code gate passed again. Final Linux unit CI run 37601175785 tested merge source 24427a111e34 with parents incoming main e6bcc5a6e0fd and exact PR head 82a2cb726c0c; its entire tree matches the PR head. All 11,413 physical files ran exactly once: 11,278 passed, 135 existing skips, zero failures or unhandled errors. Cases: 110,721 passed, one expected failing case, 1,035 existing skips. All prior full-CI file/status mappings were retained, with exactly the one new binding case. Runtime routing is unchanged.

The initial Windows job timed out in an unchanged Electron SQLite writer-stall test. Its source, bundled fixture and deadline implementation were byte-identical to incoming main. One retry of only that failed job on the same tested source passed, including the stall case in 8.893s; its original 2.412s timeout and logs are retained. No source, deadline or assertion changed for the retry, and the failure cause is not established. All 30 final contexts are successful or skipped, with no unresolved review threads. No bot review was recorded; independent review and complete CI are the review evidence.

Review

The moved declaration is byte-identical and has no runtime dependencies beyond its arguments and literals. All other fixture/harness functions and lifecycle hooks are unchanged. Independent source review found no mocked-module seams affected by the move.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer source copied or translated.

Notes

No production code, platform commands, SSH execution boundary, folder-workspace behavior, wire format or packaging changes. Local testing was on macOS; final Linux unit CI passed. No Windows qualification is claimed.

Checklist

  • Small focused change with before/after and mechanism explained
  • Visual proof is N/A with reason
  • Independent review, original case parity and cross-platform impact considered
  • Current-main qualification and final CI complete

@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: a4256575-251c-4594-857a-69b02f62bf4d
📥 Commits

Reviewing files that changed from the base of the PR and between e6bcc5a and 82a2cb7.

📒 Files selected for processing (3)
  • src/main/persistence-repo-lifecycle.test.ts
  • src/main/persistence-session-fixtures.ts
  • src/main/persistence-test-harness.ts

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


📝 Walkthrough

Walkthrough

The session-fixtures module now defines and exports makeTerminalTab with default fields and optional overrides. The persistence test harness re-exports that function. The lifecycle test verifies that the harness export and the session-fixtures export are the same function.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 82a2c

The fixture move preserves defaults, overrides, and the existing harness import path; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
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 highlights the reported reduction in terminal topology test time, which is a primary outcome of moving the fixture to avoid loading the persistence Store and SQLite dependencies.
Description check ✅ Passed The description covers the required sections, explains the change and its rationale, reports detailed testing and performance results, and marks visual proof as not applicable. The maintainer-requeste…
✨ Finishing Touches 💡 1
📝 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 merged commit 5b0d387 into main Oct 7, 2026
51 of 53 checks passed
@nwparker nwparker changed the title test: reduce terminal topology suite time by 40.98% [CI] test: reduce terminal topology suite time by 40.98% 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