Skip to content

Commit

Permalink
test(exporters): update ostream_metric_test to check for resource attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
bsarden committed Jul 28, 2022
1 parent a8e4617 commit 6fbe315
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions exporters/ostream/test/ostream_metric_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ TEST(OStreamMetricsExporter, ExportSumPointData)
"\n value\t\t: 20"
"\n attributes\t\t: "
"\n\ta1: b1"
"\n resources\t:"
"\n\tservice.name: unknown_service"
"\n\ttelemetry.sdk.version: 1.4.1"
"\n\ttelemetry.sdk.name: opentelemetry"
"\n\ttelemetry.sdk.language: cpp"
"\n}\n";
ASSERT_EQ(stdoutOutput.str(), expected_output);
}
Expand Down Expand Up @@ -153,6 +158,11 @@ TEST(OStreamMetricsExporter, ExportHistogramPointData)
"\n counts : [200, 300, 400, 500, ]"
"\n attributes\t\t: "
"\n\ta1: b1"
"\n resources\t:"
"\n\tservice.name: unknown_service"
"\n\ttelemetry.sdk.version: 1.4.1"
"\n\ttelemetry.sdk.name: opentelemetry"
"\n\ttelemetry.sdk.language: cpp"
"\n}\n";
ASSERT_EQ(stdoutOutput.str(), expected_output);
}
Expand Down Expand Up @@ -217,6 +227,11 @@ TEST(OStreamMetricsExporter, ExportLastValuePointData)
"\n valid : true"
"\n value : 20"
"\n attributes\t\t: "
"\n resources\t:"
"\n\tservice.name: unknown_service"
"\n\ttelemetry.sdk.version: 1.4.1"
"\n\ttelemetry.sdk.name: opentelemetry"
"\n\ttelemetry.sdk.language: cpp"
"\n}\n";
ASSERT_EQ(stdoutOutput.str(), expected_output);
}
Expand Down Expand Up @@ -265,6 +280,11 @@ TEST(OStreamMetricsExporter, ExportDropPointData)
"\n name\t\t: library_name"
"\n description\t: description"
"\n unit\t\t: unit"
"\n resources\t:"
"\n\tservice.name: unknown_service"
"\n\ttelemetry.sdk.version: 1.4.1"
"\n\ttelemetry.sdk.name: opentelemetry"
"\n\ttelemetry.sdk.language: cpp"
"\n}\n";

ASSERT_EQ(stdoutOutput.str(), expected_output);
Expand Down

0 comments on commit 6fbe315

Please sign in to comment.