Skip to content

refactor(wsl): move WslHostService test fakes into a fixture to fit max-lines - #34142

Closed
nwparker wants to merge 1 commit into
mainfrom
nwparker/wsl-host-service-test-split-oct26
Closed

nwparker wants to merge 1 commit into
mainfrom
nwparker/wsl-host-service-test-split-oct26

Conversation

@nwparker

@nwparker nwparker commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​9 $\color{#cf222e}{\Huge{\mathbf{−}}}$​71 $\color{#cf222e}{\Huge{\mathbf{−}}}$​62
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​74 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​74

ELI5

A test file grew past the line limit after two PRs landed around the same time, which turned main's lint red. Its shared test fakes now live in their own file. Nothing behaves differently.

What Changed

src/main/wsl/wsl-host-service.test.ts was 828 lines against an 800 cap after #33839 and #33147 crossed. Its fake WSL connector (makeConnector), connection, pairing and the KEY/UBUNTU fixtures move unchanged into wsl-host-service.test-fixture.ts, and the test imports them. The file has a single describe block, so moving its shared fakes is the cohesive seam. There are no lint-disable comments.

Why

Main's lint gate fails on max-lines, which blocks every PR.

Linked Issue

N/A, main lint fix.

Visual Proof

N/A. Test-only move.

Testing

  • oxlint is clean on both files, and pnpm tc passes.

  • wsl-host-service.test.ts passes all 40 tests, with the same 39 it/it.each cases as before.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Test-only move, so there's no platform, SSH, mobile or compatibility impact.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…ax-lines

The fake connector, connection, pairing and distro constants move unchanged
to wsl-host-service.test-fixture.ts; the test file drops from 828 to under 800.
@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2c668a43-68aa-4e12-a4c1-6a806ddc7ec6
Commits

Reviewing files that changed from the base of the PR and between 1b64adb and 7480d31.

Files selected for processing: 2
  • src/main/wsl/wsl-host-service.test-fixture.ts
  • src/main/wsl/wsl-host-service.test.ts

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

Walkthrough

The change adds shared WSL host test fixtures for pairing offers, connections, distro candidates, and connector behavior. The WSL host service test imports these fixtures and removes its inline equivalents.

Priority: Low

Merge Risk: Minimal · up to 7480d

The change is limited to relocating shared test fixtures and updating imports; it is mergeable.

Pre-merge checks: Passed 4 · Failed 1

Failed 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 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change: moving WslHostService test fakes into a fixture file to satisfy the max-lines lint limit. It uses the conventional refactor(wsl) prefix. The summary matches the change…
Description check Passed The description follows the repository template. It includes the ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklis…
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.
Full details: Title check

Explanation

The title names the main change: moving WslHostService test fakes into a fixture file to satisfy the max-lines lint limit. It uses the conventional refactor(wsl) prefix. The summary matches the changeset, which moves makeConnector, connection, pairing, and the KEY/UBUNTU fixtures into wsl-host-service.test-fixture.ts. The title is slightly long at 77 characters, but it is specific and accurate.

Full details: Description check

Explanation

The description follows the repository template. It includes the ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. It explains the before and after state and the mechanism, which is moving unchanged fakes into a fixture file. It states that the change is test-only and gives the testing results. The Linked Issue section is 'N/A, main lint fix'. The template says outside contributors must link an issue, but this author appears to be a maintainer, so the gap is minor. The AI Disclosure section is blank, which the template allows for internal team members. The Visual Proof section is marked N/A with a reason.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · 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

Copy link
Copy Markdown
Contributor Author

Superseded by #34132, which landed the same max-lines split first.

@nwparker nwparker closed this Oct 27, 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