Commit 2647f3136db319a8f6ad1af47143267d7aa8bd1e

Authored by Braulio Bhavamitra
1 parent 76f71df3

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
.travis.yml
... ... @@ -29,11 +29,6 @@ addons:
29 29 paths:
30 30 - $(ls tmp/artifact* | tr "\n" ":")
31 31  
32   -# workaround for https://github.com/travis-ci/travis-ci/issues/4536
33   -before_install:
34   - - export GEM_HOME=$PWD/vendor/bundle/ruby/2.2.0
35   - - gem install bundler
36   -
37 32 before_script:
38 33 - mkdir -p tmp/{pids,cache} log cache
39 34 - script/noosfero-plugins disableall
... ... @@ -55,11 +50,11 @@ env:
55 50 - SLICE=2/4 TASK=selenium
56 51 - SLICE=3/4 TASK=selenium
57 52 - SLICE=4/4 TASK=selenium
58   - - SLICE=1/5 TASK=test:noosfero_plugins BUNDLE_OPTS=install
59   - - SLICE=2/5 TASK=test:noosfero_plugins BUNDLE_OPTS=install
60   - - SLICE=3/5 TASK=test:noosfero_plugins BUNDLE_OPTS=install
61   - - SLICE=4/5 TASK=test:noosfero_plugins BUNDLE_OPTS=install
62   - - SLICE=5/5 TASK=test:noosfero_plugins BUNDLE_OPTS=install
  53 + - SLICE=1/5 TASK=test:noosfero_plugins NOOSFERO_BUNDLE_OPTS=install
  54 + - SLICE=2/5 TASK=test:noosfero_plugins NOOSFERO_BUNDLE_OPTS=install
  55 + - SLICE=3/5 TASK=test:noosfero_plugins NOOSFERO_BUNDLE_OPTS=install
  56 + - SLICE=4/5 TASK=test:noosfero_plugins NOOSFERO_BUNDLE_OPTS=install
  57 + - SLICE=5/5 TASK=test:noosfero_plugins NOOSFERO_BUNDLE_OPTS=install
63 58  
64 59 script:
65 60 - bundle exec rake $TASK
... ...
circle.yml
... ... @@ -28,22 +28,22 @@ test:
28 28 bundle exec rake test:api
29 29 bundle exec rake test:functionals
30 30 SLICE=1/4 bundle exec rake selenium
31   - SLICE=1/4 BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
  31 + SLICE=1/4 NOOSFERO_BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
32 32 ;;
33 33 1)
34 34 bundle exec rake test:integration
35 35 SLICE=2/4 bundle exec rake selenium
36   - SLICE=2/4 BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
  36 + SLICE=2/4 NOOSFERO_BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
37 37 ;;
38 38 2)
39 39 bundle exec rake test:units
40 40 SLICE=3/4 bundle exec rake selenium
41   - SLICE=3/4 BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
  41 + SLICE=3/4 NOOSFERO_BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
42 42 ;;
43 43 3)
44 44 bundle exec rake cucumber
45 45 SLICE=4/4 bundle exec rake selenium
46   - SLICE=4/4 BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
  46 + SLICE=4/4 NOOSFERO_BUNDLE_OPTS=install bundle exec rake test:noosfero_plugins
47 47 ;;
48 48 esac
49 49 :
... ...
lib/tasks/plugins_tests.rake
... ... @@ -25,7 +25,7 @@ def enable_plugins(plugins)
25 25 plugins = Array(plugins)
26 26 command = ['./script/noosfero-plugins', '-q', 'enable', *plugins]
27 27 puts plugins.join(' ')
28   - system *command
  28 + Bundler.clean_system *command
29 29 end
30 30  
31 31 def disable_plugins(plugins = '*')
... ...
script/noosfero-plugins
... ... @@ -79,7 +79,7 @@ run(){
79 79  
80 80 _install(){
81 81 # export so that recursive enables for dependencies inherit this option too
82   - export BUNDLE_OPTS='install'
  82 + export NOOSFERO_BUNDLE_OPTS='install'
83 83 _enable "$1"
84 84 }
85 85  
... ... @@ -119,8 +119,8 @@ _enable(){
119 119 if [ -e $source/Gemfile ]; then
120 120 gemfile=$(mktemp --tmpdir=.)
121 121 cat $NOOSFERO_DIR/Gemfile $source/Gemfile > $gemfile
122   - if [ -z "$BUNDLE_OPTS" ]; then BUNDLE_OPTS="--local"; fi
123   - if ! RUBYOPT='' BUNDLE_GEMFILE="$gemfile" bundle $BUNDLE_OPTS --quiet; then
  122 + if [ -z "$NOOSFERO_BUNDLE_OPTS" ]; then NOOSFERO_BUNDLE_OPTS="--local"; fi
  123 + if ! RUBYOPT='' BUNDLE_GEMFILE="$gemfile" bundle $NOOSFERO_BUNDLE_OPTS --quiet; then
124 124 dependencies_ok=false
125 125 else
126 126 mv "$gemfile".lock Gemfile.lock
... ...