[Git][noosfero/noosfero][master] ci: support testing when bundle --path was used

Bráulio Bhavamitra gitlab at mg.gitlab.com
Wed Apr 20 22:23:21 BRT 2016


Bráulio Bhavamitra pushed to branch master at Noosfero / noosfero


Commits:
2647f313 by Braulio Bhavamitra at 2016-04-20T22:15:37-03:00
ci: support testing when bundle --path was used

Rename BUNDLE_OPTS to NOOSFERO_BUNDLE_OPTS as it replaced
and reserved to bundler, see
https://github.com/bundler/bundler/blob/61f1c2313f5cc07fe389a2ec5d1931f8cc61b004/lib/bundler.rb#L218

- - - - -


4 changed files:

- .travis.yml
- circle.yml
- lib/tasks/plugins_tests.rake
- script/noosfero-plugins


Changes:

=====================================
.travis.yml
=====================================
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,11 +29,6 @@ addons:
     paths:
       - $(ls tmp/artifact* | tr "\n" ":")
 
-# workaround for https://github.com/travis-ci/travis-ci/issues/4536
-before_install:
-  - export GEM_HOME=$PWD/vendor/bundle/ruby/2.2.0
-  - gem install bundler
-
 before_script:
   - mkdir -p tmp/{pids,cache} log cache
   - script/noosfero-plugins disableall
@@ -55,11 +50,11 @@ env:
   - SLICE=2/4 TASK=selenium
   - SLICE=3/4 TASK=selenium
   - SLICE=4/4 TASK=selenium
-  - SLICE=1/5 TASK=test:noosfero_plugins BUNDLE_OPTS=install
-  - SLICE=2/5 TASK=test:noosfero_plugins BUNDLE_OPTS=install
-  - SLICE=3/5 TASK=test:noosfero_plugins BUNDLE_OPTS=install
-  - SLICE=4/5 TASK=test:noosfero_plugins BUNDLE_OPTS=install
-  - SLICE=5/5 TASK=test:noosfero_plugins BUNDLE_OPTS=install
+  - SLICE=1/5 TASK=test:noosfero_plugins NOOSFERO_BUNDLE_OPTS=install
+  - SLICE=2/5 TASK=test:noosfero_plugins NOOSFERO_BUNDLE_OPTS=install
+  - SLICE=3/5 TASK=test:noosfero_plugins NOOSFERO_BUNDLE_OPTS=install
+  - SLICE=4/5 TASK=test:noosfero_plugins NOOSFERO_BUNDLE_OPTS=install
+  - SLICE=5/5 TASK=test:noosfero_plugins NOOSFERO_BUNDLE_OPTS=install
 
 script:
   - bundle exec rake $TASK


=====================================
circle.yml
=====================================
--- a/circle.yml
+++ b/circle.yml
@@ -28,22 +28,22 @@ test:
           bundle exec rake test:api
           bundle exec rake test:functionals
           SLICE=1/4 bundle exec rake selenium
-          SLICE=1/4 BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
+          SLICE=1/4 NOOSFERO_BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
           ;;
         1)
           bundle exec rake test:integration
           SLICE=2/4 bundle exec rake selenium
-          SLICE=2/4 BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
+          SLICE=2/4 NOOSFERO_BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
           ;;
         2)
           bundle exec rake test:units
           SLICE=3/4 bundle exec rake selenium
-          SLICE=3/4 BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
+          SLICE=3/4 NOOSFERO_BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
           ;;
         3)
           bundle exec rake cucumber
           SLICE=4/4 bundle exec rake selenium
-          SLICE=4/4 BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
+          SLICE=4/4 NOOSFERO_BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
           ;;
         esac
       :


=====================================
lib/tasks/plugins_tests.rake
=====================================
--- a/lib/tasks/plugins_tests.rake
+++ b/lib/tasks/plugins_tests.rake
@@ -25,7 +25,7 @@ def enable_plugins(plugins)
   plugins = Array(plugins)
   command = ['./script/noosfero-plugins', '-q', 'enable', *plugins]
   puts plugins.join(' ')
-  system *command
+  Bundler.clean_system *command
 end
 
 def disable_plugins(plugins = '*')


=====================================
script/noosfero-plugins
=====================================
--- a/script/noosfero-plugins
+++ b/script/noosfero-plugins
@@ -79,7 +79,7 @@ run(){
 
 _install(){
   # export so that recursive enables for dependencies inherit this option too
-  export BUNDLE_OPTS='install'
+  export NOOSFERO_BUNDLE_OPTS='install'
   _enable "$1"
 }
 
@@ -119,8 +119,8 @@ _enable(){
       if [ -e $source/Gemfile ]; then
         gemfile=$(mktemp --tmpdir=.)
         cat $NOOSFERO_DIR/Gemfile $source/Gemfile > $gemfile
-        if [ -z "$BUNDLE_OPTS" ]; then BUNDLE_OPTS="--local"; fi
-        if ! RUBYOPT='' BUNDLE_GEMFILE="$gemfile" bundle $BUNDLE_OPTS --quiet; then
+        if [ -z "$NOOSFERO_BUNDLE_OPTS" ]; then NOOSFERO_BUNDLE_OPTS="--local"; fi
+        if ! RUBYOPT='' BUNDLE_GEMFILE="$gemfile" bundle $NOOSFERO_BUNDLE_OPTS --quiet; then
           dependencies_ok=false
         else
           mv "$gemfile".lock Gemfile.lock



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/2647f3136db319a8f6ad1af47143267d7aa8bd1e
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160421/7b3c9e43/attachment-0001.html>


More information about the Noosfero-dev mailing list