From f2be2b013cc468eb4e10bb33ac001e48d4952f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 12 Oct 2021 23:11:49 +0000 Subject: [PATCH] Fix test runner test when the parallelization output is show Those tests are broken since ecc5afed30b83650c7b4ccc004143a12a0ef0f88. I'm not sure why they are not broken on CI though. --- railties/test/application/test_runner_test.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb index f77a42c7f7..7a880a50ff 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -745,7 +745,7 @@ module ApplicationTests file = create_test_for_env("test") results = Dir.chdir(app_path) { - `ruby -Ilib:test #{file}`.each_line.map { |line| JSON.parse line } + `ruby -Ilib:test #{file}`.each_line.filter_map { |line| JSON.parse(line) if line.start_with?("{") } } assert_equal 1, results.length failures = results.first["failures"] @@ -762,7 +762,8 @@ module ApplicationTests file = create_test_for_env("development") results = Dir.chdir(app_path) { - `RAILS_ENV=development ruby -Ilib:test #{file}`.each_line.map { |line| JSON.parse line } + `RAILS_ENV=development ruby -Ilib:test #{file}`.each_line. + filter_map { |line| JSON.parse(line) if line.start_with?("{") } } assert_equal 1, results.length failures = results.first["failures"]