Skip to content

Commit

Permalink
Merge pull request #1529 from sanger/develop
Browse files Browse the repository at this point in the history
Merging develop to master
  • Loading branch information
seenanair authored Jan 21, 2025
2 parents 42cd36d + f3f9175 commit c50f5f1
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.22.0
7.22.1
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ GEM
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.1)
rubocop (1.69.2)
rubocop (1.70.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/aliquotable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def primary_aliquot_volume_sufficient
def used_aliquots_volume
# Get all the aliquots that are libraries or pools and have insufficient volume
failed_aliquots = used_aliquots.select do |aliquot|
(aliquot.source_type == 'Pacbio::Library' || aliquot.source_type == 'Pacbio::Pool') &&
['Pacbio::Library', 'Pacbio::Pool'].include?(aliquot.source_type) &&
!aliquot.source.available_volume_sufficient
end
return if failed_aliquots.empty?
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
module TractionService
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.1
config.load_defaults 7.2

# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
Expand Down
2 changes: 1 addition & 1 deletion config/pipelines/pacbio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ default: &default
value: publish_data&.message_uuid
recordedAt:
type: :model
value: created_at
value: updated_at
volume:
type: :model
value: volume
Expand Down
2 changes: 1 addition & 1 deletion spec/messages/emq/encoder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
RSpec.describe Emq::Encoder do
let(:pacbio_library) { create(:pacbio_library) }
let(:pacbio_pool) { create(:pacbio_pool) }
let(:aliquot) { build(:aliquot, uuid: SecureRandom.uuid, source: pacbio_library, used_by: pacbio_pool, created_at: Time.zone.now) }
let(:aliquot) { build(:aliquot, uuid: SecureRandom.uuid, source: pacbio_library, used_by: pacbio_pool, created_at: Time.zone.now, updated_at: Time.zone.now) }
let(:cache_file_path) { "data/avro_schema_cache/#{schema_subject}_v#{schema_version}.avsc" }
let(:schema_key) { 'volume_tracking' }
let(:schema_subject) { 'create-aliquot-in-mlwh' }
Expand Down
6 changes: 3 additions & 3 deletions spec/messages/emq/publishing_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
RSpec.describe Emq::PublishingJob do
let(:pacbio_library) { create(:pacbio_library) }
let(:pacbio_pool) { create(:pacbio_pool) }
let(:aliquot) { build(:aliquot, uuid: SecureRandom.uuid, source: pacbio_library, used_by: pacbio_pool, created_at: Time.zone.now) }
let(:aliquot) { build(:aliquot, uuid: SecureRandom.uuid, source: pacbio_library, used_by: pacbio_pool, created_at: Time.zone.now, updated_at: Time.zone.now) }

let(:publishing_job) { described_class.new }
let(:emq_sender_mock) { instance_double(Emq::Sender) }
Expand Down Expand Up @@ -75,13 +75,13 @@
it 'can publish multiple messages' do
expect(emq_sender_mock).to receive(:send_message).twice
expect(Rails.logger).to receive(:info).with('Published volume tracking message to EMQ')
aliquot2 = build(:aliquot, uuid: SecureRandom.uuid, source: pacbio_library, used_by: pacbio_pool, created_at: Time.zone.now)
aliquot2 = build(:aliquot, uuid: SecureRandom.uuid, source: pacbio_library, used_by: pacbio_pool, created_at: Time.zone.now, updated_at: Time.zone.now)
publishing_job.publish([aliquot, aliquot2], Pipelines.pacbio, 'volume_tracking')
end

it 'does not publish messages when schema key is missing in config' do
expect(emq_sender_mock).not_to receive(:send_message)
aliquot2 = build(:aliquot, uuid: SecureRandom.uuid, source: pacbio_library, used_by: pacbio_pool, created_at: Time.zone.now)
aliquot2 = build(:aliquot, uuid: SecureRandom.uuid, source: pacbio_library, used_by: pacbio_pool, created_at: Time.zone.now, updated_at: Time.zone.now)
publishing_job.publish([aliquot, aliquot2], Pipelines.pacbio, 'test')
end

Expand Down

0 comments on commit c50f5f1

Please sign in to comment.