|
@@ -166,6 +166,17 @@ TEST_F(ApiFixture, ProjectStatsAndGlobalStats) {
|
|
|
EXPECT_TRUE(gJson.contains("memory_pressure_level"));
|
|
EXPECT_TRUE(gJson.contains("memory_pressure_level"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+TEST_F(ApiFixture, StatsReportsLoadedClientLibraryVersion) {
|
|
|
|
|
+ auto r = admin().Get("/api/v1/stats");
|
|
|
|
|
+ ASSERT_TRUE(r); ASSERT_EQ(r->status, 200);
|
|
|
|
|
+ auto body = nlohmann::json::parse(r->body);
|
|
|
|
|
+ ASSERT_TRUE(body.contains("db_client_version"));
|
|
|
|
|
+ ASSERT_TRUE(body.contains("db_client_commit"));
|
|
|
|
|
+ // Reports the LOADED library, so it must be non-empty and 2.x.
|
|
|
|
|
+ EXPECT_FALSE(body["db_client_version"].get<std::string>().empty());
|
|
|
|
|
+ EXPECT_EQ(body["db_client_version"].get<std::string>().rfind("2.", 0), 0u);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
TEST_F(ApiFixture, OpenApiDescribesProjectRoutes) {
|
|
TEST_F(ApiFixture, OpenApiDescribesProjectRoutes) {
|
|
|
auto r = noAuth().Get("/openapi.json");
|
|
auto r = noAuth().Get("/openapi.json");
|
|
|
ASSERT_EQ(r->status, 200);
|
|
ASSERT_EQ(r->status, 200);
|