Skip to content

Commit

Permalink
Showing 66 changed files with 76 additions and 22 deletions.
13 changes: 11 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -84,11 +84,20 @@ 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'
jdk: oraclejdk8
- 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
5 changes: 5 additions & 0 deletions ci.hocon
Original file line number Diff line number Diff line change
@@ -170,6 +170,11 @@ builds: [
{name: ruby-test-specs-library} ${common} ${gate-caps} {run: [${jt} [test, specs, ":library"]]},
{name: ruby-test-specs-truffle} ${common} ${gate-caps} {run: [${jt} [test, specs, ":truffle"]]},
{name: ruby-test-integration} ${common} ${gate-caps} {run: [${jt} [test, integration]]},
{name: ruby-test-gems} ${common} ${gate-caps} {
setup: ${common-setup} [[mx, sclone, --kind, git, "https://github.com/jruby/jruby-truffle-gem-test-pack.git", jruby-truffle-gem-test-pack]]
environment: {GEM_HOME: jruby-truffle-gem-test-pack/gems}
run: [${jt} [test, gems]]
},
{name: ruby-test-tck} ${common} ${gate-caps} {run: [${jt} [test, tck]]},
{name: ruby-test-tarball} ${common} ${gate-caps} {run: [${jt} [tarball]]},

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 = []

1 comment on commit 3acdc1d

@chrisseaton
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pitr-ch I split into jt test gems, for simple tests of gems, and jt test ecosystem for your bigger tests. I can't see any easy way to make the latter work offline, so I've only done the first.

Please sign in to comment.