Skip to content

rake task does not exit with failures #26

Closed
wireframe opened this Issue Jun 27, 2011 · 2 comments

2 participants

@wireframe

when there are test failures, the rake task should terminiate with errors to fail continuous integration tasks. This is inline with RSpec and other testing tools.

This is easily reproducible by chaining rake commands. ex:
rake jasmine:headless myapp:somecommand

example output:
PASS: 0 tests, 0 failures, 0 secs.
..........F............

myApp.js Expected 'post' to equal 'delete'.

FAIL: 23 tests, 1 failures, 0.237 secs.

Output from somecommand fired here...

@johnbintz
Owner

Having not really chained Rake tasks like that on a regular basis, will exiting with the right status code on failure be sufficient to get the right behavior?

@wireframe

i believe all you need to do is raise an exception from within the task and rake will properly set the exit code. this is how the rspec rake task works:
https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/rake_task.rb

@johnbintz johnbintz closed this Jul 6, 2011
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.