connorshea / vscode-ruby-test-adapter

A Ruby test adapter extension for the VS Code Test Explorer
https://marketplace.visualstudio.com/items?itemName=connorshea.vscode-ruby-test-adapter
MIT License
83 stars 50 forks source link

Debug Tests fails with an error #133

Open grelca opened 6 months ago

grelca commented 6 months ago

Your environment

Expected behavior

  1. Run "Debug Tests in Current File"
  2. Tests run with debugger enabled

Actual behavior

  1. Run "Debug Tests in Current File"
  2. Configured debug type "Ruby" is not supported: Screenshot 2024-01-17 at 4 40 51 PM

Some Googling turns up that the Ruby launch config type is related to the https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby extension which has been deprecated. I did have this extension installed previously and was able to use the debugger feature of this extension, but seems like since the last time I used it the extension's been removed from my system and it's no longer installable.

127 would help with this by allowing users to set their own launch config

danleyden commented 5 months ago

Same issue here... currently my workaround is to use https://github.com/st0012/ruby-lsp-rspec in place of this extension

moritonal commented 2 months ago

I have the same issue ever since I uninstalled the deprecated Ruby extension written by Peng Lv. With a glance I'd say this is likely because of how this line creates a Debug config with the type of "Ruby" which is causing this issue.

    const debuggerConfig = {
      name: "Debug Ruby Tests",
      type: "Ruby",
      request: "attach",
      remoteHost: config.get('debuggerHost') || "127.0.0.1",
      remotePort: config.get('debuggerPort') || "1234",
      remoteWorkspaceRoot: "${workspaceRoot}"
    }

    const testRunPromise = this.run(testsToRun, debuggerConfig);

I don't know what the fix would be, but I know for my current debug setup using Shopify's extensions is

{
            "type": "ruby_lsp",
            "request": "launch",
            "program": "${workspaceRoot}/bin/rails server --port 3008"
}

So it'd be some version of that, although that'd just force-associate us with the Shopify's "ruby_lsp" name, so same problem.