Skip to content

Commit

Permalink
91828: Add CODEOWNER, update test
Browse files Browse the repository at this point in the history
  • Loading branch information
balexandr committed Oct 25, 2024
1 parent a95593e commit c2022b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2115,8 +2115,8 @@ lib/va_profile/profile/v3/health_benefit_bio_response.rb @department-of-veterans
lib/va_profile/profile/v3/service.rb @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/vfs-mhv-integration @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/controllers/v0/profile/contacts_controller_spec.rb @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/vfs-mhv-integration @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/lib/va_profile/profile/v3/service_spec.rb @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/vfs-mhv-integration @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
lib/logging/third_party_transaction.rb @department-of-veterans-affairs/backend-review-group
spec/lib/logging/third_party_transaction_spec.rb @department-of-veterans-affairs/backend-review-group
lib/logging @department-of-veterans-affairs/backend-review-group @department-of-veterans-affairs/va-api-engineers
spec/lib/logging @department-of-veterans-affairs/backend-review-group @department-of-veterans-affairs/va-api-engineers
spec/lib/zero_silent_failures @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Brewfile @department-of-veterans-affairs/backend-review-group
docker-compose-deps.yml @department-of-veterans-affairs/backend-review-group
Expand Down
25 changes: 13 additions & 12 deletions spec/lib/logging/sidekiq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
let(:service) { 'test-application' }
let(:monitor) { described_class.new(service) }
let(:call_location) { double('Location', base_label: 'method_name', path: '/path/to/file.rb', lineno: 42) }
let(:metric) { 'api.monitor.sidekiq.attempt' }
let(:metric) { 'api.monitor.sidekiq' }
let(:user_account_uuid) { '123-test-uuid' }
let(:benefits_intake_uuid) { '123-test-uuid' }
let(:additional_context) { { file: 'foobar.pdf', attachments: ['file.txt', 'file2.txt'] } }
Expand Down Expand Up @@ -53,9 +53,9 @@
context 'with a call location provided' do
describe '#track_claim_submission' do
it 'logs a request with call location' do
payload[:statsd] = 'api.monitor.sidekiq.attempt'
payload[:statsd] = 'api.monitor.sidekiq'

expect(StatsD).to receive(:increment).with('api.monitor.sidekiq.attempt')
expect(StatsD).to receive(:increment).with('api.monitor.sidekiq')
expect(Rails.logger).to receive(:info).with('Lighthouse::Job submission to LH attempted', payload)

monitor.track_claim_submission('Lighthouse::Job submission to LH attempted', metric, claim,
Expand All @@ -65,25 +65,26 @@

describe '#track_claim_submission_warn' do
it 'logs a request with call location' do
payload[:statsd] = 'api.monitor.sidekiq.attempt'
payload[:statsd] = 'api.monitor.sidekiq'

expect(StatsD).to receive(:increment).with('api.monitor.sidekiq.attempt')
expect(Rails.logger).to receive(:warn).with('Lighthouse::Job submission to LH attempted', payload)
expect(StatsD).to receive(:increment).with('api.monitor.sidekiq')
expect(Rails.logger).to receive(:warn).with('Lighthouse::Job submission to LH failure', payload)

monitor.track_claim_submission_warn('Lighthouse::Job submission to LH attempted', metric, claim,
monitor.track_claim_submission_warn('Lighthouse::Job submission to LH failure', metric, claim,
benefits_intake_uuid, user_account_uuid, additional_context, call_location:)
end
end

describe '#track_claim_submission_error' do
it 'logs a request with call location' do
payload[:statsd] = 'api.monitor.sidekiq.attempt'
payload[:statsd] = 'api.monitor.sidekiq'

expect(StatsD).to receive(:increment).with('api.monitor.sidekiq.attempt')
expect(Rails.logger).to receive(:error).with('Lighthouse::Job submission to LH attempted', payload)
expect(StatsD).to receive(:increment).with('api.monitor.sidekiq')
expect(Rails.logger).to receive(:error).with('Lighthouse::Job submission to LH exhausted!', payload)

monitor.track_claim_submission_error('Lighthouse::Job submission to LH attempted', metric, claim,
benefits_intake_uuid, user_account_uuid, additional_context, call_location:)
monitor.track_claim_submission_error('Lighthouse::Job submission to LH exhausted!', metric, claim,
benefits_intake_uuid, user_account_uuid,
additional_context, call_location:)
end
end
end
Expand Down

0 comments on commit c2022b5

Please sign in to comment.