vscode-ruby-test-adapter
vscode-ruby-test-adapter copied to clipboard
Minitest tests run but show no result – empty JSON
Your environment
-
vscode-ruby-test-adapter
version: 0.6.0 - Ruby version: ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
- VS Code version: 1.39.2
- Operating System: Ubuntu 19.04
- Minitest version: minitest (5.12.2, 5.11.3) according to "gem list minitest"
- Ruby manager: rvm
- Context: minimal Padrino web application
Expected behavior
I expected the two tests to show whether they succeeded or failed.
Actual behavior
The tests run but after a second the status icon becomes a gray square again.
Screenshot of the tests view:
Screenshot of the developer toolbar:
Running "rake" or "rake test" shows this output:
/home/chaas/.rvm/rubies/ruby-2.6.3/bin/ruby -w -I"lib" -I"/home/chaas/.rvm/gems/ruby-2.6.3/gems/rake-13.0.0/lib" "/home/chaas/.rvm/gems/ruby-2.6.3/gems/rake-13.0.0/lib/rake/rake_test_loader.rb" "test/models/feedconfig_test.rb"
/home/chaas/.rvm/gems/ruby-2.6.3/gems/sequel-5.25.0/lib/sequel/dataset/query.rb:84: warning: statement not reached
/home/chaas/.rvm/gems/ruby-2.6.3/gems/moneta-1.0.0/lib/moneta/expires.rb:31: warning: assigned but unused variable - expires
/home/chaas/.rvm/gems/ruby-2.6.3/gems/padrino-gen-0.14.4/lib/padrino-gen/command.rb:16: warning: `*' interpreted as argument prefix
Run options: --seed 429
# Running:
.F
Finished in 0.002195s, 910.9571 runs/s, 1366.4357 assertions/s.
1) Failure:
Feedconfig Model#test_0002_fails [/home/chaas/projekte/retadapi_padrino/test/models/feedconfig_test.rb:11]:
Expected false to be truthy.
2 runs, 3 assertions, 1 failures, 0 errors, 0 skips
rake aborted!
Command failed with status (1): [ruby -w -I"lib" -I"/home/chaas/.rvm/gems/ruby-2.6.3/gems/rake-13.0.0/lib" "/home/chaas/.rvm/gems/ruby-2.6.3/gems/rake-13.0.0/lib/rake/rake_test_loader.rb" "test/models/feedconfig_test.rb" ]
/home/chaas/.rvm/gems/ruby-2.6.3/gems/rake-13.0.0/exe/rake:27:in `<top (required)>'
/home/chaas/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
/home/chaas/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => default => test => test:models
(See full trace by running task with --trace)
Do you happen to have a Padrino application I could test with? I'm not seeing this issue with my Rails app using Minitest on Minitest 5.11.3.
Thanks for taking a look. I have stripped down the project to a minimal Padrino app with a simple test to reproduce the issue. Please follow these steps:
curl -sSL https://get.rvm.io | bash -s stable
adduser foo
adduser foo rvm
rvm install 2.6.3
rvm use 2.6.3
ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
su - foo
git clone https://github.com/Signum/vscode-ruby-test-adapter
cd vscode-ruby-test-adapter/
bundle install
rake
That leads to this output here:
/usr/local/rvm/rubies/ruby-2.6.3/bin/ruby -w -I"lib" -I"/usr/local/rvm/gems/ruby-2.6.3/gems/rake-13.0.0/lib" "/usr/local/rvm/gems/ruby-2.6.3/gems/rake-13.0.0/lib/rake/rake_test_loader.rb" "test/models/feedconfig_test.rb"
/usr/local/rvm/gems/ruby-2.6.3/gems/sequel-5.25.0/lib/sequel/dataset/query.rb:84: warning: statement not reached
/usr/local/rvm/gems/ruby-2.6.3/gems/moneta-1.0.0/lib/moneta/expires.rb:31: warning: assigned but unused variable - expires
/usr/local/rvm/gems/ruby-2.6.3/gems/padrino-gen-0.14.4/lib/padrino-gen/command.rb:16: warning: `*' interpreted as argument prefix
Run options: --seed 45001
# Running:
FE
Finished in 0.000658s, 3038.9271 runs/s, 1519.4636 assertions/s.
1) Failure:
Feedconfig Model#test_0002_fails [/home/api/vscode-ruby-test-adapter/test/models/feedconfig_test.rb:11]:
Expected false to be truthy.
2) Error:
Feedconfig Model#test_0001_can read feedconfig for feed 1:
Sequel::Error: Feedconfig does not have a primary key
/usr/local/rvm/gems/ruby-2.6.3/gems/sequel-5.25.0/lib/sequel/model/base.rb:570:in `primary_key_hash'
/usr/local/rvm/gems/ruby-2.6.3/gems/sequel-5.25.0/lib/sequel/model/base.rb:942:in `primary_key_lookup'
/usr/local/rvm/gems/ruby-2.6.3/gems/sequel-5.25.0/lib/sequel/model/base.rb:214:in `[]'
/home/api/vscode-ruby-test-adapter/test/models/feedconfig_test.rb:5:in `block (2 levels) in <top (required)>'
2 runs, 1 assertions, 1 failures, 1 errors, 0 skips
rake aborted!
Command failed with status (1): [ruby -w -I"lib" -I"/usr/local/rvm/gems/ruby-2.6.3/gems/rake-13.0.0/lib" "/usr/local/rvm/gems/ruby-2.6.3/gems/rake-13.0.0/lib/rake/rake_test_loader.rb" "test/models/feedconfig_test.rb" ]
/usr/local/rvm/gems/ruby-2.6.3/gems/rake-13.0.0/exe/rake:27:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
/usr/local/rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => default => test => test:models
(See full trace by running task with --trace)
Then open the project in VSCode and try to run the tests. I hope it leads to the same issue on your computer.
Possibly fixed by #34 Please try it out
Just tried it. Unfortunately it did not fix it.
Just tried it. Unfortunately it did not fix it.
Ok, bummer.
This is exactly what I was seeing that led me to open PR #46, it may be the same issue here. At the very least after that one is released you'll get the STDERR from the child process that should indicate what the problem is in ruby land.
@connorshea can you please review this thread? I am experiencing the same issue.