mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Run actionview tests in parallel
This commit is contained in:
parent
d130ea2ff2
commit
df4ab6e103
2 changed files with 12 additions and 0 deletions
|
@ -192,6 +192,8 @@ module ActionDispatch
|
|||
end
|
||||
|
||||
class ActiveSupport::TestCase
|
||||
parallelize
|
||||
|
||||
include ActiveSupport::Testing::MethodCallAssertions
|
||||
|
||||
private
|
||||
|
|
|
@ -42,6 +42,12 @@ class ActiveRecordTestConnector
|
|||
self.able_to_connect = false
|
||||
end
|
||||
|
||||
def reconnect
|
||||
return unless able_to_connect
|
||||
ActiveRecord::Base.connection.reconnect!
|
||||
load_schema
|
||||
end
|
||||
|
||||
private
|
||||
def setup_connection
|
||||
if Object.const_defined?(:ActiveRecord)
|
||||
|
@ -102,3 +108,7 @@ class ActiveRecordTestCase < ActionController::TestCase
|
|||
end
|
||||
|
||||
ActiveRecordTestConnector.setup
|
||||
|
||||
ActiveSupport::Testing::Parallelization.after_fork_hook do
|
||||
ActiveRecordTestConnector.reconnect
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue