Skip to content

Commit be42a22

Browse files
committed
WIP
1 parent 7ae4af6 commit be42a22

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

test/spec/detection_spec.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@
77
Hatchet::Runner.new('non-clojure-app', allow_failure: true).tap do |app|
88
app.deploy do
99
expect(app).not_to be_deployed
10-
expect(app.output).to include("Could not find a 'project.clj' file! Please ensure it exists and is checked into Git.")
10+
expect(clean_output(app.output)).to eq(<<~OUTPUT)
11+
remote: -----> App not compatible with buildpack: $BUILDPACK_URL
12+
remote: Could not find a 'project.clj' file! Please ensure it exists and is checked into Git.
13+
14+
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
15+
16+
remote: ! Push failed
17+
OUTPUT
1118
end
1219
end
1320
end

test/spec/spec_helper.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def http_get(app, options = {})
4949
def find_output_start_index(lines)
5050
# Find the first "app detected" line. This skips the buildpack list at the beginning which will contain a GitHub URL
5151
# for the buildpack under test that will be different for each PR/branch under test.
52-
lines.index { |line| line.match?(/-----> .* app detected/) }
52+
# For detection failures, look for the "App not compatible" line instead.
53+
lines.index { |line| line.match?(/-----> .* app detected|-----> App not compatible with buildpack/) }
5354
end
5455

5556
def find_output_end_index(lines)
@@ -82,6 +83,8 @@ def clean_output(output)
8283
%r{/tmp/build_[0-9a-f]{8}} => '$BUILD_DIR',
8384
# Build id
8485
/build_[0-9a-f]{8}/ => '$BUILD_ID',
86+
# Buildpack URL in detection failure message
87+
%r{https://github\.com/heroku/heroku-buildpack-clojure#[\w\-/]+} => '$BUILDPACK_URL',
8588

8689
##################################################
8790
# Java

0 commit comments

Comments
 (0)