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

Unrecoverable state if test discovery errors out #106

Open hoylemd opened 1 year ago

hoylemd commented 1 year ago

Your environment

Expected behavior

If test discovery fails, for there to be some way to retry after fixing the problem (i.e. make the reload button work?)

Actual behavior

If the test discovery command fails, The testing sidebar remins in a state where it looks like it's looking for tests, but it will never complete. The 'reload' button is still spinning, and clicking it does nothing. The best workaround I've found is to disable the extension (requiring VSCode to reload) fix the problem, and then re-enable it. Because the test suite in my project depends on some port-forwarding being set up, and I run that forwarding in a terminal in VSCode, I get into this irrecoverable state every time I open VSCode after a reboot.

Ruby Test Explorer Log

[2022-08-26 20:03:43.814] [INFO] Test Explorer found
[2022-08-26 20:03:43.814] [INFO] Creating adapter for /Users/mikehoyle/pixlee/control-panel
[2022-08-26 20:03:43.814] [INFO] Initializing Ruby adapter
[2022-08-26 20:03:43.814] [INFO] Registering adapter for /Users/mikehoyle/pixlee/control-panel
[2022-08-26 20:03:43.814] [INFO] Loading Ruby tests...
[2022-08-26 20:03:43.814] [INFO] Getting a list of Bundler dependencies with 'bundle list'.
[2022-08-26 20:03:44.303] [INFO] Detected RSpec test framework.
[2022-08-26 20:03:44.303] [INFO] Loading RSpec tests...
[2022-08-26 20:03:44.304] [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 /Users/mikehoyle/.vscode/extensions/connorshea.vscode-ruby-test-adapter-0.9.1/custom_formatter.rb --format CustomFormatter --order defined --dry-run
[2022-08-26 20:03:44.305] [INFO] Initialization finished
[2022-08-26 20:03:44.974] [INFO] Configuration changed
[2022-08-26 20:03:51.692] [ERROR] Error while finding RSpec test suite: Command failed: bundle exec rspec --pattern './spec//**/*_test.rb,./spec//**/test_*.rb,./spec//**/*_spec.rb' --require /Users/mikehoyle/.vscode/extensions/connorshea.vscode-ruby-test-adapter-0.9.1/custom_formatter.rb --format CustomFormatter --order defined --dry-run
  (a bunch of irrelevant warnings omitted for brevity)
SimpleCov failed with exit 1

Screenshot of the sidebar

Screen Shot 2022-08-26 at 16 17 20

(the circle-arrow icon is spinning endlessly, and clicking any of those buttons does nothing)