diff options
| author | Mike McQuaid | 2014-10-16 10:28:51 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2014-10-16 10:28:51 +0100 |
| commit | 7312b4a1a43c77c819b5d02db574572d6d6e4656 (patch) | |
| tree | 0ec7cc50ae9478c664e7c08c333b2b9feb50a734 /Library/Homebrew/cmd | |
| parent | 1b64612b65a0b3896d5965cc2098393ce6de18a1 (diff) | |
| download | brew-7312b4a1a43c77c819b5d02db574572d6d6e4656.tar.bz2 | |
brew-test-bot: truncate output to 1MB.
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/test-bot.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb index d837b1b36..a001d461f 100644 --- a/Library/Homebrew/cmd/test-bot.rb +++ b/Library/Homebrew/cmd/test-bot.rb @@ -30,6 +30,7 @@ require 'rexml/cdata' module Homebrew EMAIL_SUBJECT_FILE = "brew-test-bot.#{MacOS.cat}.email.txt" + BYTES_IN_1_MEGABYTE = 1024*1024 def homebrew_git_repo tap=nil if tap @@ -621,7 +622,12 @@ module Homebrew if output.respond_to?(:force_encoding) && !output.valid_encoding? output.force_encoding(Encoding::UTF_8) end - output = REXML::CData.new output.delete("\000\a\b\e\f") + output = output.delete("\000\a\b\e\f") + if output.bytesize > BYTES_IN_1_MEGABYTE + output = "truncated output to 1MB:\n" \ + + output.slice(-BYTES_IN_1_MEGABYTE, BYTES_IN_1_MEGABYTE) + end + output = REXML::CData.new output if step.passed? system_out = testcase.add_element 'system-out' system_out.text = output |
