From 7aa62c7e5bc4d5d7bd9e29b7fb889a2c320aa9b8 Mon Sep 17 00:00:00 2001 From: Chris LaRose Date: Mon, 2 Nov 2020 16:47:45 -0800 Subject: [PATCH] Run puma cli server in unbundled env in worker gem tests [changelog skip] (#2478) * Run puma cli server in unbundled env in worker gem tests Running `puma` in a clean bundler env is a more realistic way to start puma. * Install gems to release directory in worker gem tests --- test/test_worker_gem_independence.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/test_worker_gem_independence.rb b/test/test_worker_gem_independence.rb index ff935856..c7875054 100644 --- a/test/test_worker_gem_independence.rb +++ b/test/test_worker_gem_independence.rb @@ -35,8 +35,11 @@ class TestWorkerGemIndependence < TestIntegration set_release_symlink File.expand_path(old_app_dir, __dir__) Dir.chdir(current_release_symlink) do - bundle_install - cli_server '--prune-bundler -w 1' + with_unbundled_env do + system("bundle config --local path vendor/bundle", out: File::NULL) + system("bundle install", out: File::NULL) + cli_server '--prune-bundler -w 1' + end end connection = connect @@ -45,7 +48,10 @@ class TestWorkerGemIndependence < TestIntegration set_release_symlink File.expand_path(new_app_dir, __dir__) Dir.chdir(current_release_symlink) do - bundle_install + with_unbundled_env do + system("bundle config --local path vendor/bundle", out: File::NULL) + system("bundle install", out: File::NULL) + end end start_phased_restart @@ -77,10 +83,4 @@ class TestWorkerGemIndependence < TestIntegration Bundler.with_unbundled_env { yield } end end - - def bundle_install - with_unbundled_env do - system("bundle install", out: File::NULL) - end - end end