Repository navigation
test: split GitHub and GitLab mocks out of runtime setup.spec to fix main lint - #39837
Conversation
setup.spec.ts reached 801 counted lines after #39575, failing the root oxlint max-lines rule on main. Move the GitHub/hosted-review and GitLab mock functions and their vi.mock registrations into sibling modules that setup.spec re-exports, so every consumer keeps the same imports and mocks.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
The module-mocking lint exempts *-test-harness.ts support modules shared by split suites; the split-out GitHub and GitLab mock modules are exactly that.
ELI5
The shared test-mock file for the runtime tests grew one line past the lint size limit, so lint now fails on main and on every PR. This splits it into smaller files without changing any test.
What Changed
src/main/runtime/orca-runtime-test-mocks/setup.spec.tsreached 801 counted lines (limit 800) after #39575 added one mock line. The file holds shared mocks, not tests, so I split it by mocked area:github-hosted-review-mocks.ts: the GitHub and hosted-review mock functions plus theirvi.mockregistrationsgitlab-mocks.ts: the GitLab mock functions plus theirvi.mockregistrationssetup.spec.tsre-exports both modules (export * from ...) as its first statements, so the GitHub and GitLab mocks still register before its other imports, and every existingimport { ... } from '.../setup.spec'keeps working unchanged. Mock definitions and default return values moved over exactly as they were. No tests or assertions changed.Why
This fixes the max-lines lint failure on main by splitting the file along a real boundary. It doesn't delete blank lines or add a lint exemption. The new files are plain
.tsmodules under the 300-line limit, like the other*-mocks.tshelpers insrc/main.Linked Issue
N/A (maintainer fix for a broken main lint step)
Visual Proof
N/A: this only changes test mocks, with no UI or behavior change.
Testing
Root lint step as CI runs it (
node node_modules/oxlint/bin/oxlint): passes. On main it fails with max-lines onsetup.spec.ts.JS-plugin lint and
oxfmt --checkon the changed directory: passpnpm typecheck: passespnpm test src/main/runtime/construction/orca-runtime.test.ts(the entry point that loads theorca-runtime-tests/*.spec.tsfragments using these mocks) plus four direct consumers ofsetup.spec: 898 passed, 3 skipped. That's the same result as on unmodified main.I manually tested these changes locally
Automated tests added/updated, or explained why not below (no test changes; this is a mock-file split)
Every added test fails without this change and avoids the test anti-patterns
Risk
Level: Low. Only test-support files change. If anything breaks, it would be a runtime spec that loses a GitHub/GitLab mock, which would show up as a test failure, not a product change. A plain revert backs it out.
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)