Skip to content

Commit

Permalink
Use puma to support IPv6 and IPv4 in local tests
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Nov 25, 2024
1 parent b074100 commit d539d9d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
3 changes: 2 additions & 1 deletion buildpacks/ruby/tests/fixtures/default_ruby/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ source "https://rubygems.org"

gem 'rack'
gem 'rake'
gem 'webrick'
gem 'puma'
gem 'rackup'
12 changes: 10 additions & 2 deletions buildpacks/ruby/tests/fixtures/default_ruby/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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
11 changes: 6 additions & 5 deletions buildpacks/ruby/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
},
);
}
Expand All @@ -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");
},
);
}
Expand All @@ -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| {
Expand All @@ -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");
},
Expand Down

0 comments on commit d539d9d

Please sign in to comment.