Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Sidekiq queuing #2347

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading