Skip to content

Single test run fails on windows because of absolute file path #3301

Open
@csenszike

Description

@csenszike

Description

Ruby LSP Information

VS Code Version

1.98.2

Ruby LSP Extension Version

0.9.7

Ruby LSP Server Version

0.23.11

Ruby LSP Add-ons

  • Ruby LSP Rails

Ruby Version

3.3.3

Ruby Version Manager

rubyInstaller

Installed Extensions

Click to expand
  • debugpy (2025.4.1)
  • dependi (0.7.13)
  • haml (1.4.1)
  • haml-lint (0.2.1)
  • open-in-external-app (0.10.0)
  • python (2025.2.0)
  • rails-fast-nav (1.3.6)
  • ruby-lsp (0.9.7)
  • rust-analyzer (0.3.2337)
  • rust-bundle (1.0.0)
  • rust-syntax (0.6.1)
  • vscode-docker (1.29.4)
  • vscode-pylance (2025.3.2)
  • vscode-yaml (1.17.0)

Ruby LSP Settings

Click to expand
Workspace
{}
User
{
  "enabledFeatures": {
    "codeActions": true,
    "diagnostics": true,
    "documentHighlights": true,
    "documentLink": true,
    "documentSymbols": true,
    "foldingRanges": true,
    "formatting": true,
    "hover": true,
    "inlayHint": true,
    "onTypeFormatting": true,
    "selectionRanges": true,
    "semanticHighlighting": true,
    "completion": true,
    "codeLens": true,
    "definition": true,
    "workspaceSymbol": true,
    "signatureHelp": true,
    "typeHierarchy": true
  },
  "featuresConfiguration": {},
  "addonSettings": {},
  "rubyVersionManager": {
    "identifier": "auto"
  },
  "customRubyCommand": "",
  "formatter": "auto",
  "linters": null,
  "bundleGemfile": "",
  "testTimeout": 30,
  "branch": "",
  "pullDiagnosticsOn": "both",
  "useBundlerCompose": false,
  "bypassTypechecker": false,
  "rubyExecutablePath": "",
  "indexing": {},
  "erbSupport": true,
  "featureFlags": {},
  "sigOpacityLevel": "1"
}

Reproduction steps

  1. Open a test file from the test folder.
  2. Click on the "Run In Terminal" link on a single specific test (not the one above the whole class definition.

In the terminal the issued command will be eg.:
"C:/Ruby33-x64/bin/ruby.exe bin/rails test s:/project_folder/test/models/geometry_m/geometry_test.rb:4"

This command runs every tests (not just in this file, but even in the entire project).

Additional information and trials:

  1. Problem is independent of how the binary is invoked: "C:/Ruby33-x64/bin/ruby.exe bin/rails test ..." and "rails test..." produces the same result
  2. If I use relative path to the file in terminal command, it works as expected: "C:/Ruby33-x64/bin/ruby.exe bin/rails test test/models/geometry_m/geometry_test.rb:4"
  3. The same problem occures if I don't use "Run In Terminal" but "Run" link instead and also running form the Test Explorer
  4. I searched a lot (in Ruby LSP's source code too) for any possible configuration of the test command arguments, but I couldn't find anything. Even couldn't locate when, how and where the command is built up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp-wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions