mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-11 01:16:09 +08:00
Merge remote-tracking branch 'upstream/branch-0.5.0' into branch-0.5.0-yk
Former-commit-id: 61c6d4eac8f2190b2d43de8cdf1a8e38f08c8fe6
This commit is contained in:
commit
6ed3fb59f9
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user