ngauthier / hydra

Distributed testing framework
MIT License
389 stars 63 forks source link

Hydra and RSpec 2 beta not returning anything #20

Closed heimidal closed 14 years ago

heimidal commented 14 years ago

When running specs with Hydra, nothing is returned. The exit status code is not set, and no output is returned when a spec fails:

[1] ‡ RAILS_ENV=test rake hydra:spec
(in /Users/brianrose/Projects/protosite)
DEPRECATION WARNING: RAILS_ENV is deprecated. Please use ::Rails.env. (called from call at /Users/brianrose/.rvm/gems/ruby-1.8.7-p174@protosite/gems/rake-0.8.7/lib/rake.rb:636)
Hydra Testing [##############################>] 84/84

If I run 'rake spec', I have a failing spec. Any idea what might be going on?

I'm running Hydra 0.22.1 and RSpec 2.0.0.beta.20.

ngauthier commented 14 years ago

Can you try two things for me:

1) Show me the output of: rspec path/to/failing/file

2) Create a hydra testtask with just the one failing file in it. Then set "t.verbose = true" in the test task and run the hydra task.

-Nick

heimidal commented 14 years ago

Output of rspec spec/models/content_spec.rb:

.F....................

Failures:
  1) Content with out a thread local user versioning should be true
     Failure/Error: false.should be_true
     expected false to be true
     # ./spec/models/content_spec.rb:15
     # ./vendor/bundle/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `inject'

Finished in 4.49 seconds
22 examples, 1 failure

And running RAILS_ENV=test rake hydra:test using this task:

Hydra::TestTask.new('hydra:test') do |t|
  require 'spec/spec_helper'
  t.add_files 'spec/models/content_spec.rb'
  t.verbose = true
end

...outputs the following:

(in /Users/brianrose/Projects/protosite)
1283894815.82826 MASTER| Initialized
1283894815.8283 MASTER|   Files:   (["spec/models/content_spec.rb"])
1283894815.82832 MASTER|   Workers: ([{"type"=>"local", "runners"=>4}])
1283894815.82834 MASTER|   Verbose: (true)
Hydra Testing [>                              ] 0/11283894815.82843 MASTER| Booting 1 workers
1283894815.82845 MASTER| worker opts {"type"=>"local", "runners"=>4}
1283894815.82847 MASTER| Booting local worker
1283894815.831 MASTER| Processing Messages
1283894815.83139 MASTER| Workers: [{:type=>:local, :idle=>false, :pid=>93829, :io=>#<Hydra::Pipe @reader=#<IO:0x105209b98>, @writer=#<IO:0x105209c38>>}]
1283894815.83186 MASTER| Listening to {:type=>:local, :idle=>false, :pid=>93829, :io=>#<Hydra::Pipe @reader=#<IO:0x105209b98>, @writer=#<IO:0x105209c38>>}
1283894815.83546 WORKER| hydra_worker_init.rb not present
1283894815.83568 WORKER| Booting 4 Runners
1283894815.84135 WORKER| 4 Runners booted
1283894815.84187 WORKER| Processing Messages
1283894815.84283 MASTER| got message: #<Hydra::Messages::Worker::WorkerBegin:0x1052079b0>
1283894815.84513 RUNNER| Booted. Sending Request for file
1283894815.84513 RUNNER| Booted. Sending Request for file
1283894815.84539 RUNNER| Booted. Sending Request for file
1283894815.84574 RUNNER| Processing Messages
1283894815.84593 RUNNER| Processing Messages
1283894815.8462 RUNNER| Processing Messages
1283894815.84636 WORKER| Received Message from Runner
1283894815.84649 WORKER| Received Message from Runner
1283894815.84661 WORKER| Received Message from Runner
1283894815.84677 WORKER|    #<Hydra::Messages::Runner::RequestFile:0x105202668>
1283894815.84683 WORKER|    #<Hydra::Messages::Runner::RequestFile:0x1052022d0>
1283894815.84687 WORKER|    #<Hydra::Messages::Runner::RequestFile:0x105201f38>
1283894815.84763 MASTER| got message: #<Hydra::Messages::Worker::RequestFile:0x105207618>
1283894815.84774 MASTER| Sending "spec/models/content_spec.rb"
1283894815.84794 MASTER| got message: #<Hydra::Messages::Worker::RequestFile:0x105206e98>
1283894815.84798 MASTER| No more files to send
1283894815.84804 MASTER| got message: #<Hydra::Messages::Worker::RequestFile:0x105206a60>
1283894815.84809 MASTER| No more files to send
1283894815.8484 WORKER| Received Message from Master
1283894815.84852 WORKER|    #<Hydra::Messages::Master::RunFile:0x105201060 @file="spec/models/content_spec.rb">
1283894815.84963 RUNNER| Received message from worker
1283894815.84971 RUNNER|    #<Hydra::Messages::Worker::RunFile:0x105206740 @file="spec/models/content_spec.rb">
1283894815.84977 RUNNER| Running file: spec/models/content_spec.rb
1283894815.85202 RUNNER| Booted. Sending Request for file
1283894815.85271 RUNNER| Processing Messages
1283894815.85294 WORKER| Received Message from Runner
1283894815.85298 WORKER|    #<Hydra::Messages::Runner::RequestFile:0x1052004d0>
1283894815.85319 MASTER| got message: #<Hydra::Messages::Worker::RequestFile:0x105206628>
1283894815.85323 MASTER| No more files to send
1283894820.86268 WORKER| Received Message from Runner
1283894820.8628 WORKER|     #<Hydra::Messages::Runner::Results:0x1051ffcb0 @file="spec/models/content_spec.rb", @output=".">
1283894820.86336 MASTER| got message: #<Hydra::Messages::Worker::Results:0x105206010>
1283894820.86347 MASTER| 0 Files Remaining
Hydra Testing [##############################>] 1/11283894820.86393 MASTER| Shutting down all workers
1283894820.86415 WORKER| Received Message from Master
1283894820.8642 WORKER|     #<Hydra::Messages::Master::Shutdown:0x1051feef0>
Hydra Testing [###############1283894820.86427 WORKER| Notifying 4 Runners of Shutdown
###############>1283894820.86431 WORKER| Sending Shutdown to Runner
] 1/1
1283894820.86463 WORKER|    {:idle=>true, :pid=>93830, :io=>#<Hydra::Pipe @reader=#<IO:0x105208158>, @writer=#<IO:0x1052081d0>>}
1283894820.86473 WORKER| Sending Shutdown to Runner
1283894820.86485 RUNNER| Received message from worker
1283894820.86485 WORKER|    {:idle=>true, :pid=>93831, :io=>#<Hydra::Pipe @reader=#<IO:0x105206d08>, @writer=#<IO:0x105206d80>>}
1283894820.8649 RUNNER|     #<Hydra::Messages::Worker::Shutdown:0x104fbaba8>
1283894820.86492 WORKER| Sending Shutdown to Runner
1283894820.86511 WORKER|    {:idle=>true, :pid=>93832, :io=>#<Hydra::Pipe @reader=#<IO:0x105205980>, @writer=#<IO:0x1052059f8>>}
1283894820.86518 WORKER| Sending Shutdown to Runner
1283894820.86548 WORKER|    {:idle=>true, :pid=>93833, :io=>#<Hydra::Pipe @reader=#<IO:0x1052044b8>, @writer=#<IO:0x105204530>>}
1283894820.86619 RUNNER| Received message from worker
1283894820.86628 RUNNER|    #<Hydra::Messages::Worker::Shutdown:0x1052054a8>
1283894820.86739 RUNNER| Received message from worker
1283894820.86774 RUNNER|    #<Hydra::Messages::Worker::Shutdown:0x105203f90>
1283894820.86819 RUNNER| Received message from worker
1283894820.86837 RUNNER|    #<Hydra::Messages::Worker::Shutdown:0x105202c58>
1283894821.21543 WORKER| Done processing messages

I hope that helps. :)

ngauthier commented 14 years ago

OK, this narrows it down. It shows that hydra is functioning properly and that it is actually running the file and getting a passing result back.

At this point, we're going to need to look at your code. If possible, please try to create a minimal example of what is failing. You can do this by making a copy of the file and deleting code to figure out what part of it is passing / failing. Once you get a minimal example, please paste it @ gist.github.com and I'll check it out.

-Nick

heimidal commented 14 years ago

That's strange -- the failing example just contains 'false.should be_true'. When I am near a computer, I'll remove all of the other specs so that only that one is in the file and let you know the result.

johnae commented 14 years ago

I've got the same issue. I have a deliberately failing spec and nothing is returned from Hydra but rake spec works properly. I'm on the latest rspec and rails 3.

ngauthier commented 14 years ago

Hey guys, can you make a minimal example of this issue? Maybe create a git repo of rails 3 w/ rspec 2 and hydra and a failing spec that does not fail in hydra? That would help me a ton in tracking down this bug.

johnae commented 14 years ago

Here's a repo with a failing hydra: http://github.com/johnae/Hydra-fails-to-report-failing-spec

ngauthier commented 14 years ago

Thanks! I will check this out.

zenom commented 14 years ago

I don't get any results back either as far as the final status of all the tests. I am using Padrino with rspec 2.0.0.beta.20. I thought I was missing something in a config until I checked the issues here.

ngauthier commented 14 years ago

http://gist.github.com/577300

It's a version issue. Seems rspec changed some things between beta19 and beta20-22.

I'm going to add a section to the wiki page "Why isn't it working" that will refer people to the correct gem versions.

Also, in general it's probably a bad idea to point gems in the Gemfile to github urls, unless you need a bleeding-edge commit. In that case, you should add the :ref key to lock it to a version. Instead, you should lock to a specific gem version.

-Nick