aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorbogdanvlviv <bogdanvlviv@gmail.com>2018-08-08 16:12:59 +0300
committerbogdanvlviv <bogdanvlviv@gmail.com>2018-08-08 16:20:38 +0300
commitd0edc9c7ae9a7fbb945f34b75cc0be342196708d (patch)
treef5787d69108b1740fbfe42a235922f2c42d16554 /railties
parenta6e86dd2a86a89b7775e27a2f0e728cb6afd1513 (diff)
downloadrails-d0edc9c7ae9a7fbb945f34b75cc0be342196708d.tar.gz
rails-d0edc9c7ae9a7fbb945f34b75cc0be342196708d.tar.bz2
rails-d0edc9c7ae9a7fbb945f34b75cc0be342196708d.zip
Ensure that running tests in parallel doesn't display schema load output
https://github.com/rails/rails/pull/33479 changed `#load_schema` to prevent displaying schema load on running tests in parallel. We should test this in order to prevent any regression in the future. Context https://github.com/rails/rails/pull/33479#discussion_r206870727
Diffstat (limited to 'railties')
-rw-r--r--railties/test/application/test_runner_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb
index 455dc60efd..5c34b205c9 100644
--- a/railties/test/application/test_runner_test.rb
+++ b/railties/test/application/test_runner_test.rb
@@ -525,9 +525,18 @@ module ApplicationTests
def test_run_in_parallel_with_processes
file_name = create_parallel_processes_test_file
+ app_file "db/schema.rb", <<-RUBY
+ ActiveRecord::Schema.define(version: 1) do
+ create_table :users do |t|
+ t.string :name
+ end
+ end
+ RUBY
+
output = run_test_command(file_name)
assert_match %r{Finished in.*\n2 runs, 2 assertions}, output
+ assert_no_match "create_table(:users)", output
end
def test_run_in_parallel_with_threads
@@ -539,9 +548,18 @@ module ApplicationTests
file_name = create_parallel_threads_test_file
+ app_file "db/schema.rb", <<-RUBY
+ ActiveRecord::Schema.define(version: 1) do
+ create_table :users do |t|
+ t.string :name
+ end
+ end
+ RUBY
+
output = run_test_command(file_name)
assert_match %r{Finished in.*\n2 runs, 2 assertions}, output
+ assert_no_match "create_table(:users)", output
end
def test_raise_error_when_specified_file_does_not_exist