From 6df461c19f3388952cfff07a9836fc56b99d964c Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Wed, 2 Sep 2026 14:21:44 +0100 Subject: [PATCH] Strip literal '^[' ANSI escapes in test output cleaning The buildpack emits ANSI colour codes on error/warning banners. On GitHub Actions runners the escape byte arrives as the two literal characters `^[` instead of 0x1B, so `clean_output`'s regex (which only matched real ESC) left them in and broke output-matching assertions across the integration-test suite. Widen the regex to strip both variants, mirroring heroku/heroku-buildpack-java#303. GUS-W-24073123. --- spec/spec_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e7fde7a69..d732fd8f4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -61,7 +61,9 @@ def clean_output(output) # https://github.com/heroku/hatchet/issues/162 .gsub(/ {8}(?=\R)/, '') # Remove ANSI colour codes used in buildpack output (e.g. error messages). - .gsub(/\e\[[0-9;]+m/, '') + # GitHub Actions runners deliver the escape byte as the two literal characters + # "^[" instead of 0x1B, so strip both variants. + .gsub(/(?:\e|\^\[)\[[0-9;]+m/, '') end def normalize_trailing_newlines(output)