From d539d9db712c1b1ce351ce47db6899f83ffc4060 Mon Sep 17 00:00:00 2001 From: Schneems Date: Mon, 25 Nov 2024 16:52:24 -0600 Subject: [PATCH] Use puma to support IPv6 and IPv4 in local tests --- buildpacks/ruby/tests/fixtures/default_ruby/Gemfile | 3 ++- .../ruby/tests/fixtures/default_ruby/Gemfile.lock | 12 ++++++++++-- buildpacks/ruby/tests/integration_test.rs | 11 ++++++----- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/buildpacks/ruby/tests/fixtures/default_ruby/Gemfile b/buildpacks/ruby/tests/fixtures/default_ruby/Gemfile index 237066dd..7fb164a0 100644 --- a/buildpacks/ruby/tests/fixtures/default_ruby/Gemfile +++ b/buildpacks/ruby/tests/fixtures/default_ruby/Gemfile @@ -2,4 +2,5 @@ source "https://rubygems.org" gem 'rack' gem 'rake' -gem 'webrick' +gem 'puma' +gem 'rackup' diff --git a/buildpacks/ruby/tests/fixtures/default_ruby/Gemfile.lock b/buildpacks/ruby/tests/fixtures/default_ruby/Gemfile.lock index 7892126b..e12918dc 100644 --- a/buildpacks/ruby/tests/fixtures/default_ruby/Gemfile.lock +++ b/buildpacks/ruby/tests/fixtures/default_ruby/Gemfile.lock @@ -1,14 +1,22 @@ GEM remote: https://rubygems.org/ specs: + nio4r (2.7.4) + puma (6.5.0) + nio4r (~> 2.0) rack (3.1.8) + rackup (2.2.1) + rack (>= 3) rake (13.2.1) - webrick (1.9.0) PLATFORMS ruby DEPENDENCIES + puma rack + rackup rake - webrick + +BUNDLED WITH + 2.5.23 diff --git a/buildpacks/ruby/tests/integration_test.rs b/buildpacks/ruby/tests/integration_test.rs index f9bf6c7c..ece3ea13 100644 --- a/buildpacks/ruby/tests/integration_test.rs +++ b/buildpacks/ruby/tests/integration_test.rs @@ -55,7 +55,7 @@ fn test_default_app_ubuntu20() { 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`"#); - assert_contains!(context.pack_stdout, "Installing webrick"); + assert_contains!(context.pack_stdout, "Installing puma"); }, ); } @@ -72,7 +72,7 @@ fn test_default_app_ubuntu22() { 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`"#); - assert_contains!(context.pack_stdout, "Installing webrick"); + assert_contains!(context.pack_stdout, "Installing puma"); }, ); } @@ -91,7 +91,7 @@ fn test_default_app_latest_distro() { 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`"#); - assert_contains!(context.pack_stdout, "Installing webrick"); + assert_contains!(context.pack_stdout, "Installing puma"); let config = context.config.clone(); context.rebuild(config, |rebuild_context| { @@ -107,8 +107,9 @@ fn test_default_app_latest_distro() { let body = response.into_string().unwrap(); let server_logs = container.logs_now(); - assert_contains!(server_logs.stderr, "WEBrick::HTTPServer#start"); - assert_empty!(server_logs.stdout); + + assert_contains!(server_logs.stdout, "Puma starting"); + assert_empty!(server_logs.stderr); assert_contains!(body, "ruby_version"); },