Skip to content

Commit bc80cb1

Browse files
authored
Merge pull request #761 from ajlai/fix-buggy-jruby-tests
Fix failing jruby tests, change default REDIS_BRANCH to 4.0
2 parents fcf8fb0 + 775f860 commit bc80cb1

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ env:
3333
- DRIVER=hiredis REDIS_BRANCH=3.2
3434
- DRIVER=synchrony REDIS_BRANCH=3.0
3535
- DRIVER=synchrony REDIS_BRANCH=3.2
36-
- DRIVER=ruby REDIS_BRANCH=unstable
36+
- DRIVER=ruby REDIS_BRANCH=4.0
3737

3838
branches:
3939
only:
@@ -45,18 +45,14 @@ matrix:
4545
exclude:
4646
# hiredis
4747
- rvm: jruby-9.1.17.0
48-
gemfile: .travis/Gemfile
4948
env: DRIVER=hiredis REDIS_BRANCH=3.0
5049
- rvm: jruby-9.1.17.0
51-
gemfile: .travis/Gemfile
5250
env: DRIVER=hiredis REDIS_BRANCH=3.2
5351

5452
# synchrony
5553
- rvm: jruby-9.1.17.0
56-
gemfile: .travis/Gemfile
5754
env: DRIVER=synchrony REDIS_BRANCH=3.0
5855
- rvm: jruby-9.1.17.0
59-
gemfile: .travis/Gemfile
6056
env: DRIVER=synchrony REDIS_BRANCH=3.2
6157

6258
notifications:

.travis/Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ source "https://rubygems.org"
22

33
gemspec :path => "../"
44

5+
# Using jruby-openssl 0.10.0, we get NPEs in jruby tests: https://github.com/redis/redis-rb/issues/756
6+
platform :jruby do
7+
gem 'jruby-openssl', '<0.10.0'
8+
end
9+
510
case ENV["DRIVER"]
611
when "hiredis"
712
gem "hiredis"

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
source 'https://rubygems.org'
22

33
gemspec
4+
5+
# Using jruby-openssl 0.10.0, we get NPEs in jruby tests: https://github.com/redis/redis-rb/issues/756
6+
platform :jruby do
7+
gem 'jruby-openssl', '<0.10.0'
8+
end

makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
TEST_FILES := $(shell find test -name *_test.rb -type f)
1+
TEST_FILES := $(shell find ./test -name *_test.rb -type f)
22
REDIS_BRANCH ?= unstable
33
TMP := tmp
44
BUILD_DIR := ${TMP}/cache/redis-${REDIS_BRANCH}
@@ -11,7 +11,7 @@ PORT := 6381
1111
test: ${TEST_FILES}
1212
make start
1313
env SOCKET_PATH=${SOCKET_PATH} \
14-
ruby -v $$(echo $? | tr ' ' '\n' | awk '{ print "-r./" $$0 }') -e ''
14+
bundle exec ruby -v -e 'ARGV.each { |test_file| require test_file }' ${TEST_FILES}
1515
make stop
1616

1717
${TMP}:

test/support/redis_mock.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def run
4242
end
4343
end
4444
rescue => ex
45-
$stderr.puts "Error running mock server: #{ex.message}"
45+
$stderr.puts "Error running mock server: #{ex.class}: #{ex.message}"
4646
$stderr.puts ex.backtrace
4747
retry
4848
ensure

0 commit comments

Comments
 (0)