vscode-ruby-test-adapter
vscode-ruby-test-adapter copied to clipboard
Not working on remote SSH
-
vscode-ruby-test-adapter
version: 0.8.0 - Ruby version: 2.7.2
- VS Code version: 1.52.1
- Operating System: Ubuntu 20
- RSpec or Minitest version: rspec
If I use the remote SSH https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh I get the error
Error while finding RSpec test suite:
Command failed: bundle exec rspec --pattern './spec//**/*_test.rb,./spec//**/test_*.rb,./spec//**/*_spec.rb' --require /LOCAL_COMPUTER_PATH/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.8.0/custom_formatter.rb --format
It's trying to use a local path, not on a ssh server
Same problem with Ubuntu in WSL2
I was able to use this in remote containers, but since last week, it's just unable to boot.
My workspace settings:
(I've tried to use absolute paths to see if they have any effect, none)
{
"rubyTestExplorer.testFramework": "rspec",
"rubyTestExplorer.rspecCommand": "/app/bin/rspec",
"rubyTestExplorer.rspecDirectory": "/app/spec/",
"rubyTestExplorer.logpanel": true,
"rubyTestExplorer.filePattern": ["/app/spec/**/*_spec.rb"]
}
Debug output:
[2021-05-28 16:44:37.021] [INFO] Test Explorer found
[2021-05-28 16:44:37.021] [INFO] Creating adapter for /app
[2021-05-28 16:44:37.021] [INFO] Initializing Ruby adapter
[2021-05-28 16:44:37.021] [INFO] Registering adapter for /app
[2021-05-28 16:44:37.023] [INFO] Loading Ruby tests...
[2021-05-28 16:44:37.023] [INFO] Getting a list of Bundler dependencies with 'bundle list'.
[2021-05-28 16:44:37.363] [INFO] Detected RSpec test framework.
[2021-05-28 16:44:37.363] [INFO] Loading RSpec tests...
[2021-05-28 16:44:37.364] [INFO] Running dry-run of RSpec test suite with the following command: bundle exec rspec --pattern './spec//**/*_test.rb,./spec//**/test_*.rb,./spec//**/*_spec.rb' --require /root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/custom_formatter.rb --format CustomFormatter --order defined --dry-run
[2021-05-28 16:44:37.374] [INFO] Creating adapter for /usr/local/lib/ruby-2.6.6/lib/ruby/gems/2.6.0/gems
[2021-05-28 16:44:37.374] [INFO] Initializing Ruby adapter
[2021-05-28 16:44:37.374] [INFO] Registering adapter for /usr/local/lib/ruby-2.6.6/lib/ruby/gems/2.6.0/gems
[2021-05-28 16:44:37.374] [INFO] Loading Ruby tests...
[2021-05-28 16:44:37.374] [INFO] Getting a list of Bundler dependencies with 'bundle list'.
[2021-05-28 16:44:37.534] [ERROR] Error: Command failed: bundle list
at checkExecSyncError (child_process.js:616:11)
at Object.execSync (child_process.js:652:15)
at RubyAdapter.detectTestFramework (/root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/out/src/adapter.js:141:44)
at RubyAdapter.getTestFramework (/root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/out/src/adapter.js:129:46)
at RubyAdapter.<anonymous> (/root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/out/src/adapter.js:33:22)
at Generator.next (<anonymous>:null:null)
at /root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/node_modules/tslib/tslib.js:117:75
at new Promise (<anonymous>:null:null)
at Object.__awaiter (/root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/node_modules/tslib/tslib.js:113:16)
at RubyAdapter.load (/root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/out/src/adapter.js:30:24)
at TestHub.registerTestAdapter (/root/.vscode-server/extensions/hbenl.vscode-test-explorer-2.20.1/out/hub/testHub.js:57:17)
at Object.registerTestAdapter (/root/.vscode-server/extensions/hbenl.vscode-test-explorer-2.20.1/out/main.js:104:45)
at TestAdapterRegistrar.add (/root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/node_modules/vscode-test-adapter-util/out/registrar.js:48:22)
at new TestAdapterRegistrar (/root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/node_modules/vscode-test-adapter-util/out/registrar.js:19:22)
at /root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/out/src/main.js:21:40
at Generator.next (<anonymous>:null:null)
at /root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/node_modules/tslib/tslib.js:117:75
at new Promise (<anonymous>:null:null)
at Object.__awaiter (/root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/node_modules/tslib/tslib.js:113:16)
at activate (/root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/out/src/main.js:10:20)
at Function._callActivateOptional (/root/.vscode-server/bin/054a9295330880ed74ceaedda236253b4f39a335/out/vs/server/remoteExtensionHostProcess.js:92:14813)
at Function._callActivate (/root/.vscode-server/bin/054a9295330880ed74ceaedda236253b4f39a335/out/vs/server/remoteExtensionHostProcess.js:92:14486)
at /root/.vscode-server/bin/054a9295330880ed74ceaedda236253b4f39a335/out/vs/server/remoteExtensionHostProcess.js:92:12643
at Function.all (<anonymous>:null:null)
at Function.all (<anonymous>:null:null)
at Function.all (<anonymous>:null:null)
{
status: 10,
signal: null,
output: [
null,
<Buffer 43 6f 75 6c 64 20 6e 6f 74 20 6c 6f 63 61 74 65 20 47 65 6d 66 69 6c 65 20 6f 72 20 2e 62 75 6e 64 6c 65 2f 20 64 69 72 65 63 74 6f 72 79 0a>,
<Buffer >
],
pid: 32144,
stdout: <Buffer 43 6f 75 6c 64 20 6e 6f 74 20 6c 6f 63 61 74 65 20 47 65 6d 66 69 6c 65 20 6f 72 20 2e 62 75 6e 64 6c 65 2f 20 64 69 72 65 63 74 6f 72 79 0a>,
stderr: <Buffer >
}
[2021-05-28 16:44:37.536] [WARN] No test framework detected. Configure the rubyTestExplorer.testFramework setting if you want to use the Ruby Test Explorer.
[2021-05-28 16:44:37.538] [INFO] Initialization finished
[2021-05-28 16:44:55.268] [ERROR] Error while finding RSpec test suite: Command failed: bundle exec rspec --pattern './spec//**/*_test.rb,./spec//**/test_*.rb,./spec//**/*_spec.rb' --require /root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/custom_formatter.rb --format CustomFormatter --order defined --dry-run
Aaand just like that I noticed there is the command it tries to run (still not using my local settings, but ok)
bundle exec rspec --pattern './spec//**/*_test.rb,./spec//**/test_*.rb,./spec//**/*_spec.rb' --require /root/.vscode-server/extensions/connorshea.vscode-ruby-test-adapter-0.9.0/custom_formatter.rb --format CustomFormatter --order defined --dry-run
Running this command in the terminal immediately showed me the error I had. No obvious, but seen similar before, my test database did not exist or was without schema. So reseting/creating the test database did it and running the line above gave passing results. After reloading the window the extension works again. Lesson learned.