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

NameError when attempting to run tests (passes if outside VS Code) #65

Closed andyw8 closed 3 years ago

andyw8 commented 3 years ago

Your environment

Expected behavior

Expecting a pass when running the tests for https://github.com/Shopify/shopify-app-cli (public repo).

Actual behavior

It fails with:

[2020-12-31 03:00:46.335] [ERROR] Error while finding Minitest test suite: Command failed: bundle exec rake -R $EXT_DIR vscode:minitest:list
rake aborted!
NameError: uninitialized constant Extension::Models::Type
Did you mean?  Extension::Models::Types
/Users/andyw8/src/github.com/Shopify/shopify-app-cli/test/project_types/extension/extension_test_helpers/test_extension.rb:5:in `<module:ExtensionTestHelpers>'
/Users/andyw8/src/github.com/Shopify/shopify-app-cli/test/project_types/extension/extension_test_helpers/test_extension.rb:4:in `<module:Extension>'
/Users/andyw8/src/github.com/Shopify/shopify-app-cli/test/project_types/extension/extension_test_helpers/test_extension.rb:3:in `<top (required)>'
/Users/andyw8/src/github.com/andyw8/dotfiles/vscode/extensions/connorshea.vscode-ruby-test-adapter-0.8.0/ruby/vscode/minitest/tests.rb:27:in `require'
/Users/andyw8/src/github.com/andyw8/dotfiles/vscode/extensions/connorshea.vscode-ruby-test-adapter-0.8.0/ruby/vscode/minitest/tests.rb:27:in `block in load_files'
/Users/andyw8/src/github.com/andyw8/dotfiles/vscode/extensions/connorshea.vscode-ruby-test-adapter-0.8.0/ruby/vscode/minitest/tests.rb:27:in `load_files'
/Users/andyw8/src/github.com/andyw8/dotfiles/vscode/extensions/connorshea.vscode-ruby-test-adapter-0.8.0/ruby/vscode/minitest/tests.rb:8:in `all'
/Users/andyw8/src/github.com/andyw8/dotfiles/vscode/extensions/connorshea.vscode-ruby-test-adapter-0.8.0/ruby/vscode/minitest.rb:25:in `list'
/Users/andyw8/.vscode/extensions/connorshea.vscode-ruby-test-adapter-0.8.0/ruby/vscode.rake:8:in `block (3 levels) in <top (required)>'
/Users/andyw8/.gem/ruby/2.5.1/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/Users/andyw8/.gem/ruby/2.5.1/bin/bundle:23:in `load'
/Users/andyw8/.gem/ruby/2.5.1/bin/bundle:23:in `<main>'
Tasks: TOP => vscode:minitest:list
(See full trace by running task with --trace)

The tests pass when running bundle exec rake outside of VS Code.

connorshea commented 3 years ago

Is this still a problem? I tried cloning this repo and it worked fine for me (one test failed but I assume that's unrelated). The only difference is that I'm using Ruby 2.6.6 (I tried installing 2.5.1 but rbenv failed to install it on my Mac with Big Sur).

I'm using 0.9.0 of the Ruby Test Explorer extension.

andyw8 commented 3 years ago

Hi Connor,

I just tried this again and it works. Not sure what's changed, but good news anyway.

I'll close the issue.