From e024f80d7e82755d85cf19c2ba20d2dee245fbd4 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Tue, 18 Feb 2014 11:47:19 -0500 Subject: [PATCH] Testing against jruby and rubinius, yey since I noticed we were only one error away from being jruby compatible and rubinius was already working. --- .simplecov | 4 +++- .travis.yml | 4 ---- Rakefile | 3 ++- test/scheduler_task_test.rb | 9 +++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.simplecov b/.simplecov index 00782a08..3ecb2fef 100644 --- a/.simplecov +++ b/.simplecov @@ -1 +1,3 @@ -SimpleCov.start { add_filter '/test/' } if ENV['COVERAGE'] +if ENV['COVERAGE'] && RUBY_PLATFORM !~ /java/ + SimpleCov.start { add_filter '/test/' } +end diff --git a/.travis.yml b/.travis.yml index 07636d66..e873edc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,6 @@ rvm: env: global: - RESQUE_SCHEDULER_DISABLE_TEST_REDIS_SERVER=1 -matrix: - allow_failures: - - rvm: jruby-19mode - - rvm: rbx services: - redis-server notifications: diff --git a/Rakefile b/Rakefile index 75283ee1..28d36e81 100644 --- a/Rakefile +++ b/Rakefile @@ -3,7 +3,8 @@ require 'bundler/gem_tasks' require 'rake/testtask' require 'rubocop/rake_task' -task default: [:rubocop, :test] +task default: [:rubocop, :test] unless RUBY_PLATFORM =~ /java/ +task default: [:test] if RUBY_PLATFORM =~ /java/ Rubocop::RakeTask.new diff --git a/test/scheduler_task_test.rb b/test/scheduler_task_test.rb index c6545098..09c95853 100644 --- a/test/scheduler_task_test.rb +++ b/test/scheduler_task_test.rb @@ -20,10 +20,11 @@ test 'sending TERM to scheduler breaks out of poll_sleep' do Resque::Scheduler.expects(:release_master_lock!) - fork do - sleep(0.5) - system("kill -TERM #{Process.ppid}") - exit! + + @pid = Process.pid + Thread.new do + sleep 0.5 + Process.kill(:TERM, @pid) end assert_raises SystemExit do