Skip to content

Commit

Permalink
Test Sidekiq queuing
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkadel committed Apr 16, 2024
1 parent 96dcee5 commit af64344
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ bundle install
1. For development:
- `bundle exec rails server`
- Access bibdata at http://localhost:3000/
- If you will be working with background jobs in development, include your netid so you are recognized as an admin `BIBDATA_ADMIN_NETIDS=yournetid bundle exec rails server`
1. If you are working with background jobs in development, start sidekiq in a new tab or window
- `bundle exec sidekiq`
- To access the sidekiq dashboard, first sign into the application, then go to http://localhost:3000/sidekiq
Expand Down
9 changes: 6 additions & 3 deletions spec/jobs/dump_file_index_job_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
require 'rails_helper'

RSpec.describe DumpFileIndexJob do
let(:dump) { FactoryBot.create(:incremental_dump) }
let(:dump_file_id) { dump.dump_files.first.id }
describe "#perform" do
it "raises an error when traject errors" do
dump = FactoryBot.create(:incremental_dump)

expect { described_class.new.perform(dump.dump_files.first.id, "http://localhost:8983/solr/badcollection") }.to raise_error
expect { described_class.new.perform(dump_file_id, "http://localhost:8983/solr/badcollection") }.to raise_error
end
end
it 'enqueues the job once' do
expect { described_class.perform_async(dump_file_id, '') }.to change(described_class.jobs, :size).by(1)
end
end

0 comments on commit af64344

Please sign in to comment.