diff --git a/buildpacks/ruby/src/layers/bundle_install_layer.rs b/buildpacks/ruby/src/layers/bundle_install_layer.rs index 833c99bf..26451d54 100644 --- a/buildpacks/ruby/src/layers/bundle_install_layer.rs +++ b/buildpacks/ruby/src/layers/bundle_install_layer.rs @@ -503,7 +503,7 @@ GEM_PATH=layer_path }; std::fs::write(&gemfile, "iamagemfile").unwrap(); - let target_id = TargetId::from_stack("heroku-24").unwrap(); + let target_id = TargetId::from_stack("heroku-22").unwrap(); let metadata = BundleInstallLayerMetadata { distro_name: target_id.distro_name, distro_version: target_id.distro_version, @@ -522,7 +522,7 @@ GEM_PATH=layer_path let toml_string = format!( r#" distro_name = "ubuntu" -distro_version = "24.04" +distro_version = "22.04" cpu_architecture = "amd64" ruby_version = "3.1.3" force_bundle_install_key = "v1" diff --git a/buildpacks/ruby/src/target_id.rs b/buildpacks/ruby/src/target_id.rs index b58759ee..cad39764 100644 --- a/buildpacks/ruby/src/target_id.rs +++ b/buildpacks/ruby/src/target_id.rs @@ -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)] @@ -56,22 +56,22 @@ mod test { #[test] fn test_stack_name() { assert_eq!( - String::from("heroku-22"), + String::from("heroku-20"), TargetId { cpu_architecture: String::from("amd64"), distro_name: String::from("ubuntu"), - distro_version: String::from("22.04"), + distro_version: String::from("20.04"), } .stack_name() .unwrap() ); assert_eq!( - String::from("heroku-24"), + String::from("heroku-22"), TargetId { cpu_architecture: String::from("amd64"), distro_name: String::from("ubuntu"), - distro_version: String::from("24.04"), + distro_version: String::from("22.04"), } .stack_name() .unwrap() @@ -81,20 +81,20 @@ mod test { #[test] fn test_from_stack() { assert_eq!( - TargetId::from_stack("heroku-22").unwrap(), + TargetId::from_stack("heroku-20").unwrap(), TargetId { cpu_architecture: String::from("amd64"), distro_name: String::from("ubuntu"), - distro_version: String::from("22.04"), + distro_version: String::from("20.04"), } ); assert_eq!( - TargetId::from_stack("heroku-24").unwrap(), + TargetId::from_stack("heroku-22").unwrap(), TargetId { cpu_architecture: String::from("amd64"), distro_name: String::from("ubuntu"), - distro_version: String::from("24.04"), + distro_version: String::from("22.04"), } ); } diff --git a/buildpacks/ruby/tests/integration_test.rs b/buildpacks/ruby/tests/integration_test.rs index 0bfab912..5681639a 100644 --- a/buildpacks/ruby/tests/integration_test.rs +++ b/buildpacks/ruby/tests/integration_test.rs @@ -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| {