From ec2aefdbfa605208f356b70553ec091d6b1a68d2 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Mon, 7 Dec 2015 22:27:15 +0100 Subject: [PATCH] Fix #22232: rake test tasks exit status code The exit status code was not set when tests were fired with `rake`. Now, it is being set and it matches behavior of running tests via `rails` command (`rails test`), so no matter if `rake test` or `rails test` command is used the exit code will be set. --- railties/CHANGELOG.md | 7 +++++++ railties/lib/rails/test_unit/minitest_plugin.rb | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 709e473b58..e6bee302a3 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,3 +1,10 @@ +* Fix setting exit status code for rake test tasks. The exit status code + was not set when tests were fired with `rake`. Now, it is being set and it matches + behavior of running tests via `rails` command (`rails test`), so no matter if + `rake test` or `rails test` command is used the exit code will be set. + + *Arkadiusz Fal* + * Add Command infrastructure to replace rake. Also move `rake dev:cache` to new infrastructure. You'll need to use diff --git a/railties/lib/rails/test_unit/minitest_plugin.rb b/railties/lib/rails/test_unit/minitest_plugin.rb index 4e1fb13009..d39d2f32bf 100644 --- a/railties/lib/rails/test_unit/minitest_plugin.rb +++ b/railties/lib/rails/test_unit/minitest_plugin.rb @@ -57,7 +57,9 @@ module Minitest # as the patterns would also contain the other Rake tasks. def self.rake_run(patterns) # :nodoc: @rake_patterns = patterns - run + passed = run + exit passed unless passed + passed end def self.plugin_rails_init(options)