canvas_sync 0.17.5 → 0.17.8.beta1

Sign up to get free protection for your applications and to get access to all the features.
@@ -227,6 +227,34 @@ RSpec.describe CanvasSync::JobBatches::Batch do
227
227
  end
228
228
  end
229
229
 
230
+ it 'delays triggering callbacks if keep_open is set' do
231
+ ActiveJob::Base.queue_adapter = :sidekiq
232
+ CanvasSync::JobBatches::Batch::Callback.worker_class = CanvasSync::JobBatches::Sidekiq::SidekiqCallbackWorker
233
+
234
+ callback_instance = double('SampleCallback')
235
+ expect(SampleCallback).to receive(:new).at_least(1).times.and_return(callback_instance)
236
+ expect(callback_instance).not_to receive(:on_complete)
237
+ expect(callback_instance).not_to receive(:on_success)
238
+
239
+ batch.on(:complete, SampleCallback)
240
+ batch.on(:success, SampleCallback)
241
+ batch.keep_open!
242
+
243
+ Sidekiq::Testing.inline! do
244
+ CanvasSync::JobBatches::Batch.process_failed_job(bid, jid)
245
+ CanvasSync::JobBatches::Batch.process_successful_job(bid, jid)
246
+ end
247
+
248
+ RSpec::Mocks.space.proxy_for(callback_instance).reset
249
+
250
+ expect(callback_instance).to receive(:on_complete)
251
+ expect(callback_instance).to receive(:on_success)
252
+
253
+ Sidekiq::Testing.inline! do
254
+ batch.let_close!
255
+ end
256
+ end
257
+
230
258
  it 'triggers callbacks as expected' do
231
259
  ActiveJob::Base.queue_adapter = :sidekiq
232
260
  CanvasSync::JobBatches::Batch.redis { |r| r.hset("BID-#{bid}", 'pending', 0) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.5
4
+ version: 0.17.8.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Collings
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-02 00:00:00.000000000 Z
11
+ date: 2021-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -421,6 +421,7 @@ files:
421
421
  - lib/canvas_sync/job_batches/pool.rb
422
422
  - lib/canvas_sync/job_batches/redis_model.rb
423
423
  - lib/canvas_sync/job_batches/redis_script.rb
424
+ - lib/canvas_sync/job_batches/schedule_callback.lua
424
425
  - lib/canvas_sync/job_batches/sidekiq.rb
425
426
  - lib/canvas_sync/job_batches/sidekiq/web.rb
426
427
  - lib/canvas_sync/job_batches/sidekiq/web/helpers.rb
@@ -644,9 +645,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
644
645
  version: '0'
645
646
  required_rubygems_version: !ruby/object:Gem::Requirement
646
647
  requirements:
647
- - - ">="
648
+ - - ">"
648
649
  - !ruby/object:Gem::Version
649
- version: '0'
650
+ version: 1.3.1
650
651
  requirements: []
651
652
  rubygems_version: 3.0.3
652
653
  signing_key: