Skip to content

Commit 3524640

Browse files
committed
Cleaned aws test and typed status_range_matcher
1 parent 243d790 commit 3524640

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

sig/datadog/tracing/contrib/status_range_matcher.rbs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@ module Datadog
22
module Tracing
33
module Contrib
44
class StatusRangeMatcher
5-
@ranges: Array[Integer | Range[Integer]]
5+
type range_type = Array[Integer | Range[Integer]]
66

7-
attr_reader ranges: Array[Integer | Range[Integer]]
7+
@ranges: range_type
88

9-
def initialize: (untyped ranges) -> void
9+
attr_reader ranges: range_type
10+
11+
def initialize: (Integer | Range[Integer] | range_type ranges) -> void
1012

1113
def +: (StatusRangeMatcher other) -> StatusRangeMatcher
1214

1315
alias concat +
1416

15-
def include?: (untyped status) -> untyped
17+
def include?: (Integer status) -> bool
1618
end
1719
end
1820
end

spec/datadog/tracing/contrib/aws/instrumentation_spec.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414

1515
RSpec.describe 'AWS instrumentation' do
1616
let(:configuration_options) { {} }
17+
let(:server_error_statuses) { nil }
1718

1819
before do
1920
Datadog.configure do |c|
2021
c.tracing.instrument :aws, configuration_options
22+
c.tracing.http_error_statuses.server = server_error_statuses if server_error_statuses
2123
end
2224
end
2325

@@ -179,11 +181,7 @@
179181
end
180182

181183
context 'when the server error statuses are configured to include 404' do
182-
before do
183-
Datadog.configure do |c|
184-
c.tracing.http_error_statuses.server = 400..599
185-
end
186-
end
184+
let(:server_error_statuses) { 400..599 }
187185

188186
it 'generates an errored span' do
189187
expect do

0 commit comments

Comments
 (0)