diff --git a/CHANGELOG.md b/CHANGELOG.md index 81a6545f8..31d796eaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Master +## v190 (7/24/2018) + +* Support TAP output for Heroku CI (https://github.com/heroku/heroku-buildpack-ruby/pull/790). + ## v189 (7/10/2018) * Colorize build failures and warnings. (https://github.com/heroku/heroku-buildpack-ruby/pull/788) diff --git a/bin/support/ruby_test b/bin/support/ruby_test index 23d958598..b138cf319 100755 --- a/bin/support/ruby_test +++ b/bin/support/ruby_test @@ -21,7 +21,12 @@ def execute_test(command) end def execute_command(command) - pipe(command, :user_env => true) + # Normally the `pipe` command will indent output so that it + # matches the build output, however in a test TAP depends on + # having no whitespace before output. To avoid adding whitespace + # for the original Kernel.puts to be used by passing in the + # Kernel object. + pipe(command, :user_env => true, :output_object => Kernel) end # $ bin/test BUILD_DIR ENV_DIR ARTIFACT_DIR diff --git a/lib/language_pack/shell_helpers.rb b/lib/language_pack/shell_helpers.rb index 52ab522d4..5de58edfb 100644 --- a/lib/language_pack/shell_helpers.rb +++ b/lib/language_pack/shell_helpers.rb @@ -216,11 +216,13 @@ def wait_with_timeout def pipe(command, options = {}) output = options[:buffer] || "" silent = options[:silent] + # self.puts uses the method defined in this file + output_object = options[:output_object] || self IO.popen(command_options_to_string(command, options)) do |io| until io.eof? buffer = io.gets output << buffer - puts buffer unless silent + output_object.puts(buffer) unless silent end end diff --git a/lib/language_pack/version.rb b/lib/language_pack/version.rb index af1f3c4fc..617ffd73b 100644 --- a/lib/language_pack/version.rb +++ b/lib/language_pack/version.rb @@ -3,6 +3,6 @@ # This file is automatically generated by rake module LanguagePack class LanguagePack::Base - BUILDPACK_VERSION = "v189" + BUILDPACK_VERSION = "v190" end end diff --git a/spec/hatchet/ci_spec.rb b/spec/hatchet/ci_spec.rb index 68fa7e3ef..3b1d2e230 100644 --- a/spec/hatchet/ci_spec.rb +++ b/spec/hatchet/ci_spec.rb @@ -27,7 +27,9 @@ it "Works with a vanilla ruby app" do Hatchet::Runner.new("ruby_no_rails_test").run_ci do |test_run| - # Expect success test run + # Test no whitespace in front of output + expect(test_run.output).to_not match(/^ +Finished in/) + expect(test_run.output).to match(/^Finished in/) end end