Skip to content

Commit

Permalink
ci: AWS specs updated to use include() instead of match() (#229)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?

- The AWS gem/API starting returning a new field,
`x_amz_request_charged`. A new field made the spec matcher freak out in
the nightly.

## Short description of the changes

- Swap out `match()` for `include()` in the AWS specs
    - Match is strict and expects *only* what it has been told.
- Include is fine with new key/values appearing so long as the existing
ones are as expected.
  • Loading branch information
robbkidd authored Jul 7, 2023
1 parent 523fa52 commit 394a49c
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions spec/honeycomb/integrations/aws_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def version_of(service)
let(:api) { event_data.first }

it "sends the expected aws-sdk span" do
expect(sdk).to match(
expect(sdk).to include(
"name" => "aws-sdk",
"service_name" => "example",
"service.name" => "example",
Expand All @@ -120,7 +120,7 @@ def version_of(service)
end

it "sends the expected aws-api span" do
expect(api).to match(
expect(api).to include(
"name" => "aws-api",
"service_name" => "example",
"service.name" => "example",
Expand Down Expand Up @@ -186,7 +186,7 @@ def version_of(service)
let(:api) { event_data.first }

it "sends the expected aws-sdk span" do
expect(sdk).to match(
expect(sdk).to include(
"name" => "aws-sdk",
"service_name" => "example",
"service.name" => "example",
Expand Down Expand Up @@ -214,7 +214,7 @@ def version_of(service)
end

it "sends the expected aws-api span" do
expect(api).to match(
expect(api).to include(
"name" => "aws-api",
"service_name" => "example",
"service.name" => "example",
Expand Down Expand Up @@ -279,7 +279,7 @@ def version_of(service)
let(:api) { event_data.first }

it "sends the expected aws-sdk span" do
expect(sdk).to match(
expect(sdk).to include(
"name" => "aws-sdk",
"service_name" => "example",
"service.name" => "example",
Expand All @@ -305,7 +305,7 @@ def version_of(service)
end

it "sends the expected aws-api span" do
expect(api).to match(
expect(api).to include(
"name" => "aws-api",
"service_name" => "example",
"service.name" => "example",
Expand Down Expand Up @@ -366,7 +366,7 @@ def version_of(service)
let(:sdk) { event_data[2] }

it "sends the expected aws-sdk span" do
expect(sdk).to match(
expect(sdk).to include(
"name" => "aws-sdk",
"service_name" => "example",
"service.name" => "example",
Expand Down Expand Up @@ -395,7 +395,7 @@ def version_of(service)
end

it "sends an aws-api span for the original request" do
expect(api_failure).to match(
expect(api_failure).to include(
"name" => "aws-api",
"service_name" => "example",
"service.name" => "example",
Expand Down Expand Up @@ -432,7 +432,7 @@ def version_of(service)
end

it "sends an aws-api span for the retried request" do
expect(api_success).to match(
expect(api_success).to include(
"name" => "aws-api",
"service_name" => "example",
"service.name" => "example",
Expand Down Expand Up @@ -508,7 +508,7 @@ def version_of(service)
let(:apis) { event_data.take(4) }

it "sends the expected aws-sdk span" do
expect(sdk).to match(
expect(sdk).to include(
"name" => "aws-sdk",
"service_name" => "example",
"service.name" => "example",
Expand Down Expand Up @@ -569,10 +569,10 @@ def version_of(service)
end

it "sends the expected aws-api span for each request" do
expect(apis[0]).to match(api.merge("aws.attempt" => 1))
expect(apis[1]).to match(api.merge("aws.attempt" => 2))
expect(apis[2]).to match(api.merge("aws.attempt" => 3))
expect(apis[3]).to match(api.merge("aws.attempt" => 4))
expect(apis[0]).to include(api.merge("aws.attempt" => 1))
expect(apis[1]).to include(api.merge("aws.attempt" => 2))
expect(apis[2]).to include(api.merge("aws.attempt" => 3))
expect(apis[3]).to include(api.merge("aws.attempt" => 4))
end
end

Expand Down

0 comments on commit 394a49c

Please sign in to comment.