提交 1631ca57 编写于 作者: Y yudong.cai

MS-653 fix config unittest


Former-commit-id: 847b3783bfd12539382564dcf7ba1152ab1a5648
上级 1d0c35f0
......@@ -18,11 +18,13 @@
#include <gtest/gtest.h>
#include <gtest/gtest-death-test.h>
#include "config/ConfigMgr.h"
#include "config/YamlConfigMgr.h"
#include "utils/CommonUtil.h"
#include "utils/ValidationUtil.h"
#include "server/Config.h"
using namespace milvus;
namespace {
static const char *CONFIG_FILE_PATH = "./milvus/conf/server_config.yaml";
......@@ -35,16 +37,16 @@ static constexpr uint64_t GB = MB * 1024;
} // namespace
TEST(ConfigTest, CONFIG_TEST) {
milvus::server::ConfigMgr *config_mgr = milvus::server::ConfigMgr::GetInstance();
server::ConfigMgr *config_mgr = server::YamlConfigMgr::GetInstance();
milvus::ErrorCode err = config_mgr->LoadConfigFile("");
ASSERT_EQ(err, milvus::SERVER_UNEXPECTED_ERROR);
milvus::Status s = config_mgr->LoadConfigFile("");
ASSERT_FALSE(s.ok());
err = config_mgr->LoadConfigFile(LOG_FILE_PATH);
ASSERT_EQ(err, milvus::SERVER_UNEXPECTED_ERROR);
s = config_mgr->LoadConfigFile(LOG_FILE_PATH);
ASSERT_FALSE(s.ok());
err = config_mgr->LoadConfigFile(CONFIG_FILE_PATH);
ASSERT_EQ(err, milvus::SERVER_SUCCESS);
s = config_mgr->LoadConfigFile(CONFIG_FILE_PATH);
ASSERT_TRUE(s.ok());
config_mgr->Print();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册