-
Notifications
You must be signed in to change notification settings - Fork 2
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
Convert C2M to worker Queue #1062
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
62e9c33
Replace "class level" c2m logic, add c2m Job
atz acafe6f
Ensure order to make ordered comparison
atz 3cbc292
Add `preserved_object_fixture` factory to replace `load_fixture_moabs`
atz c1a34f0
Rename c2m "instance" spec and convert from load_fixtures_helper
atz 6660573
Tests for the new job and MSR method wrapping it
atz 4ff63aa
Update README to match async C2M
atz File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Check filesystem based on catalog, updating database | ||
# @see Audit::CatalogToMoab | ||
class CatalogToMoabJob < ApplicationJob | ||
queue_as :c2m | ||
|
||
before_enqueue do |job| | ||
raise ArgumentError, 'CompleteMoab param required' unless job.arguments.first.is_a?(CompleteMoab) | ||
end | ||
|
||
# @param [CompleteMoab] complete_moab object to C2M check | ||
# @param [String] storage_dir | ||
# @see Audit::CatalogToMoab#initialize | ||
def perform(complete_moab, storage_dir) | ||
Audit::CatalogToMoab.new(complete_moab, storage_dir).check_catalog_version | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'rails_helper' | ||
|
||
describe CatalogToMoabJob, type: :job do | ||
let(:job) { described_class.new(cm) } | ||
let(:cm) { create :complete_moab } | ||
let(:storage_dir) { 'foobar' } | ||
|
||
describe '#perform' do | ||
let(:validator) { instance_double(Audit::CatalogToMoab) } | ||
|
||
it 'calls Audit::CatalogToMoab#check_catalog_version' do | ||
expect(validator).to receive(:check_catalog_version) | ||
expect(Audit::CatalogToMoab).to receive(:new).with(cm, storage_dir).and_return(validator) | ||
job.perform(cm, storage_dir) | ||
end | ||
end | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nitpick (leftovers from the prior PR that got rid of sort order on the scope): it'd be nice to move these comments to the class methods that are now provided as ordering wrappers.