Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Rake taks doesn't exit with 0 status code #39

Closed
dnagir opened this Issue · 5 comments

2 participants

@dnagir

Hi,

The provided rake task exits with the status code 127 instead of 0 when all tests are passing.
This makes impossible to pass the build :(

The rake task used on the CI:

require 'guard/jasmine/task'
Guard::JasmineTask.new

desc "Run everything on the CI server"
task :ci do
  Rake::Task['spec'].invoke
  Rake::Task['guard:jasmine'].invoke
  Rake::Task['cucumber'].invoke
end

then:

> bundle exec rake ci
# RSpec succeeds... Then:
Finished in 16.8 seconds
431 examples, 0 failures, 6 pending
Coverage report generated for RSpec to /Users/dnagir/proj/abc/coverage. 588 / 589 LOC (99.83%) covered.
Guard::Jasmine starts webrick test server on port 8888 in test environment.
Jasmine test runner is available at http://127.0.0.1:8888/jasmine
Run all Jasmine suites
Run Jasmine suite at http://127.0.0.1:8888/jasmine
# All the specs are passing here
3 specs, 0 failures
in 0.038 seconds
Guard::Jasmine stops server.

> echo $?
127

Probably there's something to do stopping the server, not sure.
Any workaround for now?

@dnagir

The workaround is to just use the shell:

desc "Run everything on the CI server"
task :ci do
  Rake::Task['spec'].invoke
  sh "bundle exec guard-jasmine"
  Rake::Task['cucumber'].invoke
end

It seems that the Rake task exist the whole process (no matter what the status code actually is) and thus further rake tasks are never executed.

@netzpirat netzpirat closed this in ac4d953
@dnagir

Unfortunately this gives another issue:

undefined method `ok' for #<Guard::JasmineTask:0x007ff41cafcf40>
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/guard-jasmine-0.9.11/lib/guard/jasmine/task.rb:42:in `rescue in block (2 levels) in initialize'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/guard-jasmine-0.9.11/lib/guard/jasmine/task.rb:36:in `block (2 levels) in initialize'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/dnagir/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/dnagir/proj/PropConnect/lib/tasks/ci.rake:8:in `block in <top (required)>'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/dnagir/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/bin/rake:19:in `load'
/Users/dnagir/.rvm/gems/ruby-1.9.3-p0/bin/rake:19:in `<main>'
Tasks: TOP => guard:jasmine
@dnagir

@netzpirat should I open another issue or you'll reopen this one?

@netzpirat
Owner

I just pushed a bugfix release.

@dnagir
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.