Skip to content

Commit

Permalink
Support heroku-20 and heroku-22 (only)
Browse files Browse the repository at this point in the history
This buildpack does not support heroku-24 (yet) remove this stack from the TargetId struct. It also supports heroku-20 which was previously not present.
  • Loading branch information
schneems committed May 14, 2024
1 parent 731d2f1 commit 610d881
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion buildpacks/ruby/src/target_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ pub(crate) struct TargetId {
}

const DISTRO_VERSION_STACK: &[(&str, &str, &str)] = &[
("ubuntu", "20.04", "heroku-20"),
("ubuntu", "22.04", "heroku-22"),
("ubuntu", "24.04", "heroku-24"),
];

#[derive(Debug, thiserror::Error)]
Expand Down
19 changes: 18 additions & 1 deletion buildpacks/ruby/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,24 @@ fn test_migrating_metadata() {

#[test]
#[ignore = "integration test"]
fn test_default_app() {
fn test_default_app_ubuntu20() {
TestRunner::default().build(
BuildConfig::new("heroku/builder:20", "tests/fixtures/default_ruby"),
|context| {
assert_contains!(context.pack_stdout, "# Heroku Ruby Buildpack");
assert_contains!(
context.pack_stdout,
r#"`BUNDLE_BIN="/layers/heroku_ruby/gems/bin" BUNDLE_CLEAN="1" BUNDLE_DEPLOYMENT="1" BUNDLE_GEMFILE="/workspace/Gemfile" BUNDLE_PATH="/layers/heroku_ruby/gems" BUNDLE_WITHOUT="development:test" bundle install`"#);

println!("{}", context.pack_stdout); // Needed to get full failure as `rebuild` truncates stdout
assert_contains!(context.pack_stdout, "Installing webrick");
},
);
}

#[test]
#[ignore = "integration test"]
fn test_default_app_latest_distro() {
TestRunner::default().build(
BuildConfig::new("heroku/builder:22", "tests/fixtures/default_ruby"),
|context| {
Expand Down

0 comments on commit 610d881

Please sign in to comment.