Skip to content

Commit

Permalink
pull: improve code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
gjasny committed Dec 27, 2020
1 parent 07a30cb commit 3c5d3c5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pull/tests/integration/integration_test.cc
Expand Up @@ -196,6 +196,28 @@ TEST_F(IntegrationTest, shouldPerformProperAuthentication) {
EXPECT_THAT(metrics.body, HasSubstr(counter_name));
}

TEST_F(IntegrationTest, shouldDealWithExpiredCollectables) {
const std::string first_counter_name = "first_total";
const std::string second_counter_name = "second_total";

const auto registry =
RegisterSomeCounter(first_counter_name, default_metrics_path_);
auto disappearing_registry =
RegisterSomeCounter(second_counter_name, default_metrics_path_);

disappearing_registry.reset();

// all set-up

const auto metrics = FetchMetrics(default_metrics_path_);

// check results

ASSERT_EQ(metrics.code, 200);

EXPECT_THAT(metrics.body, HasSubstr(first_counter_name));
EXPECT_THAT(metrics.body, Not(HasSubstr(second_counter_name)));
}

} // namespace
} // namespace prometheus

0 comments on commit 3c5d3c5

Please sign in to comment.