Sha256: 75947a438a3d1756c851464781f8800c03393725b6c53cb26f93d8a70a6ca7fb

Contents?: true

Size: 985 Bytes

Versions: 64

Compression:

Stored size: 985 Bytes

Contents

require 'spec_helper'
require 'sidekiq/testing'

Sidekiq::Testing.server_middleware do |chain|
  chain.add CanvasSync::JobBatches::Sidekiq::ServerMiddleware
end

Sidekiq.redis { |r| r.flushdb }

def redis_keys
  Sidekiq.redis { |r| r.keys('BID-*') }
end

def dump_redis_keys
  puts redis_keys.inspect
end

def process_tests
  out_buf = StringIO.new
  Sidekiq.logger = Logger.new out_buf

  # Sidekiq.logger.level = :info

  Sidekiq::Worker.drain_all

  output = out_buf.string
  keys = redis_keys
  puts out_buf.string

  [output, keys]
end

def overall_tests(output, keys, file: nil)
  test_name = "Batch Integration Test"
  test_name = File.basename(file, ".*")  if file

  Rspec.describe test_name do
    it "runs overall complete callback" do
      expect(output).to include "Overall Complete"
    end

    it "runs overall success callback" do
      expect(output).to include "Overall Success"
    end

    it "cleans redis keys" do
      expect(keys).to eq([])
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
canvas_sync-0.17.17.beta1 spec/job_batching/integration_helper.rb
canvas_sync-0.17.16 spec/job_batching/integration_helper.rb
canvas_sync-0.17.15 spec/job_batching/integration_helper.rb
canvas_sync-0.17.14 spec/job_batching/integration_helper.rb
canvas_sync-0.17.13 spec/job_batching/integration_helper.rb
canvas_sync-0.17.12 spec/job_batching/integration_helper.rb
canvas_sync-0.17.10.beta2 spec/job_batching/integration_helper.rb
canvas_sync-0.17.10.beta1 spec/job_batching/integration_helper.rb
canvas_sync-0.17.8 spec/job_batching/integration_helper.rb
canvas_sync-0.17.8.beta4 spec/job_batching/integration_helper.rb
canvas_sync-0.17.8.beta3 spec/job_batching/integration_helper.rb
canvas_sync-0.17.8.beta2 spec/job_batching/integration_helper.rb
canvas_sync-0.17.8.beta1 spec/job_batching/integration_helper.rb
canvas_sync-0.17.7 spec/job_batching/integration_helper.rb
canvas_sync-0.17.7.beta1 spec/job_batching/integration_helper.rb
canvas_sync-0.17.6 spec/job_batching/integration_helper.rb
canvas_sync-0.17.6.beta1 spec/job_batching/integration_helper.rb
canvas_sync-0.17.5 spec/job_batching/integration_helper.rb
canvas_sync-0.17.5.beta2 spec/job_batching/integration_helper.rb
canvas_sync-0.17.5.beta1 spec/job_batching/integration_helper.rb