gavinchou commented on code in PR #45394: URL: https://github.com/apache/doris/pull/45394#discussion_r1895174697
########## cloud/test/meta_service_http_test.cpp: ########## @@ -1625,4 +1629,69 @@ TEST(MetaServiceHttpTest, QueryRateLimit) { } } +TEST(MetaServiceHttpTest, UpdateConfig) { + HttpContext ctx; + { + auto [status_code, content] = ctx.query<std::string>("update_config", ""); + ASSERT_EQ(status_code, 400); + std::string msg = "query param `config` should not be empty"; + ASSERT_NE(content.find(msg), std::string::npos); + } + { + auto [status_code, content] = ctx.query<std::string>("update_config", "configs=aaa"); + ASSERT_EQ(status_code, 400); + std::string msg = "config aaa is invalid"; + ASSERT_NE(content.find(msg), std::string::npos); + } + { + auto [status_code, content] = ctx.query<std::string>("update_config", "configs=aaa=bbb"); + ASSERT_EQ(status_code, 400); + std::string msg = "set aaa=bbb failed"; + ASSERT_NE(content.find(msg), std::string::npos); + } + { + auto [status_code, content] = + ctx.query<std::string>("update_config", "configs=recycle_interval_seconds=3599"); + ASSERT_EQ(status_code, 200); + ASSERT_EQ(config::recycle_interval_seconds, 3599); Review Comment: also check some config with other types string and bool e.g. s3_client_http_scheme, "http" enable_cluster_name_check, "false" ########## cloud/test/meta_service_http_test.cpp: ########## @@ -1625,4 +1629,69 @@ TEST(MetaServiceHttpTest, QueryRateLimit) { } } +TEST(MetaServiceHttpTest, UpdateConfig) { + HttpContext ctx; + { + auto [status_code, content] = ctx.query<std::string>("update_config", ""); + ASSERT_EQ(status_code, 400); + std::string msg = "query param `config` should not be empty"; + ASSERT_NE(content.find(msg), std::string::npos); + } + { + auto [status_code, content] = ctx.query<std::string>("update_config", "configs=aaa"); + ASSERT_EQ(status_code, 400); + std::string msg = "config aaa is invalid"; + ASSERT_NE(content.find(msg), std::string::npos); + } + { + auto [status_code, content] = ctx.query<std::string>("update_config", "configs=aaa=bbb"); + ASSERT_EQ(status_code, 400); + std::string msg = "set aaa=bbb failed"; + ASSERT_NE(content.find(msg), std::string::npos); + } + { + auto [status_code, content] = + ctx.query<std::string>("update_config", "configs=recycle_interval_seconds=3599"); + ASSERT_EQ(status_code, 200); + ASSERT_EQ(config::recycle_interval_seconds, 3599); Review Comment: also check some configs with other types string and bool e.g. s3_client_http_scheme, "http" enable_cluster_name_check, "false" -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org