aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/support
diff options
context:
space:
mode:
authorAbdelkader Boudih <terminale@gmail.com>2014-08-12 09:29:21 +0000
committerAbdelkader Boudih <terminale@gmail.com>2014-08-12 10:07:21 +0000
commit0c232779ece1ff6bf9bce9d55c54ea19867a2170 (patch)
treefd833a906bdf4a982d01046f9cdfe6d0d720fdc7 /activejob/test/support
parenta75f085941b2d6aed160f5f2f7e64e5fc7e03826 (diff)
downloadrails-0c232779ece1ff6bf9bce9d55c54ea19867a2170.tar.gz
rails-0c232779ece1ff6bf9bce9d55c54ea19867a2170.tar.bz2
rails-0c232779ece1ff6bf9bce9d55c54ea19867a2170.zip
Remove activejob integration tests
Diffstat (limited to 'activejob/test/support')
-rw-r--r--activejob/test/support/integration/adapters/backburner.rb15
-rw-r--r--activejob/test/support/integration/adapters/delayed_job.rb14
-rw-r--r--activejob/test/support/integration/adapters/qu.rb14
-rw-r--r--activejob/test/support/integration/adapters/que.rb19
-rw-r--r--activejob/test/support/integration/adapters/queue_classic.rb21
-rw-r--r--activejob/test/support/integration/adapters/resque.rb18
-rw-r--r--activejob/test/support/integration/adapters/sidekiq.rb19
-rw-r--r--activejob/test/support/integration/adapters/sneakers.rb18
-rw-r--r--activejob/test/support/integration/adapters/sucker_punch.rb5
-rw-r--r--activejob/test/support/integration/helper.rb12
-rw-r--r--activejob/test/support/integration/jobs_manager.rb23
-rw-r--r--activejob/test/support/integration/test_case_helpers.rb30
12 files changed, 0 insertions, 208 deletions
diff --git a/activejob/test/support/integration/adapters/backburner.rb b/activejob/test/support/integration/adapters/backburner.rb
deleted file mode 100644
index 7271d50a45..0000000000
--- a/activejob/test/support/integration/adapters/backburner.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module BackburnerJobsManager
- def clear_jobs
- Backburner::Worker.connection.tubes.all.map &:clear
- end
-
- def start_workers
- @thread = Thread.new { Backburner.work "active-jobs-default" }
- end
-
- def stop_workers
- @thread.kill
- end
-
-end
-
diff --git a/activejob/test/support/integration/adapters/delayed_job.rb b/activejob/test/support/integration/adapters/delayed_job.rb
deleted file mode 100644
index 3e55933438..0000000000
--- a/activejob/test/support/integration/adapters/delayed_job.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-module DelayedJobJobsManager
- def clear_jobs
- Delayed::Job.delete_all
- end
-
- def start_workers
- @worker = Delayed::Worker.new(quiet: false, sleep_delay: 0.5)
- @thread = Thread.new { @worker.start }
- end
-
- def stop_workers
- @worker.stop
- end
-end
diff --git a/activejob/test/support/integration/adapters/qu.rb b/activejob/test/support/integration/adapters/qu.rb
deleted file mode 100644
index 12d063ea0d..0000000000
--- a/activejob/test/support/integration/adapters/qu.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-module QuJobsManager
- def clear_jobs
- Qu.clear "active_jobs_default"
- end
-
- def start_workers
- @thread = Thread.new { Qu::Worker.new("active_jobs_default").start }
- end
-
- def stop_workers
- @thread.kill
- end
-end
-
diff --git a/activejob/test/support/integration/adapters/que.rb b/activejob/test/support/integration/adapters/que.rb
deleted file mode 100644
index f15c9af910..0000000000
--- a/activejob/test/support/integration/adapters/que.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-module QueJobsManager
- def clear_jobs
- Que.clear!
- end
-
- def start_workers
- @thread = Thread.new do
- loop do
- Que::Job.work("active_jobs_default")
- sleep 0.5
- end
- end
- end
-
- def stop_workers
- @thread.kill
- end
-end
-
diff --git a/activejob/test/support/integration/adapters/queue_classic.rb b/activejob/test/support/integration/adapters/queue_classic.rb
deleted file mode 100644
index 3b24eca5b9..0000000000
--- a/activejob/test/support/integration/adapters/queue_classic.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-module QC; WAIT_TIME = 0.5; end
-
-module QueueClassicJobsManager
- def clear_jobs
- # disabling this as it locks
- # QC::Queue.new("active_jobs_default").delete_all
- end
-
- def start_workers
- @pid = fork do
- QC::Conn.connection = QC::Conn.connect
- worker = QC::Worker.new(q_name: 'active_jobs_default')
- worker.start
- end
- end
-
- def stop_workers
- Process.kill 'HUP', @pid
- end
-end
-
diff --git a/activejob/test/support/integration/adapters/resque.rb b/activejob/test/support/integration/adapters/resque.rb
deleted file mode 100644
index b9811bd3e1..0000000000
--- a/activejob/test/support/integration/adapters/resque.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-module ResqueJobsManager
- def clear_jobs
- Resque.queues.each { |queue_name| Resque.redis.del "queue:#{queue_name}" }
- Resque.redis.keys("delayed:*").each { |key| Resque.redis.del "#{key}" }
- Resque.redis.del "delayed_queue_schedule"
- end
-
- def start_workers
- @thread = Thread.new do
- Resque::Worker.new("*").work(0.5)
- end
- end
-
- def stop_workers
- @thread.kill
- end
-end
-
diff --git a/activejob/test/support/integration/adapters/sidekiq.rb b/activejob/test/support/integration/adapters/sidekiq.rb
deleted file mode 100644
index d3b7d15614..0000000000
--- a/activejob/test/support/integration/adapters/sidekiq.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require 'sidekiq/launcher'
-require 'sidekiq/api'
-
-module SidekiqJobsManager
- def clear_jobs
- Sidekiq::Queue.new("active_jobs_default").clear
- end
-
- def start_workers
- options = {:queues=>["active_jobs_default"], :concurrency=>1, :environment=>"test", :timeout=>8, :daemon=>true, :strict=>true}
- @launcher = Sidekiq::Launcher.new(options)
- @launcher.run
- end
-
- def stop_workers
- @launcher.stop
- end
-end
-
diff --git a/activejob/test/support/integration/adapters/sneakers.rb b/activejob/test/support/integration/adapters/sneakers.rb
deleted file mode 100644
index 5dcab68515..0000000000
--- a/activejob/test/support/integration/adapters/sneakers.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'sneakers/runner'
-
-module SneakersJobsManager
- def clear_jobs
- end
-
- def start_workers
- cmd = %{cd #{Rails.root.to_s} && (RAILS_ENV=test AJADAPTER=sneakers WORKERS=ActiveJob::QueueAdapters::SneakersAdapter::JobWrapper bundle exec rake --trace sneakers:run)}
- `#{cmd}`
- while !Rails.root.join("tmp/sneakers.pid").exist? do
- sleep 0.5
- end
- end
-
- def stop_workers
- Process.kill 'TERM', File.open(Rails.root.join("tmp/sneakers.pid").to_s).read.to_i
- end
-end
diff --git a/activejob/test/support/integration/adapters/sucker_punch.rb b/activejob/test/support/integration/adapters/sucker_punch.rb
deleted file mode 100644
index 317f9c80fd..0000000000
--- a/activejob/test/support/integration/adapters/sucker_punch.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module SuckerPunchJobsManager
- def clear_jobs
- end
-end
-
diff --git a/activejob/test/support/integration/helper.rb b/activejob/test/support/integration/helper.rb
deleted file mode 100644
index cb94e7cfb5..0000000000
--- a/activejob/test/support/integration/helper.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-ENV["RAILS_ENV"] = "test"
-require File.expand_path("../../../dummy/config/environment.rb", __FILE__)
-require "rails/test_help"
-Rails.backtrace_cleaner.remove_silencers!
-
-require_relative 'test_case_helpers'
-ActiveSupport::TestCase.send(:include, TestCaseHelpers)
-
-JobsManager.current_manager.setup
-JobsManager.current_manager.start_workers
-Minitest.after_run { JobsManager.current_manager.stop_workers }
-
diff --git a/activejob/test/support/integration/jobs_manager.rb b/activejob/test/support/integration/jobs_manager.rb
deleted file mode 100644
index 1da74193b1..0000000000
--- a/activejob/test/support/integration/jobs_manager.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-class JobsManager
- @@managers = {}
- attr :adapter_name
-
- def self.current_manager
- @@managers[ENV['AJADAPTER']] ||= new(ENV['AJADAPTER'])
- end
-
- def initialize(adapter_name)
- @adapter_name = adapter_name
- require_relative "adapters/#{adapter_name}"
- extend "#{adapter_name.camelize}JobsManager".constantize
- end
-
- def setup
- end
-
- def start_workers
- end
-
- def stop_workers
- end
-end
diff --git a/activejob/test/support/integration/test_case_helpers.rb b/activejob/test/support/integration/test_case_helpers.rb
deleted file mode 100644
index 9a5eea0783..0000000000
--- a/activejob/test/support/integration/test_case_helpers.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require 'active_support/concern'
-require 'support/integration/jobs_manager'
-
-module TestCaseHelpers
- extend ActiveSupport::Concern
-
- included do
- self.use_transactional_fixtures = false
-
- setup do
- clear_jobs
- end
-
- teardown do
- clear_jobs
- FileUtils.rm_rf Dir[Dummy::Application.root.join("tmp/AJ-*")]
- end
- end
-
- protected
-
- def jobs_manager
- JobsManager.current_manager
- end
-
- def clear_jobs
- jobs_manager.clear_jobs
- end
-
-end