Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Truffle] Split test gems and ecosystem, and allow gems to be used fr…
Browse files Browse the repository at this point in the history
…om somewhere else rather than installing.
chrisseaton committed Jun 15, 2016
1 parent 5e0a335 commit 2ed334f
Showing 65 changed files with 70 additions and 22 deletions.
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -84,11 +84,19 @@ matrix:
jdk: oraclejdk8
- env: JT='test integration'
jdk: oraclejdk8
- env: JT='test gems' JAVA_OPTS="$JAVA_OPTS -Xmx512m" HAS_REDIS=true
- env:
- COMMAND=test/truffle/gems/install-gems.sh
- JT='test gems'
- env:
- JAVA_OPTS="$JAVA_OPTS -Xmx512m"
- HAS_REDIS=true
- JT='test ecosystem'
jdk: oraclejdk8
- env: JT='test tck'
jdk: oraclejdk8
- env: JT=check_ambiguous_arguments SKIP_BUILD=true
- env:
- JT=check_ambiguous_arguments
- SKIP_BUILD=true
jdk: oraclejdk8
- env:
- USE_BUILD_PACK=yes
8 changes: 8 additions & 0 deletions test/truffle/ecosystem/ecosystem.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -e

gem install bundler

mkdir -p test/truffle/ecosystem/gem-testing
jruby+truffle --dir test/truffle/ecosystem/gem-testing ci --batch lib/ruby/truffle/jruby+truffle/gem_ci/travis.txt
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

set -e

cd test/truffle/gems/rails-app
cd test/truffle/ecosystem/rails-app

JRUBY_BIN=../../../../bin
JRUBY=$JRUBY_BIN/jruby
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 5 additions & 4 deletions test/truffle/gems/execjs.sh
Original file line number Diff line number Diff line change
@@ -2,7 +2,8 @@

set -e

bin/jruby bin/gem install execjs -v 2.6.0
ruby -X+T -Ilib/ruby/gems/shared/gems/execjs-2.6.0/lib test/truffle/gems/execjs/checkruntime.rb
ruby -X+T -Ilib/ruby/gems/shared/gems/execjs-2.6.0/lib test/truffle/gems/execjs/simple.rb
ruby -X+T -Ilib/ruby/gems/shared/gems/execjs-2.6.0/lib test/truffle/gems/execjs/coffeescript.rb
GEM_HOME=${GEM_HOME:-lib/ruby/gems/shared}

ruby -X+T -I$GEM_HOME/gems/execjs-2.6.0/lib test/truffle/gems/execjs/checkruntime.rb
ruby -X+T -I$GEM_HOME/gems/execjs-2.6.0/lib test/truffle/gems/execjs/simple.rb
ruby -X+T -I$GEM_HOME/gems/execjs-2.6.0/lib test/truffle/gems/execjs/coffeescript.rb
6 changes: 0 additions & 6 deletions test/truffle/gems/gem-testing.sh

This file was deleted.

9 changes: 9 additions & 0 deletions test/truffle/gems/install-gems.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -e

bin/jruby bin/gem install execjs -v 2.6.0
bin/jruby bin/gem install rack -v 1.6.1
bin/jruby bin/gem install tilt -v 2.0.1
bin/jruby bin/gem install rack-protection -v 1.5.3
bin/jruby bin/gem install sinatra -v 1.4.6
6 changes: 4 additions & 2 deletions test/truffle/gems/rack-server.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

set -e

bin/jruby bin/gem install rack -v 1.6.1
GEM_HOME=${GEM_HOME:-lib/ruby/gems/shared}

source test/truffle/common/test_server.sh.inc
ruby -X+T -Ilib/ruby/gems/shared/gems/rack-1.6.1/lib test/truffle/gems/rack-server/rack-server.rb & test_server

ruby -X+T -I$GEM_HOME/gems/rack-1.6.1/lib test/truffle/gems/rack-server/rack-server.rb & test_server
13 changes: 8 additions & 5 deletions test/truffle/gems/sinatra-server.sh
Original file line number Diff line number Diff line change
@@ -2,9 +2,12 @@

set -e

bin/jruby bin/gem install rack -v 1.6.1
bin/jruby bin/gem install tilt -v 2.0.1
bin/jruby bin/gem install rack-protection -v 1.5.3
bin/jruby bin/gem install sinatra -v 1.4.6
GEM_HOME=${GEM_HOME:-lib/ruby/gems/shared}

source test/truffle/common/test_server.sh.inc
ruby -X+T -Ilib/ruby/gems/shared/gems/rack-1.6.1/lib -Ilib/ruby/gems/shared/gems/tilt-2.0.1/lib -Ilib/ruby/gems/shared/gems/rack-protection-1.5.3/lib -Ilib/ruby/gems/shared/gems/sinatra-1.4.6/lib test/truffle/gems/sinatra-server/sinatra-server.rb & test_server

ruby -X+T -I$GEM_HOME/gems/rack-1.6.1/lib \
-I$GEM_HOME/gems/tilt-2.0.1/lib \
-I$GEM_HOME/gems/rack-protection-1.5.3/lib \
-I$GEM_HOME/gems/sinatra-1.4.6/lib \
test/truffle/gems/sinatra-server/sinatra-server.rb & test_server
27 changes: 25 additions & 2 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -397,7 +397,8 @@ def help
puts ' --no-java-cmd don\'t set JAVACMD - rely on bin/jruby or RUBY_BIN to have Graal already'
puts 'jt test integration runs all integration tests'
puts 'jt test integration TESTS runs the given integration tests'
puts 'jt test gems tests installing and using gems'
puts 'jt test gems tests using gems'
puts 'jt test ecosystem tests using the wider ecosystem such as bundler, Rails, etc'
puts 'jt test cexts run C extension tests (set SULONG_DIR)'
puts 'jt test report :language build a report on language specs'
puts ' :core (results go into test/target/mspec-html-report)'
@@ -562,14 +563,16 @@ def test(*args)
test_specs('run')
# test_mri # TODO (pitr-ch 29-Mar-2016): temporarily disabled since it uses refinements
test_integration
test_gems('HAS_REDIS' => 'true')
test_gems
test_ecosystem 'HAS_REDIS' => 'true'
test_compiler
test_cexts if ENV['SULONG_DIR']
when 'compiler' then test_compiler(*rest)
when 'cexts' then test_cexts(*rest)
when 'report' then test_report(*rest)
when 'integration' then test_integration({}, *rest)
when 'gems' then test_gems({}, *rest)
when 'ecosystem' then test_ecosystem({}, *rest)
when 'specs' then test_specs('run', *rest)
when 'tck' then
args = []
@@ -694,11 +697,31 @@ def test_gems(env={}, *args)
test_names = single_test ? '{' + args.join(',') + '}' : '*'

Dir["#{tests_path}/#{test_names}.sh"].each do |test_script|
next if test_script.end_with?('/install_gems.sh')
sh env_vars, test_script
end
end
private :test_gems

def test_ecosystem(env={}, *args)
env_vars = env
jruby_opts = []

jruby_opts << '-Xtruffle.graal.warn_unless=false'

env_vars["JRUBY_OPTS"] = jruby_opts.join(' ')

env_vars["PATH"] = "#{Utilities.find_jruby_bin_dir}:#{ENV["PATH"]}"
tests_path = "#{JRUBY_DIR}/test/truffle/ecosystem"
single_test = !args.empty?
test_names = single_test ? '{' + args.join(',') + '}' : '*'

Dir["#{tests_path}/#{test_names}.sh"].each do |test_script|
sh env_vars, test_script
end
end
private :test_ecosystem

def test_specs(command, *args)
env_vars = {}
options = []

0 comments on commit 2ed334f

Please sign in to comment.