workbench: Improve integration test environment.
authorBrett Smith <brett@curoverse.com>
Fri, 21 Mar 2014 14:25:26 +0000 (10:25 -0400)
committerBrett Smith <brett@curoverse.com>
Fri, 21 Mar 2014 14:25:26 +0000 (10:25 -0400)
Removing too much from the environment causes builds to fail in
Jenkins.  Instead of using a whitelist of environment variables, use a
blacklist of variables that Bundle modifies.

apps/workbench/test/integration_helper.rb

index b3d9f01444d649ffbff9025d0d676165b9403920..5d06c22006844cc0be68db7a612eb25d2f67bf8d 100644 (file)
@@ -32,12 +32,17 @@ class ActionDispatch::IntegrationTest
 end
 
 class IntegrationTestRunner < MiniTest::Unit
-  # Launch the API server in test mode, with appropriate environment.
-  @@APIENV = {'RAILS_ENV' => 'test'}
-  ['GEM_HOME', 'GEM_PATH', 'PATH'].each { |key| @@APIENV[key] = ENV[key] }
+  # Don't try to re-use the current Bundle environment when we launch the
+  # API server.
+  @@APIENV = {
+    'BUNDLE_BIN_PATH' => nil,
+    'BUNDLE_GEMFILE' => nil,
+    'RUBYLIB' => nil,
+    'RUBYOPT' => nil,
+  }
 
   def _system(*cmd)
-    if not system(@@APIENV, *cmd, {unsetenv_others: true})
+    if not system(@@APIENV, *cmd)
       raise RuntimeError, "#{cmd[0]} returned exit code #{$?.exitstatus}"
     end
   end