Browse files

specify N=0 to prevent parallel tests (just run tests on the main pro…

…cess)
  • Loading branch information...
1 parent 8c48a70 commit 0b773c30fb5dd9822a5af21e395b1b994baca9d3 @tenderlove tenderlove committed Jul 23, 2014
Showing with 6 additions and 2 deletions.
  1. +6 −2 actionpack/test/abstract_unit.rb
View
8 actionpack/test/abstract_unit.rb
@@ -19,6 +19,8 @@
require 'drb/unix'
require 'tempfile'
+PROCESS_COUNT = (ENV['N'] || 4).to_i
+
require 'active_support/testing/autorun'
require 'abstract_controller'
require 'action_controller'
@@ -109,7 +111,9 @@ def before_setup
module ActiveSupport
class TestCase
include ActionDispatch::DrawOnce
- parallelize_me! if ActiveSupport::Testing::Isolation.forking_env?
+ if ActiveSupport::Testing::Isolation.forking_env? && PROCESS_COUNT > 0
+ parallelize_me!
+ end
end
end
@@ -489,7 +493,7 @@ def shutdown
end
end
-if ActiveSupport::Testing::Isolation.forking_env?
+if ActiveSupport::Testing::Isolation.forking_env? && PROCESS_COUNT > 0
# Use N processes (N defaults to 4)
Minitest.parallel_executor = ForkingExecutor.new((ENV['N'] || 4).to_i)
end

0 comments on commit 0b773c3

Please sign in to comment.