提交 49427d76 编写于 作者: J jinhai

Merge branch 'branch-0.5.0' into 'branch-0.5.0'

MS-653 fix config unittest

See merge request megasearch/milvus!737

Former-commit-id: 6ae2e9a1acea7813ccc5f78f136946c3800d365a
......@@ -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.
先完成此消息的编辑!
想要评论请 注册