Skip to content

Commit c4eaa52

Browse files
committed
Reapply "Dump JSON directly to file instead of buffering"
This reverts commit 30e16ee.
1 parent 479d530 commit c4eaa52

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ruby/lib/minitest/queue/build_status_reporter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ def progress
107107
end
108108

109109
def write_failure_file(file)
110-
File.write(file, error_reports.map(&:to_h).to_json)
110+
JSON.dump(error_reports.map(&:to_h), File.open(file, 'w'))
111111
end
112112

113113
def write_flaky_tests_file(file)
114-
File.write(file, flaky_reports.to_json)
114+
JSON.dump(flaky_reports, File.open(file, 'w'))
115115
end
116116

117117
private

ruby/lib/minitest/queue/runner.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def display_warnings(build)
323323
warnings = build.pop_warnings.map do |type, attributes|
324324
attributes.merge(type: type)
325325
end.compact
326-
File.write(queue_config.warnings_file, warnings.to_json)
326+
JSON.dump(warnings, File.open(queue_config.warnings_file, 'w'))
327327
end
328328

329329
def run_tests_in_fork(queue)

0 commit comments

Comments
 (0)