Skip to content

Commit f2be2b0

Browse files
authored
Fix test runner test when the parallelization output is show
Those tests are broken since ecc5afe. I'm not sure why they are not broken on CI though.
1 parent 0bba051 commit f2be2b0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

railties/test/application/test_runner_test.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ def test_running_with_ruby_gets_test_env_by_default
745745

746746
file = create_test_for_env("test")
747747
results = Dir.chdir(app_path) {
748-
`ruby -Ilib:test #{file}`.each_line.map { |line| JSON.parse line }
748+
`ruby -Ilib:test #{file}`.each_line.filter_map { |line| JSON.parse(line) if line.start_with?("{") }
749749
}
750750
assert_equal 1, results.length
751751
failures = results.first["failures"]
@@ -762,7 +762,8 @@ def test_running_with_ruby_can_set_env_via_cmdline
762762

763763
file = create_test_for_env("development")
764764
results = Dir.chdir(app_path) {
765-
`RAILS_ENV=development ruby -Ilib:test #{file}`.each_line.map { |line| JSON.parse line }
765+
`RAILS_ENV=development ruby -Ilib:test #{file}`.each_line.
766+
filter_map { |line| JSON.parse(line) if line.start_with?("{") }
766767
}
767768
assert_equal 1, results.length
768769
failures = results.first["failures"]

0 commit comments

Comments
 (0)