Closed davidmles closed 9 years ago
Interesting...I'll need to have a look at how Spring handles engines.
Doesn't work for me either:
Using /home/adam/.rvm/gems/ruby-1.9.3-p392 with gemset myapp
19:11:57 - WARN - Guard::RSpec DEPRECATION WARNING: The :spring option is deprecated. Please customize the new :cmd option to fit your need.
19:11:57 - INFO - Guard is using Libnotify to send notifications.
19:11:57 - INFO - Guard is using Emacs to send notifications.
19:11:57 - INFO - Guard is using Tmux to send notifications.
19:11:57 - INFO - Guard is using TerminalTitle to send notifications.
19:11:57 - INFO - LiveReload is waiting for a browser to connect.
19:11:57 - INFO - Guard::Minitest 2.3.0 is running, with Minitest::Unit 4.7.5!
19:11:57 - INFO - Guard::RSpec is running
19:11:57 - INFO - Bundle already up-to-date
19:11:57 - INFO - Guard is now watching at '/home/adam/rails/myapp'
Frame number: 0/0
[1] guard(main)> minitest
19:12:00 - INFO - Run Minitest
19:12:00 - INFO - Running: all tests
Warning: You're using Rubygems 1.8.25 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.
Run options: -n spec/models/person_spec.rb --seed 5542
# Running tests:
Finished tests in 0.011478s, 0.0000 tests/s, 0.0000 assertions/s.
0 tests, 0 assertions, 0 failures, 0 errors, 0 skips
Coverage report generated for Functional Tests, RSpec to /home/adam/rails/myapp/coverage. 833 / 912 LOC (91.34%) covered.
@davidmles I was able to get this working, but I need a sanity check. I needed the spring.rb config file pointing to the dummy app along with a change to the spring command. Can you try to run this again, but with spring: 'bundle exec spring rake test'
as the spring command in the Guardfile? Also any output from bundle exec guard --debug
would be helpful.
Spring.application_root = './test/dummy'
guard :minitest, spring: 'bundle exec spring rake test' do
I have a hunch that there is some command gobbling up actual errors instead of raising them, which causes zero tests to be run here and #97.
I'd welcome any theories/suggestions/pull requests.
Not sure if it helps anyone, but with Rails 4.1.6, it seems to work out of the box. I just added spring: true
to my Guardfile
and it worked. Correct tests are run when a file is modified and it does seem to start faster than without Spring.
My setup: Ruby 2.1, Rails 4.1.6, Guard 2.6.0, guard-minitest 2.3.2, Spring 1.1.3, minitest 5.4.2.
It also seems to be working fine with rails 4.2, ruby 2.1.5, Guard 2.10.5, guard-minitest 2.3.2, spring 1.2.0, and minitest 5.5.0. It might be okay to close this issue now.
If anyone can create a GH repo reproducing this, I would look into it.
Just tested this in a Rails engine. Here is GH repo reproducing the problem
spring: 'bundle exec spring rake test'
works
but spring: true
does not work.
Versions in use: rails-4.2.0 spring-1.2.0 minitest-5.5.1 guard-2.11.1 guard-minitest-2.3.2
It's because bin/rake
doesn't exist...
There should be a message in guard-minitest for this. I'll try and cook something up.
I've released guard-minitest 2.4.2, which shows an error in this scenario (instead of a silent failure).
So, I'm closing this.
Let me know if there are any other issues.
@bikramwp - thanks so much for the repo to reproduce this. I wouldn't have worked this out without it.
@e2 Good find and good fix. Thanks for picking this one back up.
@genericsteele - I don't know if Errno::ENOENT is a good choice. But it was the least confusing that I could think of.
For some reason this issue occurs if there is spec
folder along with the test
one. I was migrating from rspec to minitest and I was trying to solve this issue but I gave up. Anyway, as soon as I renamed the spec
folder the issue was fixed... weird.
Guard-minitest does not seem to work with spring in a Rails 4 engine.
Steps to reproduce it:
Here it runs the test/example_test.rb sample test successfully:
Now when editing Guardfile and changing
guard :minitest do
toguard :minitest, spring: true do
, the test is not run anymore:Nothing is run.
...does not help either.