Skip to content

Commit

Permalink
Merge pull request #31137 from y-yagi/make_sidekiq_and_resque_integra…
Browse files Browse the repository at this point in the history
…tion_tests_work_in_ci

Make sidekiq and resque integration tests work in ci
  • Loading branch information
kamipo committed Nov 13, 2017
2 parents a968a76 + 8e96455 commit 705cf47
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Expand Up @@ -73,21 +73,25 @@ matrix:
env: "GEM=aj:integration"
services:
- memcached
- redis-server
- rabbitmq
- rvm: 2.3.5
env: "GEM=aj:integration"
services:
- memcached
- redis-server
- rabbitmq
- rvm: 2.4.2
env: "GEM=aj:integration"
services:
- memcached
- redis-server
- rabbitmq
- rvm: ruby-head
env: "GEM=aj:integration"
services:
- memcached
- redis-server
- rabbitmq
- rvm: 2.3.5
env:
Expand Down
5 changes: 3 additions & 2 deletions activejob/test/support/integration/adapters/resque.rb
Expand Up @@ -3,11 +3,12 @@
module ResqueJobsManager
def setup
ActiveJob::Base.queue_adapter = :resque
Resque.redis = Redis::Namespace.new "active_jobs_int_test", redis: Redis.new(url: "redis://:password@127.0.0.1:6379/12", thread_safe: true)
Resque.redis = Redis::Namespace.new "active_jobs_int_test", redis: Redis.new(url: "redis://127.0.0.1:6379/12", thread_safe: true)
Resque.logger = Rails.logger
unless can_run?
puts "Cannot run integration tests for resque. To be able to run integration tests for resque you need to install and start redis.\n"
exit
status = ENV["CI"] ? false : true
exit status
end
end

Expand Down
11 changes: 2 additions & 9 deletions activejob/test/support/integration/adapters/sidekiq.rb
Expand Up @@ -5,20 +5,13 @@
require "sidekiq/testing"
Sidekiq::Testing.disable!

Sidekiq.configure_server do |config|
config.redis = { url: "redis://:password@127.0.0.1:6379/12" }
end

Sidekiq.configure_client do |config|
config.redis = { url: "redis://:password@127.0.0.1:6379/12" }
end

module SidekiqJobsManager
def setup
ActiveJob::Base.queue_adapter = :sidekiq
unless can_run?
puts "Cannot run integration tests for sidekiq. To be able to run integration tests for sidekiq you need to install and start redis.\n"
exit
status = ENV["CI"] ? false : true
exit status
end
end

Expand Down

0 comments on commit 705cf47

Please sign in to comment.