Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Problems running tests #5

Open
joevandyk opened this Issue · 5 comments

2 participants

@joevandyk
  [joe@laptop.local:~/projects/cloudist(master)]  $ rake
WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /Users/joe/.rvm/gems/ree-1.8.7-2011.03@n2/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
/Users/joe/.rvm/rubies/ree-1.8.7-2011.03/bin/ruby -S bundle exec rspec spec/cloudist/basic_queue_spec.rb spec/cloudist/job_spec.rb spec/cloudist/message_spec.rb spec/cloudist/messaging_spec.rb spec/cloudist/payload_spec.rb spec/cloudist/payload_spec_2_spec.rb spec/cloudist/queue_spec.rb spec/cloudist/request_spec.rb spec/cloudist/utils_spec.rb spec/cloudist_spec.rb spec/core_ext/string_spec.rb
F.....FFFFFF.FFFFF.F.F........F...Prefetch: 1
FPrefetch: 1
FPrefetch: 1
FPrefetch: 1
FPrefetch: 1
FPrefetch: 1
F......

Failures:

  1) Cloudist Cloudist::Queues::BasicQueue should create a queue and exchange
     Failure/Error: bq = Cloudist::Queues::BasicQueue.new("make.sandwich")
     RuntimeError:
       AMQP can only be used from within EM.run {}
     # ./spec/../lib/cloudist/queues/basic_queue.rb:35:in `new'
     # ./spec/../lib/cloudist/queues/basic_queue.rb:35:in `setup'
     # ./spec/../lib/cloudist/queues/basic_queue.rb:25:in `initialize'
     # ./spec/cloudist/basic_queue_spec.rb:19:in `new'
     # ./spec/cloudist/basic_queue_spec.rb:19

  2) Cloudist::Payload should extract published_on from data
     Failure/Error: payload.headers['published_on'].should == "12345678"
       expected: "12345678"
            got: 1321297561.04786 (using ==)
     # ./spec/cloudist/payload_spec.rb:29

  3) Cloudist::Payload should extract custom event hash from data
     Failure/Error: payload.body.should == {:bread=>"white"}
       expected: {:bread=>"white"}
            got: <#Hashie::Mash bread="white" event_hash="foo"> (using ==)
       Diff:
       @@ -1,2 +1,2 @@
       -{:bread=>"white"}
       +{"event_hash"=>"foo", "bread"=>"white"}
     # ./spec/cloudist/payload_spec.rb:34

  4) Cloudist::Payload should parse JSON message
     Failure/Error: payload = Cloudist::Payload.new(Marshal.dump({:bread => 'white', :event_hash => 'foo'}))
     JSON::ParserError:
       705: unexpected token at {:event_hashfoo:
       bread"
       white'
     # ./spec/../lib/cloudist/encoding.rb:13:in `decode'
     # ./spec/../lib/cloudist/payload.rb:12:in `initialize'
     # ./spec/cloudist/payload_spec.rb:39:in `new'
     # ./spec/cloudist/payload_spec.rb:39

  5) Cloudist::Payload should parse custom headers
     Failure/Error: payload = Cloudist::Payload.new(Marshal.dump({:bread => 'white', :event_hash => 'foo'}), {:published_on => 12345})
     JSON::ParserError:
       705: unexpected token at {:event_hashfoo:
       bread"
       white'
     # ./spec/../lib/cloudist/encoding.rb:13:in `decode'
     # ./spec/../lib/cloudist/payload.rb:12:in `initialize'
     # ./spec/cloudist/payload_spec.rb:44:in `new'
     # ./spec/cloudist/payload_spec.rb:44

  6) Cloudist::Payload should create a unique event hash
     Failure/Error: payload.create_event_hash.size.should == 32
     NoMethodError:
       undefined method `create_event_hash' for #<Cloudist::Payload:0x107893048>
     # ./spec/../lib/cloudist/payload.rb:86:in `method_missing'
     # ./spec/cloudist/payload_spec.rb:50

  7) Cloudist::Payload should not create a new event hash unless it doesn't have one
     Failure/Error: payload.event_hash.size.should == 32
     NoMethodError:
       undefined method `event_hash' for #<Cloudist::Payload:0x10788f3a8>
     # ./spec/../lib/cloudist/payload.rb:86:in `method_missing'
     # ./spec/cloudist/payload_spec.rb:55

  8) Cloudist::Payload should format payload for sending
     Failure/Error: body.should == Marshal.dump({:bread => 'white'})
       expected: "\004\b{\006:\nbread\"\nwhite"
            got: "{\"bread\":\"white\"}" (using ==)
       Diff:
       @@ -1,4 +1,2 @@
       {:
       -bread"
       -white
       +{"bread":"white"}
     # ./spec/cloudist/payload_spec.rb:70

  9) Cloudist::Payload should generate a unique payload ID
     Failure/Error: payload.id.size.should == 32
       expected: 32
            got: 36 (using ==)
     # ./spec/cloudist/payload_spec.rb:77

  10) Cloudist::Payload should allow setting of payload ID
     Failure/Error: payload.id = "2345"
     NoMethodError:
       undefined method `id=' for #<Cloudist::Payload:0x10787d2e8>
     # ./spec/../lib/cloudist/payload.rb:86:in `method_missing'
     # ./spec/cloudist/payload_spec.rb:82

  11) Cloudist::Payload should allow changing of payload after being published
     Failure/Error: payload.publish
     NoMethodError:
       undefined method `publish' for #<Cloudist::Payload:0x10787a610>
     # ./spec/../lib/cloudist/payload.rb:86:in `method_missing'
     # ./spec/cloudist/payload_spec.rb:88

  12) Cloudist::Payload should freeze
     Failure/Error: payload.publish
     NoMethodError:
       undefined method `publish' for #<Cloudist::Payload:0x107875db8>
     # ./spec/../lib/cloudist/payload.rb:86:in `method_missing'
     # ./spec/cloudist/payload_spec.rb:96

  13) Cloudist::Payload should not overwrite passed in headers
     Failure/Error: payload.headers[:ttl].should == "25"
       expected: "25"
            got: 25 (using ==)
     # ./spec/cloudist/payload_spec.rb:114

  14) Cloudist::Payload should be able to transport an error
     Failure/Error: payload = Cloudist::Payload.new(e, {:message_type => 'error'})
     NoMethodError:
       undefined method `each_pair' for #<ArgumentError: FAILED>
     # ./spec/../lib/cloudist/payload.rb:13:in `new'
     # ./spec/../lib/cloudist/payload.rb:13:in `initialize'
     # ./spec/cloudist/payload_spec.rb:127:in `new'
     # ./spec/cloudist/payload_spec.rb:127

  15) Cloudist::Payload should parse custom headers
     Failure/Error: payload = Cloudist::Payload.new(Marshal.dump({:bread => 'white'}), {:published_on => 12345, :message_id => "foo"})
     JSON::ParserError:
       705: unexpected token at {:
       bread"
       white'
     # ./spec/../lib/cloudist/encoding.rb:13:in `decode'
     # ./spec/../lib/cloudist/payload.rb:12:in `initialize'
     # ./spec/cloudist/payload_spec_2_spec.rb:50:in `new'
     # ./spec/cloudist/payload_spec_2_spec.rb:50

  16) Cloudist::Request should return ttl
     Failure/Error: q = Cloudist::JobQueue.new('test.queue')
     RuntimeError:
       AMQP can only be used from within EM.run {}
     # ./spec/../lib/cloudist/queues/basic_queue.rb:35:in `new'
     # ./spec/../lib/cloudist/queues/basic_queue.rb:35:in `setup'
     # ./spec/../lib/cloudist/queues/basic_queue.rb:25:in `initialize'
     # ./spec/../lib/cloudist/queues/job_queue.rb:10:in `initialize'
     # ./spec/cloudist/request_spec.rb:8:in `new'
     # ./spec/cloudist/request_spec.rb:8

  17) Cloudist::Request should have a payload
     Failure/Error: q = Cloudist::JobQueue.new('test.queue')
     RuntimeError:
       AMQP can only be used from within EM.run {}
     # ./spec/../lib/cloudist/queues/basic_queue.rb:35:in `new'
     # ./spec/../lib/cloudist/queues/basic_queue.rb:35:in `setup'
     # ./spec/../lib/cloudist/queues/basic_queue.rb:25:in `initialize'
     # ./spec/../lib/cloudist/queues/job_queue.rb:10:in `initialize'
     # ./spec/cloudist/request_spec.rb:8:in `new'
     # ./spec/cloudist/request_spec.rb:8

  18) Cloudist::Request should be 1 minute old
     Failure/Error: q = Cloudist::JobQueue.new('test.queue')
     RuntimeError:
       AMQP can only be used from within EM.run {}
     # ./spec/../lib/cloudist/queues/basic_queue.rb:35:in `new'
     # ./spec/../lib/cloudist/queues/basic_queue.rb:35:in `setup'
     # ./spec/../lib/cloudist/queues/basic_queue.rb:25:in `initialize'
     # ./spec/../lib/cloudist/queues/job_queue.rb:10:in `initialize'
     # ./spec/cloudist/request_spec.rb:8:in `new'
     # ./spec/cloudist/request_spec.rb:8

  19) Cloudist::Request should not be expired
     Failure/Error: q = Cloudist::JobQueue.new('test.queue')
     RuntimeError:
       AMQP can only be used from within EM.run {}
     # ./spec/../lib/cloudist/queues/basic_queue.rb:35:in `new'
     # ./spec/../lib/cloudist/queues/basic_queue.rb:35:in `setup'
     # ./spec/../lib/cloudist/queues/basic_queue.rb:25:in `initialize'
     # ./spec/../lib/cloudist/queues/job_queue.rb:10:in `initialize'
     # ./spec/cloudist/request_spec.rb:8:in `new'
     # ./spec/cloudist/request_spec.rb:8

  20) Cloudist::Request should not be acked yet
     Failure/Error: q = Cloudist::JobQueue.new('test.queue')
     RuntimeError:
       AMQP can only be used from within EM.run {}
     # ./spec/../lib/cloudist/queues/basic_queue.rb:35:in `new'
     # ./spec/../lib/cloudist/queues/basic_queue.rb:35:in `setup'
     # ./spec/../lib/cloudist/queues/basic_queue.rb:25:in `initialize'
     # ./spec/../lib/cloudist/queues/job_queue.rb:10:in `initialize'
     # ./spec/cloudist/request_spec.rb:8:in `new'
     # ./spec/cloudist/request_spec.rb:8

  21) Cloudist::Request should be ackable
     Failure/Error: q = Cloudist::JobQueue.new('test.queue')
     RuntimeError:
       AMQP can only be used from within EM.run {}
     # ./spec/../lib/cloudist/queues/basic_queue.rb:35:in `new'
     # ./spec/../lib/cloudist/queues/basic_queue.rb:35:in `setup'
     # ./spec/../lib/cloudist/queues/basic_queue.rb:25:in `initialize'
     # ./spec/../lib/cloudist/queues/job_queue.rb:10:in `initialize'
     # ./spec/cloudist/request_spec.rb:8:in `new'
     # ./spec/cloudist/request_spec.rb:8

Finished in 0.02376 seconds
46 examples, 21 failures
rake aborted!
ruby -S bundle exec rspec spec/cloudist/basic_queue_spec.rb spec/cloudist/job_spec.rb spec/cloudist/message_spec.rb spec/cloudist/messaging_spec.rb spec/cloudist/payload_spec.rb spec/cloudist/payload_spec_2_spec.rb spec/cloudist/queue_spec.rb spec/cloudist/request_spec.rb spec/cloudist/utils_spec.rb spec/cloudist_spec.rb spec/core_ext/string_spec.rb failed

Tasks: TOP => default => spec
(See full trace by running task with --trace)

Could be my environment? Ruby 1.9.2 on OSX, using rabbitmq 2.5.1.

Also, have you looked at using travis-ci? I think they support rabbitmq.

@joevandyk

Son of a bitch, nevermind. I was actually using 1.8.7 here. 'rvm info' lied to me.

@joevandyk

I get different errors when using 1.9.2:


 rake
WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /Users/joe/.rvm/gems/ruby-1.9.2-p180-good/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
/Users/joe/.rvm/rubies/ruby-1.9.2-p180-good/bin/ruby -S bundle exec rspec spec/cloudist/basic_queue_spec.rb spec/cloudist/job_spec.rb spec/cloudist/message_spec.rb spec/cloudist/messaging_spec.rb spec/cloudist/payload_spec.rb spec/cloudist/payload_spec_2_spec.rb spec/cloudist/queue_spec.rb spec/cloudist/request_spec.rb spec/cloudist/utils_spec.rb spec/cloudist_spec.rb spec/core_ext/string_spec.rb
F.....FFFFFF.FFFFF.F.F........F...Prefetch: 1
FPrefetch: 1
FPrefetch: 1
FPrefetch: 1
FPrefetch: 1
FPrefetch: 1
F......

Failures:

  1) Cloudist Cloudist::Queues::BasicQueue should create a queue and exchange
     Failure/Error: bq = Cloudist::Queues::BasicQueue.new("make.sandwich")
     RuntimeError:
       AMQP can only be used from within EM.run {}
     # ./lib/cloudist/queues/basic_queue.rb:35:in `new'
     # ./lib/cloudist/queues/basic_queue.rb:35:in `setup'
     # ./lib/cloudist/queues/basic_queue.rb:25:in `initialize'
     # ./spec/cloudist/basic_queue_spec.rb:19:in `new'
     # ./spec/cloudist/basic_queue_spec.rb:19:in `block (3 levels) in <top (required)>'

  2) Cloudist::Payload should extract published_on from data
     Failure/Error: payload.headers['published_on'].should == "12345678"
       expected: "12345678"
            got: 1321297784.720095 (using ==)
     # ./spec/cloudist/payload_spec.rb:29:in `block (2 levels) in <top (required)>'

  3) Cloudist::Payload should extract custom event hash from data
     Failure/Error: payload.body.should == {:bread=>"white"}
       expected: {:bread=>"white"}
            got: <#Hashie::Mash bread="white" event_hash="foo"> (using ==)
       Diff:
       @@ -1,2 +1,2 @@
       -{:bread=>"white"}
       +{"bread"=>"white", "event_hash"=>"foo"}
     # ./spec/cloudist/payload_spec.rb:34:in `block (2 levels) in <top (required)>'

  4) Cloudist::Payload should parse JSON message
     Failure/Error: payload = Cloudist::Payload.new(Marshal.dump({:bread => 'white', :event_hash => 'foo'}))
     JSON::ParserError:
       705: unexpected token at {:
       breadI"
       white:EF:event_hashIfoo;F'
     # ./lib/cloudist/encoding.rb:13:in `decode'
     # ./lib/cloudist/payload.rb:12:in `initialize'
     # ./spec/cloudist/payload_spec.rb:39:in `new'
     # ./spec/cloudist/payload_spec.rb:39:in `block (2 levels) in <top (required)>'

  5) Cloudist::Payload should parse custom headers
     Failure/Error: payload = Cloudist::Payload.new(Marshal.dump({:bread => 'white', :event_hash => 'foo'}), {:published_on => 12345})
     JSON::ParserError:
       705: unexpected token at {:
       breadI"
       white:EF:event_hashIfoo;F'
     # ./lib/cloudist/encoding.rb:13:in `decode'
     # ./lib/cloudist/payload.rb:12:in `initialize'
     # ./spec/cloudist/payload_spec.rb:44:in `new'
     # ./spec/cloudist/payload_spec.rb:44:in `block (2 levels) in <top (required)>'

  6) Cloudist::Payload should create a unique event hash
     Failure/Error: payload.create_event_hash.size.should == 32
     NoMethodError:
       undefined method `create_event_hash' for #<Cloudist::Payload:0x007f99333a3198>
     # ./lib/cloudist/payload.rb:86:in `method_missing'
     # ./spec/cloudist/payload_spec.rb:50:in `block (2 levels) in <top (required)>'

  7) Cloudist::Payload should not create a new event hash unless it doesn't have one
     Failure/Error: payload.event_hash.size.should == 32
     NoMethodError:
       undefined method `event_hash' for #<Cloudist::Payload:0x007f99333a1cd0>
     # ./lib/cloudist/payload.rb:86:in `method_missing'
     # ./spec/cloudist/payload_spec.rb:55:in `block (2 levels) in <top (required)>'

  8) Cloudist::Payload should format payload for sending
     Failure/Error: body.should == Marshal.dump({:bread => 'white'})
       expected: "\x04\b{\x06:\nbreadI\"\nwhite\x06:\x06EF"
            got: "{\"bread\":\"white\"}" (using ==)
       Diff:
       @@ -1,4 +1,2 @@
       {:
       -breadI"
       -white:EF
       +{"bread":"white"}
     # ./spec/cloudist/payload_spec.rb:70:in `block (2 levels) in <top (required)>'

  9) Cloudist::Payload should generate a unique payload ID
     Failure/Error: payload.id.size.should == 32
       expected: 32
            got: 36 (using ==)
     # ./spec/cloudist/payload_spec.rb:77:in `block (2 levels) in <top (required)>'

  10) Cloudist::Payload should allow setting of payload ID
     Failure/Error: payload.id = "2345"
     NoMethodError:
       undefined method `id=' for #<Cloudist::Payload:0x007f993339a700>
     # ./lib/cloudist/payload.rb:86:in `method_missing'
     # ./spec/cloudist/payload_spec.rb:82:in `block (2 levels) in <top (required)>'

  11) Cloudist::Payload should allow changing of payload after being published
     Failure/Error: payload.publish
     NoMethodError:
       undefined method `publish' for #<Cloudist::Payload:0x007f9933398db0>
     # ./lib/cloudist/payload.rb:86:in `method_missing'
     # ./spec/cloudist/payload_spec.rb:88:in `block (2 levels) in <top (required)>'

  12) Cloudist::Payload should freeze
     Failure/Error: payload.publish
     NoMethodError:
       undefined method `publish' for #<Cloudist::Payload:0x007f99333975f0>
     # ./lib/cloudist/payload.rb:86:in `method_missing'
     # ./spec/cloudist/payload_spec.rb:96:in `block (2 levels) in <top (required)>'

  13) Cloudist::Payload should not overwrite passed in headers
     Failure/Error: payload.headers[:ttl].should == "25"
       expected: "25"
            got: 25 (using ==)
     # ./spec/cloudist/payload_spec.rb:114:in `block (2 levels) in <top (required)>'

  14) Cloudist::Payload should be able to transport an error
     Failure/Error: payload = Cloudist::Payload.new(e, {:message_type => 'error'})
     NoMethodError:
       undefined method `each_pair' for #<ArgumentError: FAILED>
     # ./lib/cloudist/payload.rb:13:in `new'
     # ./lib/cloudist/payload.rb:13:in `initialize'
     # ./spec/cloudist/payload_spec.rb:127:in `new'
     # ./spec/cloudist/payload_spec.rb:127:in `block (2 levels) in <top (required)>'

  15) Cloudist::Payload should parse custom headers
     Failure/Error: payload = Cloudist::Payload.new(Marshal.dump({:bread => 'white'}), {:published_on => 12345, :message_id => "foo"})
     JSON::ParserError:
       705: unexpected token at {:
       breadI"
       white:EF'
     # ./lib/cloudist/encoding.rb:13:in `decode'
     # ./lib/cloudist/payload.rb:12:in `initialize'
     # ./spec/cloudist/payload_spec_2_spec.rb:50:in `new'
     # ./spec/cloudist/payload_spec_2_spec.rb:50:in `block (2 levels) in <top (required)>'

  16) Cloudist::Request should return ttl
     Failure/Error: q = Cloudist::JobQueue.new('test.queue')
     RuntimeError:
       AMQP can only be used from within EM.run {}
     # ./lib/cloudist/queues/basic_queue.rb:35:in `new'
     # ./lib/cloudist/queues/basic_queue.rb:35:in `setup'
     # ./lib/cloudist/queues/basic_queue.rb:25:in `initialize'
     # ./lib/cloudist/queues/job_queue.rb:10:in `initialize'
     # ./spec/cloudist/request_spec.rb:8:in `new'
     # ./spec/cloudist/request_spec.rb:8:in `block (2 levels) in <top (required)>'

  17) Cloudist::Request should have a payload
     Failure/Error: q = Cloudist::JobQueue.new('test.queue')
     RuntimeError:
       AMQP can only be used from within EM.run {}
     # ./lib/cloudist/queues/basic_queue.rb:35:in `new'
     # ./lib/cloudist/queues/basic_queue.rb:35:in `setup'
     # ./lib/cloudist/queues/basic_queue.rb:25:in `initialize'
     # ./lib/cloudist/queues/job_queue.rb:10:in `initialize'
     # ./spec/cloudist/request_spec.rb:8:in `new'
     # ./spec/cloudist/request_spec.rb:8:in `block (2 levels) in <top (required)>'

  18) Cloudist::Request should be 1 minute old
     Failure/Error: q = Cloudist::JobQueue.new('test.queue')
     RuntimeError:
       AMQP can only be used from within EM.run {}
     # ./lib/cloudist/queues/basic_queue.rb:35:in `new'
     # ./lib/cloudist/queues/basic_queue.rb:35:in `setup'
     # ./lib/cloudist/queues/basic_queue.rb:25:in `initialize'
     # ./lib/cloudist/queues/job_queue.rb:10:in `initialize'
     # ./spec/cloudist/request_spec.rb:8:in `new'
     # ./spec/cloudist/request_spec.rb:8:in `block (2 levels) in <top (required)>'

  19) Cloudist::Request should not be expired
     Failure/Error: q = Cloudist::JobQueue.new('test.queue')
     RuntimeError:
       AMQP can only be used from within EM.run {}
     # ./lib/cloudist/queues/basic_queue.rb:35:in `new'
     # ./lib/cloudist/queues/basic_queue.rb:35:in `setup'
     # ./lib/cloudist/queues/basic_queue.rb:25:in `initialize'
     # ./lib/cloudist/queues/job_queue.rb:10:in `initialize'
     # ./spec/cloudist/request_spec.rb:8:in `new'
     # ./spec/cloudist/request_spec.rb:8:in `block (2 levels) in <top (required)>'

  20) Cloudist::Request should not be acked yet
     Failure/Error: q = Cloudist::JobQueue.new('test.queue')
     RuntimeError:
       AMQP can only be used from within EM.run {}
     # ./lib/cloudist/queues/basic_queue.rb:35:in `new'
     # ./lib/cloudist/queues/basic_queue.rb:35:in `setup'
     # ./lib/cloudist/queues/basic_queue.rb:25:in `initialize'
     # ./lib/cloudist/queues/job_queue.rb:10:in `initialize'
     # ./spec/cloudist/request_spec.rb:8:in `new'
     # ./spec/cloudist/request_spec.rb:8:in `block (2 levels) in <top (required)>'

  21) Cloudist::Request should be ackable
     Failure/Error: q = Cloudist::JobQueue.new('test.queue')
     RuntimeError:
       AMQP can only be used from within EM.run {}
     # ./lib/cloudist/queues/basic_queue.rb:35:in `new'
     # ./lib/cloudist/queues/basic_queue.rb:35:in `setup'
     # ./lib/cloudist/queues/basic_queue.rb:25:in `initialize'
     # ./lib/cloudist/queues/job_queue.rb:10:in `initialize'
     # ./spec/cloudist/request_spec.rb:8:in `new'
     # ./spec/cloudist/request_spec.rb:8:in `block (2 levels) in <top (required)>'

Finished in 0.02278 seconds
46 examples, 21 failures
rake aborted!
ruby -S bundle exec rspec spec/cloudist/basic_queue_spec.rb spec/cloudist/job_spec.rb spec/cloudist/message_spec.rb spec/cloudist/messaging_spec.rb spec/cloudist/payload_spec.rb spec/cloudist/payload_spec_2_spec.rb spec/cloudist/queue_spec.rb spec/cloudist/request_spec.rb spec/cloudist/utils_spec.rb spec/cloudist_spec.rb spec/core_ext/string_spec.rb failed
@ivanvanderbyl
@joevandyk
@ivanvanderbyl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.