提交 0b773c30 编写于 作者: A Aaron Patterson

specify N=0 to prevent parallel tests (just run tests on the main process)

上级 8c48a708
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册