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

Error: Don't know how to build task 'vscode:minitest:list' #44

Closed thomthom closed 3 years ago

thomthom commented 4 years ago

Your environment

Expected behavior

Expected the extension to detect and display the Minitest tests of the project.

Actual behavior

Getting error message notification:

Command failed: bundle exec rake -R $EXT_DIR vscode:minitest:list
rake aborted!
Don't know how to build task 'vscode:minitest:list' (See the list of available tasks with `rake --tasks`)

(See full trace by running task with --trace)

Am I reading the message right in that the VSCode extension injecting a rake task to collect info? And it's somehow failing to load/register this Rake task?

Any suggestions on what I can do to further track this down?

thomthom commented 4 years ago

Btw, my project's Gemfile:

source "https://rubygems.org"

# Specify your gem's dependencies in pluckstr.gemspec
gemspec

group :development do
  gem "rake", "~> 12.0"
  gem "solargraph"
  gem "yard"
end

group :test do
  gem "minitest", "~> 5.0"
  gem "minitest-reporters"
end

And I have run bundle install and bundle update to ensure gems are available.

MariuszCwikla commented 4 years ago

Same here. Fails with minitest, works fine with rspec.

dwarburt commented 4 years ago

$EXT_DIR should resolve to ~/.vscode/extensions/connorshea.vscode-ruby-test-adapter-0.7.1/ruby so you can try that command in your terminal and see what the full error message is:

EXT_DIR=~/.vscode/extensions/connorshea.vscode-ruby-test-adapter-0.7.1/ruby
bundle exec rake -R $EXT_DIR vscode:minitest:list
thomthom commented 4 years ago

Here is my results:

C:\Users\Thomas\Source\pluckstr>set EXT_DIR=C:/Users/Thomas/.vscode/extensions/connorshea.vscode-ruby-test-adapter-0.7.1/ruby

C:\Users\Thomas\Source\pluckstr>bundle exec rake -R %EXT_DIR% vscode:minitest:list
rake aborted!
NoMethodError: undefined method `gsub' for nil:NilClass
C:/Users/Thomas/.vscode/extensions/connorshea.vscode-ruby-test-adapter-0.7.1/ruby/vscode/minitest/tests.rb:19:in `load_files'
C:/Users/Thomas/.vscode/extensions/connorshea.vscode-ruby-test-adapter-0.7.1/ruby/vscode/minitest/tests.rb:6:in `all'      
C:/Users/Thomas/.vscode/extensions/connorshea.vscode-ruby-test-adapter-0.7.1/ruby/vscode/minitest.rb:25:in `list'
C:/Users/Thomas/.vscode/extensions/connorshea.vscode-ruby-test-adapter-0.7.1/ruby/vscode.rake:8:in `block (3 levels) in <top (required)>'
Tasks: TOP => vscode:minitest:list
(See full trace by running task with --trace)
thomthom commented 4 years ago

(And the path for EXT_DIR does exist)

CezaryGapinski commented 4 years ago

I also noticed this issue during working with debug test feature in PR #51. These two commits: a4e3264, 9c4665f helps me to solve problem with minitests for Windows. Maybe it will be helpful for anybody else :).