canvas_sync 0.17.0.beta2 → 0.17.0.beta7
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.rb +2 -1
- data/lib/canvas_sync/job_batches/batch.rb +52 -40
- data/lib/canvas_sync/job_batches/callback.rb +14 -15
- data/lib/canvas_sync/job_batches/chain_builder.rb +17 -0
- data/lib/canvas_sync/job_batches/jobs/concurrent_batch_job.rb +1 -0
- data/lib/canvas_sync/job_batches/jobs/serial_batch_job.rb +3 -1
- data/lib/canvas_sync/job_batches/sidekiq.rb +2 -0
- data/lib/canvas_sync/job_batches/status.rb +21 -1
- data/lib/canvas_sync/jobs/begin_sync_chain_job.rb +2 -1
- data/lib/canvas_sync/jobs/sync_provisioning_report_job.rb +0 -3
- data/lib/canvas_sync/jobs/sync_terms_job.rb +3 -1
- data/lib/canvas_sync/version.rb +1 -1
- data/spec/canvas_sync/canvas_sync_spec.rb +20 -10
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +1248 -0
- data/spec/dummy/log/test.log +43258 -0
- data/spec/job_batching/batch_spec.rb +12 -3
- data/spec/job_batching/flow_spec.rb +0 -3
- data/spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv +3 -0
- data/spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv +4 -0
- metadata +12 -2
@@ -182,12 +182,12 @@ RSpec.describe CanvasSync::JobBatches::Batch do
|
|
182
182
|
context 'complete' do
|
183
183
|
before { batch.on(:complete, Object) }
|
184
184
|
# before { batch.increment_job_queue(bid) }
|
185
|
-
before { batch.jobs do TestWorker.perform_async end }
|
186
|
-
before { CanvasSync::JobBatches::Batch.process_failed_job(bid, 'failed-job-id') }
|
185
|
+
# before { batch.jobs do TestWorker.perform_async end }
|
186
|
+
# before { CanvasSync::JobBatches::Batch.process_failed_job(bid, 'failed-job-id') }
|
187
187
|
|
188
188
|
it 'tries to call complete callback' do
|
189
189
|
expect(CanvasSync::JobBatches::Batch).to receive(:enqueue_callbacks).with(:complete, bid)
|
190
|
-
CanvasSync::JobBatches::Batch.
|
190
|
+
CanvasSync::JobBatches::Batch.process_failed_job(bid, 'failed-job-id')
|
191
191
|
end
|
192
192
|
end
|
193
193
|
|
@@ -199,6 +199,15 @@ RSpec.describe CanvasSync::JobBatches::Batch do
|
|
199
199
|
CanvasSync::JobBatches::Batch.process_successful_job(bid, jid)
|
200
200
|
end
|
201
201
|
|
202
|
+
it 'tries to call success callback after a previous failure' do
|
203
|
+
expect(CanvasSync::JobBatches::Batch).to receive(:enqueue_callbacks).with(:complete, bid).ordered
|
204
|
+
CanvasSync::JobBatches::Batch.process_failed_job(bid, jid)
|
205
|
+
|
206
|
+
expect(CanvasSync::JobBatches::Batch).to receive(:enqueue_callbacks).with(:complete, bid).ordered
|
207
|
+
expect(CanvasSync::JobBatches::Batch).to receive(:enqueue_callbacks).with(:success, bid).ordered
|
208
|
+
CanvasSync::JobBatches::Batch.process_successful_job(bid, jid)
|
209
|
+
end
|
210
|
+
|
202
211
|
it 'cleanups redis key' do
|
203
212
|
CanvasSync::JobBatches::Batch.process_successful_job(bid, jid)
|
204
213
|
expect(CanvasSync::JobBatches::Batch.redis { |r| r.get("BID-#{bid}-pending") }.to_i).to eq(0)
|
@@ -2,19 +2,16 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
class WorkerA < BatchTestJobBase
|
4
4
|
def perform
|
5
|
-
puts 'A'
|
6
5
|
end
|
7
6
|
end
|
8
7
|
|
9
8
|
class WorkerB < BatchTestJobBase
|
10
9
|
def perform
|
11
|
-
puts 'B'
|
12
10
|
end
|
13
11
|
end
|
14
12
|
|
15
13
|
class WorkerC < BatchTestJobBase
|
16
14
|
def perform
|
17
|
-
puts 'C'
|
18
15
|
end
|
19
16
|
end
|
20
17
|
|
@@ -0,0 +1,3 @@
|
|
1
|
+
canvas_course_id,course_id,integration_id,short_name,long_name,canvas_account_id,account_id,canvas_term_id,term_id,status,start_date,end_date,course_format,created_by_sis
|
2
|
+
1,course_sis_id_1,,C1,Course #1,1,,1,term_sis_id_1,active,2017-03-27T15:53:18-06:00,2017-04-27T06:21:18-06:00,,FALSE
|
3
|
+
2,course_sis_id_2,,C2,Course #2,1,,1,term_sis_id_2,unpublished,2017-03-27T15:53:18-06:00,2017-04-27T06:21:18-06:00,,FALSE
|
@@ -0,0 +1,4 @@
|
|
1
|
+
canvas_user_id,user_id,integration_id,authentication_provider_id,login_id,first_name,last_name,full_name,sortable_name,short_name,email,status,created_by_sis
|
2
|
+
1,sis_id_1,,123,spiderdude1337,Patches,the Spider,Patches the Spider,"the Spider, Patches",,poorbastard@yharnam.com,active,FALSE
|
3
|
+
2,sis_id_2,,1234,retireddude109,Hunter,Djura,Hunter Djura,"Djura, Hunter",,dreamer@yharnam.com,active,FALSE
|
4
|
+
2,sis_id_2,,1234,retireddude110,Hunter,Djura,Hunter Djura,"Djura, Hunter",,dreamer@yharnam.com,active,FALSE
|
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.0.
|
4
|
+
version: 0.17.0.beta7
|
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-10-
|
11
|
+
date: 2020-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -576,6 +576,9 @@ files:
|
|
576
576
|
- spec/dummy/db/migrate/20200416214248_create_group_memberships.rb
|
577
577
|
- spec/dummy/db/migrate/20201016181346_create_pseudonyms.rb
|
578
578
|
- spec/dummy/db/schema.rb
|
579
|
+
- spec/dummy/db/test.sqlite3
|
580
|
+
- spec/dummy/log/development.log
|
581
|
+
- spec/dummy/log/test.log
|
579
582
|
- spec/factories/account_factory.rb
|
580
583
|
- spec/factories/admin_factory.rb
|
581
584
|
- spec/factories/assignment_factory.rb
|
@@ -620,6 +623,8 @@ files:
|
|
620
623
|
- spec/support/fixtures/reports/group_memberships.csv
|
621
624
|
- spec/support/fixtures/reports/groups.csv
|
622
625
|
- spec/support/fixtures/reports/provisioning_csv
|
626
|
+
- spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv
|
627
|
+
- spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv
|
623
628
|
- spec/support/fixtures/reports/sections.csv
|
624
629
|
- spec/support/fixtures/reports/submissions.csv
|
625
630
|
- spec/support/fixtures/reports/users.csv
|
@@ -764,6 +769,9 @@ test_files:
|
|
764
769
|
- spec/dummy/db/migrate/20200416214248_create_group_memberships.rb
|
765
770
|
- spec/dummy/db/migrate/20201016181346_create_pseudonyms.rb
|
766
771
|
- spec/dummy/db/schema.rb
|
772
|
+
- spec/dummy/db/test.sqlite3
|
773
|
+
- spec/dummy/log/development.log
|
774
|
+
- spec/dummy/log/test.log
|
767
775
|
- spec/factories/account_factory.rb
|
768
776
|
- spec/factories/admin_factory.rb
|
769
777
|
- spec/factories/assignment_factory.rb
|
@@ -808,6 +816,8 @@ test_files:
|
|
808
816
|
- spec/support/fixtures/reports/group_memberships.csv
|
809
817
|
- spec/support/fixtures/reports/groups.csv
|
810
818
|
- spec/support/fixtures/reports/provisioning_csv
|
819
|
+
- spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv
|
820
|
+
- spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv
|
811
821
|
- spec/support/fixtures/reports/sections.csv
|
812
822
|
- spec/support/fixtures/reports/submissions.csv
|
813
823
|
- spec/support/fixtures/reports/users.csv
|