diff options
| author | Mike McQuaid | 2013-06-22 10:54:14 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2013-06-22 11:13:59 +0100 |
| commit | e2ae79e910b300f6d4df331d02cf27c901563930 (patch) | |
| tree | 09150a2799e3d45e73c5c89a709b82e37ca438ba /Library | |
| parent | 88fa0d8eda07130b9f574db962f35f44c1db44a2 (diff) | |
| download | homebrew-e2ae79e910b300f6d4df331d02cf27c901563930.tar.bz2 | |
brew-test-bot: generate email subject file.
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/Contributions/cmd/brew-test-bot.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Library/Contributions/cmd/brew-test-bot.rb b/Library/Contributions/cmd/brew-test-bot.rb index baf0e9c93..80abe2404 100755 --- a/Library/Contributions/cmd/brew-test-bot.rb +++ b/Library/Contributions/cmd/brew-test-bot.rb @@ -7,6 +7,7 @@ # --cleanup: Clean the Homebrew directory. Very dangerous. Use with care. # --skip-setup: Don't check the local system is setup correctly. # --junit: Generate a JUnit XML test results file. +# --email: Generate an email subject file. require 'formula' require 'utils' @@ -377,4 +378,24 @@ if ARGV.include? "--junit" end end +if ARGV.include? "--email" + failed_steps = [] + tests.each do |test| + test.steps.each do |step| + next unless step.failed? + failed_steps << step.command.gsub(/(brew|--verbose) /, '') + end + end + + if failed_steps.empty? + email_subject = 'brew test-bot: PASSED' + else + email_subject = "brew test-bot: FAILED: #{failed_steps.join ', '}" + end + + File.open "brew test-bot.email.txt", 'w' do |file| + file.write email_subject + end +end + exit any_errors ? 0 : 1 |
