From b7ab73a4e21b022cf3415f6eee8018979796e466 Mon Sep 17 00:00:00 2001 From: Agis- Date: Fri, 22 Aug 2014 21:55:50 +0300 Subject: Use system /tmp when testing actionpack https://github.com/rails/rails/commit/c64bff2c87ebf363703c63ecd4a96d56a1a78364 added support and enabled parallel execution of the actionpack tests. However it introduced https://github.com/rails/rails/commit/c64bff2c87ebf363703c63ecd4a96d56a1a78364 since one cannot connect to a socket file that's inside a Vagrant synced folder due to security restrictions, and DRb tries to. Also rename the temporary files to make it obvious that they're rails-related, since now they're placed outside the project's directory. Fixes https://github.com/rails/rails/commit/c64bff2c87ebf363703c63ecd4a96d56a1a78364 --- actionpack/test/abstract_unit.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'actionpack/test/abstract_unit.rb') diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 674fb253f4..e14940d632 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -4,8 +4,6 @@ $:.unshift(File.dirname(__FILE__) + '/lib') $:.unshift(File.dirname(__FILE__) + '/fixtures/helpers') $:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers') -ENV['TMPDIR'] = File.join(File.dirname(__FILE__), 'tmp') - require 'active_support/core_ext/kernel/reporting' # These are the normal settings that will be set up by Railties @@ -466,7 +464,7 @@ class ForkingExecutor def initialize size @size = size @queue = Server.new - file = File.join Dir.tmpdir, Dir::Tmpname.make_tmpname('tests', 'fd') + file = File.join Dir.tmpdir, Dir::Tmpname.make_tmpname('rails-tests', 'fd') @url = "drbunix://#{file}" @pool = nil DRb.start_service @url, @queue -- cgit v1.2.3 From 2f52f969885b2834198de0045748436a4651a94e Mon Sep 17 00:00:00 2001 From: Matthew Draper Date: Tue, 2 Sep 2014 23:48:23 +0930 Subject: Leave all our tests as order_dependent! for now We're seeing too many failures to believe otherwise. This reverts commits bc116a55ca3dd9f63a1f1ca7ade3623885adcc57, cbde413df3839e06dd14e3c220e9800af91e83ab, bf0a67931dd8e58f6f878b9510ae818ae1f29a3a, and 2440933fe2c27b27bcafcd9019717800db2641aa. --- actionpack/test/abstract_unit.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack/test/abstract_unit.rb') diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index e14940d632..799c17119d 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -512,3 +512,8 @@ if ActiveSupport::Testing::Isolation.forking_env? && PROCESS_COUNT > 0 # Use N processes (N defaults to 4) Minitest.parallel_executor = ForkingExecutor.new(PROCESS_COUNT) end + +# FIXME: we have tests that depend on run order, we should fix that and +# remove this method call. +require 'active_support/test_case' +ActiveSupport::TestCase.my_tests_are_order_dependent! -- cgit v1.2.3 From 2b41343c34bcbe809537590152506690b84832df Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Mon, 8 Sep 2014 05:32:16 -0700 Subject: Default to sorting user's test cases for now Goals: 1. Default to :random for newly generated applications 2. Default to :sorted for existing applications with a warning 3. Only show the warning once 4. Only show the warning if the app actually uses AS::TestCase Fixes #16769 --- actionpack/test/abstract_unit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/test/abstract_unit.rb') diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 799c17119d..69312e4c22 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -516,4 +516,4 @@ end # FIXME: we have tests that depend on run order, we should fix that and # remove this method call. require 'active_support/test_case' -ActiveSupport::TestCase.my_tests_are_order_dependent! +ActiveSupport::TestCase.test_order = :sorted -- cgit v1.2.3