[ARVADOS] updated: 3e3ef3aec33b4374a0d5cdfdb52b233499f9eb90

git at public.curoverse.com git at public.curoverse.com
Fri Mar 21 10:25:58 EDT 2014


Summary of changes:
 apps/workbench/test/integration_helper.rb |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

       via  3e3ef3aec33b4374a0d5cdfdb52b233499f9eb90 (commit)
       via  d4f3fdcb1cb4eea905961228eb46e9c8203c719c (commit)
      from  df8de1bd9a517a1a3bfac0f8ab9ace41524d4b39 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 3e3ef3aec33b4374a0d5cdfdb52b233499f9eb90
Author: Brett Smith <brett at curoverse.com>
Date:   Fri Mar 21 10:26:16 2014 -0400

    workbench: Improve API server integration launch.
    
    The previous version sometimes tried (and failed) to find the server
    pid before rails wrote it.  This provides some limited retry, and
    avoids spawning a subshell too.

diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb
index 5d06c22..5cd6f84 100644
--- a/apps/workbench/test/integration_helper.rb
+++ b/apps/workbench/test/integration_helper.rb
@@ -53,7 +53,12 @@ class IntegrationTestRunner < MiniTest::Unit
       _system('bundle', 'exec', 'rake', 'db:test:load')
       _system('bundle', 'exec', 'rake', 'db:fixtures:load')
       _system('bundle', 'exec', 'rails', 'server', '-d')
-      `cat tmp/pids/server.pid`.to_i
+      pid_path = 'tmp/pids/server.pid'
+      timeout = Time.now.tv_sec + 5
+      while (not File.exists? pid_path) and (Time.now.tv_sec < timeout)
+        sleep 0.2
+      end
+      IO.read(pid_path).to_i
     end
     begin
       super(args)

commit d4f3fdcb1cb4eea905961228eb46e9c8203c719c
Author: Brett Smith <brett at curoverse.com>
Date:   Fri Mar 21 10:25:26 2014 -0400

    workbench: Improve integration test environment.
    
    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.

diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb
index b3d9f01..5d06c22 100644
--- a/apps/workbench/test/integration_helper.rb
+++ b/apps/workbench/test/integration_helper.rb
@@ -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

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list