Trying to get autotest working again

7 views
Skip to first unread message

Jack R-G

unread,
Jul 29, 2019, 10:58:56 AM7/29/19
to rspec
I started a project about 8 years ago and was using RSpec and autotest. For reasons not important to this discussion, I stopped using both of them after a year or two. Now I want to resume using them and am having problems getting them working again. RSpec is working just fine (that is, when I run it it runs my tests), but I can't get autotest to work. I've done a few things to try to get it to work, but currently when I type "autotest" I get 

loading autotest/rails_rspec2

/Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `require': cannot load such file -- autotest/growl (LoadError)


I've done a "bundle install" and "bundle update", so I believe I have the "best" versions that I can have.

My Gemfile looks like:
  ...
  gem 'ZenTest'
  gem 'shoulda-matchers'
  gem 'webrat', '0.7.1'
  gem 'factory_girl_rails'
  gem 'autotest-growl'
  gem 'autotest-fsevent'
  ...

Gemfile.lock shows that I've got 
  ZenTest (4.11.2)
  autotest-fsevent (0.2.14)
  autotest-growl (0.2.16)

With all that seems to have happened since then (ZenTest separating out growl, OS X no longer requiring growl, etc.) I'm really kinda lost as to where my system should be.

Oh, and I should have said earlier: Ruby 2.0, Rails 3.2 (the reason I'm trying to re-integrate RSpec is that I now need to migrate to newer versions of Ruby and Rails). I can't even really figure out where to go for help with this, so if someone knows a better forum than here for the question, please let me know.

Thanks!

Jon Rowe

unread,
Jul 29, 2019, 11:02:10 AM7/29/19
to rs...@googlegroups.com
Honestly I’d start by stripping it back to a minimal implementation, you shouldn’t need growl for it to work, you could also consider finding a replacement test watcher, I know Guard came after auto test, but I’m not sure if theres anything newer!

Jon Rowe
---------------------------

Jack R-G

unread,
Jul 29, 2019, 8:15:47 PM7/29/19
to rspec
Easier said than done, I think. Are you suggesting that I focus on minimizing my existing project, or are you suggesting that I focus on trying to get autotest working with a new, dummy project with minimal code? 

Also, do you have a solution that you like for CI on a personal development system - autotest was so simple to use (when I started using it), and I can't imagine doing the work to setup up one of the bigger commercial CI solutions like Jenkins or Travis.

I got further (maybe) by removing some of the gem references from my Gemfile (autoest-fsevent, autotest-growl) and replacing them with just "autotest". I then did "bundle install". When I now run autotest, I get the following:

/Users/jackrg/.rbenv/versions/2.0.0-p576/bin/ruby -I.:lib:test -e "gem 'minitest'; %w[minitest/autorun test/performance/browsing_test.rb test/test_helper.rb test/unit/test_webhooks.rb].each { |f| require f }" -- --server 70284

/Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/mocha-0.10.5/lib/mocha/integration/mini_test.rb:22:in `remove_method': method `run' not defined in Minitest::Unit::TestCase (NameError)

from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/mocha-0.10.5/lib/mocha/integration/mini_test.rb:22:in `<class:TestCase>'

from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/mocha-0.10.5/lib/mocha/integration/mini_test.rb:17:in `<class:Unit>'

from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/mocha-0.10.5/lib/mocha/integration/mini_test.rb:16:in `<module:MiniTest>'

and

Unhandled exception: undefined method `results' for #<Autotest:0x007f9b4b06fa20>

/Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/autotest-growl-0.2.16/lib/autotest/result.rb:7:in `initialize'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/autotest-growl-0.2.16/lib/autotest/growl.rb:138:in `new'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/autotest-growl-0.2.16/lib/autotest/growl.rb:138:in `block in <module:Growl>'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/minitest-autotest-1.1.1/lib/autotest.rb:725:in `[]'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/minitest-autotest-1.1.1/lib/autotest.rb:725:in `block in hook'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/minitest-autotest-1.1.1/lib/autotest.rb:725:in `each'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/minitest-autotest-1.1.1/lib/autotest.rb:725:in `any?'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/minitest-autotest-1.1.1/lib/autotest.rb:725:in `hook'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/minitest-autotest-1.1.1/lib/autotest.rb:314:in `run_tests'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/minitest-autotest-1.1.1/lib/autotest.rb:292:in `get_to_green'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/minitest-autotest-1.1.1/lib/autotest.rb:263:in `block in run'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/minitest-autotest-1.1.1/lib/autotest.rb:261:in `loop'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/minitest-autotest-1.1.1/lib/autotest.rb:261:in `run'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/minitest-autotest-1.1.1/lib/autotest.rb:152:in `run'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/minitest-autotest-1.1.1/bin/autotest:5:in `<top (required)>'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/bin/autotest:25:in `load'

  /Users/jackrg/.rbenv/versions/2.0.0-p576/bin/autotest:25:in `<main>'


Any thoughts about these errors?

Jack R-G

unread,
Jul 29, 2019, 8:20:12 PM7/29/19
to rspec
BTW, I didn't thank you for your response, Jon. I appreciate you sharing your expertise.

Jon Rowe

unread,
Aug 1, 2019, 3:24:31 AM8/1/19
to rs...@googlegroups.com
Hi Jack

I’m suggesting you focus on getting a minimal auto test configuration working before adding bits like growl etc :) Your errors now look like it’s getting confused with minutest. I would seriously recommend trying guard instead if you want to just run tour tests when files change!

Autotest is not really a CI tool, it’s just a way of running your tests when files change, so its completely different to a “commercial CI solution”, you don’t need a CI solution if its just you working on your project in my opinion.

Cheers
Jon Rowe
---------------------------

Jack Royal-Gordon

unread,
Aug 1, 2019, 8:09:05 PM8/1/19
to rs...@googlegroups.com
Hi Jon,

I tried Guard but ended up in dependency hell — kept loading things that said they needed Ruby 2.2 or later. After the fourth or fifth one, I gave up. For now, I’m concentrating on just RSpec and not worrying about autotest (I’ll keep trying both autotest and Guard as I migrate up to the more recent versions  of Ruby/Rails).

Thanks for your help on this.

Jack

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/dejalu-217-d111c00f-7926-4d6c-8ab2-aa8a0518aacd%40jonrowe.co.uk.

Jack Royal-Gordon

unread,
Aug 2, 2019, 2:40:23 AM8/2/19
to rs...@googlegroups.com
Solved it. Do you know about hearing hoofbeats and thinking you’re hearing zebras instead of horses? I was looking for a problem with the configuration or upgraded versions or something arcane when in reality it was because I made a code change that caused all the tests to fail (redirecting requests that were made to a bare domain (no “www.”) to the canonical (www.) domain. Ugh!

Thanks for your help.

Jack Royal-Gordon

unread,
Aug 2, 2019, 2:42:27 AM8/2/19
to rs...@googlegroups.com
This comment was made on the wrong question.

Reply all
Reply to author
Forward
0 new messages