canvas_sync 0.17.3.beta1 → 0.17.3.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/canvas_sync/job_batches/batch.rb +7 -13
- data/lib/canvas_sync/job_batches/callback.rb +1 -0
- data/lib/canvas_sync/job_batches/pool.rb +10 -26
- data/lib/canvas_sync/version.rb +1 -1
- data/spec/dummy/log/test.log +11166 -0
- data/spec/job_batching/flow_spec.rb +5 -10
- metadata +1 -1
@@ -21,16 +21,17 @@ RSpec.describe 'Batch flow' do
|
|
21
21
|
before { batch.on(:complete, SampleCallback, :id => 42) }
|
22
22
|
before { batch.description = 'describing the batch' }
|
23
23
|
let(:status) { CanvasSync::JobBatches::Batch::Status.new(batch.bid) }
|
24
|
-
let(:jids) { batch.jobs do 3.times do TestWorker.perform_async end end }
|
25
24
|
let(:queue) { Sidekiq::Queue.new }
|
26
25
|
|
27
26
|
it 'correctly initializes' do
|
28
|
-
expect(jids.size).to eq(3)
|
29
|
-
|
30
27
|
expect(batch.bid).not_to be_nil
|
31
28
|
expect(batch.description).to eq('describing the batch')
|
32
29
|
|
33
|
-
batch.jobs
|
30
|
+
batch.jobs do
|
31
|
+
3.times do
|
32
|
+
TestWorker.perform_async
|
33
|
+
end
|
34
|
+
end
|
34
35
|
|
35
36
|
expect(status.pending).to eq(3)
|
36
37
|
expect(status.failures).to eq(0)
|
@@ -38,12 +39,6 @@ RSpec.describe 'Batch flow' do
|
|
38
39
|
expect(status.created_at).not_to be_nil
|
39
40
|
expect(status.bid).to eq(batch.bid)
|
40
41
|
end
|
41
|
-
|
42
|
-
it 'handles an empty batch' do
|
43
|
-
batch = CanvasSync::JobBatches::Batch.new
|
44
|
-
jids = batch.jobs do nil end
|
45
|
-
expect(jids.size).to eq(0)
|
46
|
-
end
|
47
42
|
end
|
48
43
|
|
49
44
|
context 'when handling a nested batch' do
|