diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/lib/gitlab/ci/trace/metrics_spec.rb | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/lib/gitlab/ci/trace/metrics_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/trace/metrics_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/lib/gitlab/ci/trace/metrics_spec.rb b/spec/lib/gitlab/ci/trace/metrics_spec.rb index 53e55a57973..733ffbbea22 100644 --- a/spec/lib/gitlab/ci/trace/metrics_spec.rb +++ b/spec/lib/gitlab/ci/trace/metrics_spec.rb @@ -17,23 +17,23 @@ RSpec.describe Gitlab::Ci::Trace::Metrics, :prometheus do end describe '#increment_error_counter' do - context 'when the operation type is known' do + context 'when the error reason is known' do it 'increments the counter' do - subject.increment_error_counter(type: :chunks_invalid_size) - subject.increment_error_counter(type: :chunks_invalid_checksum) - subject.increment_error_counter(type: :archive_invalid_checksum) + subject.increment_error_counter(error_reason: :chunks_invalid_size) + subject.increment_error_counter(error_reason: :chunks_invalid_checksum) + subject.increment_error_counter(error_reason: :archive_invalid_checksum) - expect(described_class.trace_errors_counter.get(type: :chunks_invalid_size)).to eq 1 - expect(described_class.trace_errors_counter.get(type: :chunks_invalid_checksum)).to eq 1 - expect(described_class.trace_errors_counter.get(type: :archive_invalid_checksum)).to eq 1 + expect(described_class.trace_errors_counter.get(error_reason: :chunks_invalid_size)).to eq 1 + expect(described_class.trace_errors_counter.get(error_reason: :chunks_invalid_checksum)).to eq 1 + expect(described_class.trace_errors_counter.get(error_reason: :archive_invalid_checksum)).to eq 1 expect(described_class.trace_errors_counter.values.count).to eq 3 end end - context 'when the operation type is known' do + context 'when the error reason is unknown' do it 'raises an exception' do - expect { subject.increment_error_counter(type: :invalid_type) } + expect { subject.increment_error_counter(error_reason: :invalid_type) } .to raise_error(ArgumentError) end end |