Skip to content

Commit 7c1062f

Browse files
authored
Fix cache warning on heroku-22 (heroku#1588)
* Assert no warnings from `cp` * Fix cache warning on heroku-22 Before: ``` $ be rspec spec/hatchet/getting_started_spec.rb:25 Run options: include {:focused=>true, :locations=>{"./spec/hatchet/getting_started_spec.rb"=>[25]}} Hatchet setup: "hatchet-t-91c5d5b6ce" for "ruby-getting-started" Destroying "hatchet-t-91c5d5b6ce": eb7dab2f-d12a-4bd2-b62a-c48781aa55a9, (0/20) reason: teardown F Failures: 1) Heroku ruby getting started works on Heroku-22 Failure/Error: expect(app.output).to_not include("cp --help") ``` After: ``` $ be rspec spec/hatchet/getting_started_spec.rb:25 Run options: include {:focused=>true, :locations=>{"./spec/hatchet/getting_started_spec.rb"=>[25]}} Hatchet setup: "hatchet-t-17874ceca3" for "ruby-getting-started" Finished in 2 minutes 21.4 seconds (files took 0.1802 seconds to load) 1 example, 0 failures ```
1 parent e5c31cd commit 7c1062f

3 files changed

Lines changed: 24 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [Unreleased]
44

5+
- Fix `cp --update=none` warning `heroku-22` (https://github.com/heroku/heroku-buildpack-ruby/pull/1588)
56

67
## [v304] - 2025-04-28
78

lib/language_pack/cache.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ def load_without_overwrite(path, dest=nil)
5959

6060
dest ||= path
6161

62-
if ENV["STACK"] == "heroku-20"
62+
case ENV["STACK"]
63+
when "heroku-20", "heroku-22"
6364
copy (@cache_base + path), dest, "-a -n"
6465
else
6566
copy (@cache_base + path), dest, "-a --update=none"

spec/hatchet/getting_started_spec.rb

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
require_relative '../spec_helper'
22

33
describe "Heroku ruby getting started" do
4-
it "clears runtime cache" do
5-
Hatchet::Runner.new("ruby-getting-started").deploy do |app|
4+
it "works on Heroku-24" do
5+
Hatchet::Runner.new("ruby-getting-started", stack: "heroku-24").deploy do |app|
6+
# Assert sprockets build cache not present on runtime
67
expect(app.run("ls tmp/cache/assets")).to_not match("sprockets")
8+
9+
# Re-deploy with cache
10+
run!("git commit --allow-empty -m empty")
11+
app.push!
12+
13+
# Assert no warnings from `cp`
14+
# https://github.com/heroku/heroku-buildpack-ruby/pull/1586/files#r2064284286
15+
expect(app.output).to_not include("cp --help")
16+
expect(app.run("which ruby").strip).to eq("/app/bin/ruby")
717
end
818
end
919

10-
it "works on Heroku-24" do
11-
Hatchet::Runner.new("ruby-getting-started", stack: "heroku-24").deploy do |app|
20+
it "works on Heroku-22" do
21+
Hatchet::Runner.new("ruby-getting-started", stack: "heroku-22").deploy do |app|
22+
# Re-deploy with cache
23+
run!("git commit --allow-empty -m empty")
24+
app.push!
25+
26+
# Assert no warnings from `cp`
27+
# https://github.com/heroku/heroku-buildpack-ruby/pull/1586/files#r2064284286
28+
expect(app.output).to_not include("cp --help")
1229
expect(app.run("which ruby").strip).to eq("/app/bin/ruby")
1330
end
1431
end

0 commit comments

Comments
 (0)