Skip to content

Commit bfbe92d

Browse files
author
Petr Chalupa
committed
Merge pull request #499 from chrisseaton/truffle-travis
Test with JRuby+Truffle on Travis
2 parents 56cec27 + 5212bf2 commit bfbe92d

File tree

5 files changed

+38
-5
lines changed

5 files changed

+38
-5
lines changed

.travis.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,21 @@ branches:
2525
- master
2626

2727
matrix:
28+
include:
29+
- rvm: jruby-head
30+
jdk: oraclejdk8
31+
env: TRUFFLE=1
2832
allow_failures:
2933
- rvm: ruby-head
3034
- rvm: jruby-head
3135
- rvm: 1.9.3
3236
- rvm: rbx-2
37+
- rvm: jruby-head
38+
jdk: oraclejdk8
39+
env: TRUFFLE=1
3340

3441
before_script:
3542
- "echo $JAVA_OPTS"
3643
- "export JAVA_OPTS=-Xmx1024m"
3744

38-
script: RUBYOPT=-w bundle exec rake ci
45+
script: if [[ -v TRUFFLE ]]; then support/test-truffle.sh; else RUBYOPT=-w bundle exec rake ci; fi

spec/concurrent/channel/tick_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Channel
2626
expect(subject.utc.to_f).to eq subject.epoch
2727
end
2828

29-
specify do
29+
specify '#to_s formats as a time', :truffle_bug => true do
3030
expect(subject.to_s).to match /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{6} \+\d{4} UTC/
3131
end
3232

spec/concurrent/executor/thread_pool_executor_shared.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
expect(subject.max_queue).to eq expected_max
101101
end
102102

103-
it 'returns the set value when running' do
103+
it 'returns the set value when running', :truffle_bug => true do # only actually fails for RubyThreadPoolExecutor
104104
trigger = Concurrent::Event.new
105105
5.times{ subject.post{ trigger.wait } }
106106
expect(subject.max_queue).to eq expected_max
@@ -115,7 +115,7 @@
115115
end
116116
end
117117

118-
context '#queue_length' do
118+
context '#queue_length', :truffle_bug => true do # only actually fails for RubyThreadPoolExecutor
119119

120120
let!(:expected_max){ 10 }
121121
subject do

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# we can't use our helpers here because we need to load the gem _after_ simplecov
44
unless RUBY_ENGINE == 'jruby' && 0 == (JRUBY_VERSION =~ /^9\.0\.0\.0/)
5-
if ENV['COVERAGE'] || ENV['CI'] || ENV['TRAVIS']
5+
if (ENV['COVERAGE'] || ENV['CI'] || ENV['TRAVIS']) && !ENV['NO_COVERAGE']
66
require 'simplecov'
77
require 'coveralls'
88

support/test-truffle.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
jruby+truffle setup || exit $?
4+
5+
OVERALL_EXIT_CODE=0
6+
7+
for SPEC in atomic \
8+
channel \
9+
collection \
10+
concern \
11+
executor \
12+
thread_safe \
13+
utility \
14+
*_spec.rb
15+
do
16+
NO_COVERAGE=1 jruby+truffle --no-use-fs-core --verbose run -S rspec -- \
17+
-J-Xmx2G -- spec/concurrent/$SPEC --format documentation \
18+
--tag ~unfinished --seed 1 --tag ~notravis --tag ~buggy --tag ~truffle_bug
19+
EXIT_CODE=$?
20+
if [[ $EXIT_CODE != 0 ]]
21+
then
22+
OVERALL_EXIT_CODE=1
23+
fi
24+
done
25+
26+
exit $OVERALL_EXIT_CODE

0 commit comments

Comments
 (0)