mirror of
https://github.com/XRPLF/clio.git
synced 2026-04-29 15:37:53 +00:00
test: Fix prometheus tests (#2312)
This commit is contained in:
@@ -688,7 +688,9 @@ TEST_F(WebServerPrometheusTest, rejectedWithoutAdminPassword)
|
||||
EXPECT_EQ(status, boost::beast::http::status::unauthorized);
|
||||
}
|
||||
|
||||
TEST_F(WebServerPrometheusTest, rejectedIfPrometheusIsDisabled)
|
||||
struct WebServerPrometheusDisabledTest : util::prometheus::WithPrometheusDisabled, WebServerTest {};
|
||||
|
||||
TEST_F(WebServerPrometheusDisabledTest, rejectedIfPrometheusIsDisabled)
|
||||
{
|
||||
uint32_t webServerPort = tests::util::generateFreePort();
|
||||
std::string const jsonServerConfigWithDisabledPrometheus = fmt::format(
|
||||
@@ -698,8 +700,7 @@ TEST_F(WebServerPrometheusTest, rejectedIfPrometheusIsDisabled)
|
||||
"port": {},
|
||||
"admin_password": "secret",
|
||||
"ws_max_sending_queue_size": 1500
|
||||
}},
|
||||
"prometheus": {{ "enabled": false }}
|
||||
}}
|
||||
}})JSON",
|
||||
webServerPort
|
||||
);
|
||||
@@ -708,7 +709,6 @@ TEST_F(WebServerPrometheusTest, rejectedIfPrometheusIsDisabled)
|
||||
ClioConfigDefinition const serverConfig{
|
||||
getParseAdminServerConfig(boost::json::parse(jsonServerConfigWithDisabledPrometheus))
|
||||
};
|
||||
PrometheusService::init(serverConfig);
|
||||
auto server = makeServerSync(serverConfig, ctx, dosGuard, e);
|
||||
auto const [status, res] = HttpSyncClient::get(
|
||||
"localhost",
|
||||
|
||||
Reference in New Issue
Block a user