Skip to content

Commit d7f2a14

Browse files
committed
Make ActiveJob tests runnable with bin/test again
A few things: * Removal of delayed_job in the Gemfile causes a load error. CI is fine since this file is filtered out in the rake task * The async adapter test assumes the async adapter to be present. Again not a problem on CI, but the default is the inline adapter * Integration tests are run, they reference a job that is present only in the dummy app
1 parent 8b544b2 commit d7f2a14

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

activejob/test/cases/async_adapter_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# frozen_string_literal: true
22

33
require "helper"
4-
require "active_job/queue_adapters/async_adapter"
54
require "jobs/hello_job"
65

6+
return unless adapter_is?(:async)
7+
78
class AsyncAdapterTest < ActiveSupport::TestCase
89
setup do
910
JobBuffer.clear

activejob/test/cases/delayed_job_adapter_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# frozen_string_literal: true
22

33
require "helper"
4-
require "active_job/queue_adapters/delayed_job_adapter"
54
require "jobs/disable_log_job"
65
require "jobs/hello_job"
76

7+
return unless adapter_is?(:delayed_job)
8+
89
class DelayedJobAdapterTest < ActiveSupport::TestCase
910
test "does not log arguments when log_arguments is set to false on a job" do
1011
job_id = SecureRandom.uuid

activejob/test/integration/queuing_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
require "jobs/provider_jid_job"
77
require "active_support/core_ext/numeric/time"
88

9+
return unless ENV["AJ_INTEGRATION_TESTS"] == "1"
10+
911
class QueuingTest < ActiveSupport::TestCase
1012
test "should run jobs enqueued on a listening queue" do
1113
TestJob.perform_later @id

0 commit comments

Comments
 (0)