[ARVADOS-DEV] created: b645e7eb2df45750fa29c8b17b18bdcd54e13441

git at public.curoverse.com git at public.curoverse.com
Tue Dec 9 19:21:32 EST 2014


        at  b645e7eb2df45750fa29c8b17b18bdcd54e13441 (commit)


commit b645e7eb2df45750fa29c8b17b18bdcd54e13441
Author: Brett Smith <brett at curoverse.com>
Date:   Tue Dec 9 19:21:31 2014 -0500

    4156: Try to accommodate RVM setups better.
    
    Tom's version doesn't work on my RVM setup.  This version finds built
    gems better.  Unfortunately, it's still failing on Websockets and
    Workbench tests.

diff --git a/jenkins/run-tests.sh b/jenkins/run-tests.sh
index b141187..f482292 100755
--- a/jenkins/run-tests.sh
+++ b/jenkins/run-tests.sh
@@ -183,27 +183,31 @@ do
     fi
 done
 
+home_gemdir() {
+    env -i PATH="$PATH" HOME="$1" gem env gempath | cut -d: -f1
+}
+
 # When our "bundle install"s need to install new gems to satisfy
-# dependencies, we want them to go where "gem install --user-install"
-# would put them. This could be ~/.gem/..., or something rvm has set
-# up. We don't want to install them to our GEMHOME tmpdir, though:
-# that would mean re-downloading all dependencies each time we run
-# tests with clean tmpdirs. The first dir in `gem env gempath` seems
-# to give us this dir. (Note: this is a no-op if rvm is in use.)
-user_gempath="$(gem env gempath)"
-export GEM_HOME="${user_gempath%%:*}"
-PATH="$(gem env gemdir)/bin:$PATH"
-
-# Wherever "HOME=$GEMHOME gem install --user-install" installs stuff
-# to, we want its bin to be in our PATH. (Normally, this gempath is
-# inside our nice clean $GEMHOME, which means we can install the
-# current version there and expect integration tests to find it before
-# finding any other versions that happen to be installed
-# somewhere. But if rvm is enforcing its own idea where gempath should
-# go, we'll just assume rvm has been set up correctly rather than
-# fight it.)
-tmpdir_gempath="$(HOME="$GEMHOME" gem env gempath)"
-PATH="${tmpdir_gempath%%:*}/bin:$PATH"
+# dependencies, make sure there's a permanent home for them.  If
+# GEM_HOME isn't defined already, set it to the directory `gem install
+# --user-install` would use.  We don't want to install them to our
+# GEMHOME tmpdir: that would mean re-downloading all dependencies each
+# time we run tests with clean tmpdirs.  The first dir in `gem env
+# gempath` seems to give us this dir.
+if [ -z "$GEM_HOME" ]; then
+    export GEM_HOME="$(home_gemdir "$HOME")"
+fi
+
+# GEMHOME is a fresh directory where we'll install the gems we build,
+# and have them take top priority for satisfying dependencies.  Figure
+# out where gems will be and put it at the fromt of GEM_PATH and PATH.
+tmpdir_gempath="$(home_gemdir "$GEMHOME")"
+if [ -z "$GEM_PATH" ]; then
+    export GEM_PATH="$tmpdir_gempath"
+else
+    export GEM_PATH="$tmpdir_gempath:$GEM_PATH"
+fi
+export PATH="${tmpdir_gempath}/bin:${GEM_HOME}/bin:$PATH"
 
 if ! which bundler >/dev/null
 then

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list