diff options
| author | Mike McQuaid | 2014-10-16 10:28:51 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2014-10-16 10:28:51 +0100 |
| commit | 93ff6ce1d8e04872a638423505f8420b3c9d9c9f (patch) | |
| tree | 8d8286774f3ec56876e62f6ab1b533d2ab263404 /Library | |
| parent | 2660f9e22fd4454d0714f1af002333f1d5f1ceff (diff) | |
| download | homebrew-93ff6ce1d8e04872a638423505f8420b3c9d9c9f.tar.bz2 | |
brew-test-bot: truncate output to 1MB.
Diffstat (limited to 'Library')
| -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 |
