Skip to content

Fix Windows test reporter path lookup (#3881) - #4191

Open
trippyogi wants to merge 1 commit into
Shopify:mainfrom
trippyogi:fix/3881-windows-test-reporter-paths
Open

Fix Windows test reporter path lookup (#3881)#4191
trippyogi wants to merge 1 commit into
Shopify:mainfrom
trippyogi:fix/3881-windows-test-reporter-paths

Conversation

@trippyogi

@trippyogi trippyogi commented Aug 12, 2026

Copy link
Copy Markdown

Motivation

Fixes #3881.

On Windows, VS Code stores Test Explorer reporter DB keys using uri.fsPath, while Ruby's Dir.pwd can represent the same path with different separators and drive-letter casing. The exact hash lookup then misses, causing the reporter to fall back to StringIO and leaving Test Explorer waiting for results even though the tests finished.

Implementation

Normalize path separators and drive-letter casing when resolving the reporter port in LspReporter.

The change is reader-only: the VS Code writer continues storing native uri.fsPath values, while the Ruby reporter tolerates equivalent Windows path representations.

Automated Tests

  • Added coverage for equivalent Windows path representations.
  • Added a socket-level regression test verifying that the reporter connects successfully when the DB contains d:\... and Dir.pwd returns D:/....
  • bundle exec ruby -Itest test/test_reporters/lsp_reporter_test.rb — 12 runs, 0 failures.
  • Indexer suite — 318 runs, 0 failures.

Manual Tests

Tested against a small RSpec project on Windows:

  1. Published gem: Test Explorer remained spinning after the test completed (~81s, still 0/1).
  2. This branch via local gem path: 1/1 test reported green in ~1.3s.

Before (published gem):

Before: Test Explorer spinning at 0/1

After (this branch):

After: Test Explorer green 1/1

Tolerate uri.fsPath vs Dir.pwd differences (separators and drive-letter
casing) when resolving the reporter port from the temp DB so Test
Explorer receives results on Windows.
@trippyogi
trippyogi marked this pull request as ready for review August 12, 2026 21:14
@trippyogi
trippyogi requested a review from a team as a code owner August 12, 2026 21:14
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.

Ruby LSP Test Runner - Windows Path Normalization Bug

1 participant