Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrobbel committed Sep 27, 2023
1 parent 0fdc79a commit c1a474e
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions exporters/otlp/test/otlp_recordable_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -357,20 +357,18 @@ TEST(OtlpRecordable, PopulateRequestMissing)
{
// Both should have scope spans
EXPECT_EQ(resource_spans.scope_spans().size(), 1);
auto scope = resource_spans.scope_spans(0).scope();
// Select the one with missing scope
if (resource_spans.resource().attributes().size() > 0 &&
resource_spans.resource().attributes(0).value().string_value() == "one")
if (scope.name() == "")
{
// Scope data is missing
EXPECT_EQ(resource_spans.scope_spans(0).scope().name(), "");
EXPECT_EQ(resource_spans.scope_spans(0).scope().version(), "");
// Version is also empty
EXPECT_EQ(scope.version(), "");
}
else
{
// The other has no resource attributes
EXPECT_EQ(resource_spans.resource().attributes().size(), 0);
EXPECT_EQ(resource_spans.scope_spans(0).scope().name(), "two");
EXPECT_EQ(resource_spans.scope_spans(0).scope().version(), "2");
// The other has a name and version
EXPECT_EQ(scope.name(), "two");
EXPECT_EQ(scope.version(), "2");
}
}
}
Expand Down

0 comments on commit c1a474e

Please sign in to comment.