提交 f4aea7db 编写于 作者: J jinhai 提交者: starlord

MS-471 code coverage run failed


Former-commit-id: a1623ef97423b1ed4086c70b5fb8965efac25580
......@@ -23,6 +23,7 @@ Please mark all change in change log and use the ticket from JIRA.
- MS-462 - Run milvus server twices, should display error
- MS-463 - Search timeout
- MS-467 - mysql db test failed
- MS-471 - code coverage run failed
## Improvement
- MS-327 - Clean code for milvus
......
......@@ -12,7 +12,7 @@ FILE_INFO_OUTPUT_NEW="output_new.info"
DIR_LCOV_OUTPUT="lcov_out"
DIR_GCNO="cmake_build"
DIR_UNITTEST="milvus/bin"
DIR_UNITTEST="milvus/unittest"
MYSQL_USER_NAME=root
MYSQL_PASSWORD=Fantast1c
......@@ -77,6 +77,7 @@ for test in `ls ${DIR_UNITTEST}`; do
# run unittest
./${DIR_UNITTEST}/${test} "${args}"
if [ $? -ne 0 ]; then
echo ${args}
echo ${DIR_UNITTEST}/${test} "run failed"
fi
done
......@@ -93,6 +94,7 @@ ${LCOV_CMD} -r "${FILE_INFO_OUTPUT}" -o "${FILE_INFO_OUTPUT_NEW}" \
"/usr/*" \
"*/boost/*" \
"*/cmake_build/*_ep-prefix/*" \
"src/core/cmake_build*" \
# gen html report
${LCOV_GEN_CMD} "${FILE_INFO_OUTPUT_NEW}" --output-directory ${DIR_LCOV_OUTPUT}/
\ No newline at end of file
......@@ -778,6 +778,7 @@ void DBImpl::BackgroundBuildIndex() {
}
Status DBImpl::DropAll() {
Stop();
return meta_ptr_->DropAll();
}
......
......@@ -2001,9 +2001,6 @@ Status MySQLMetaImpl::Count(const std::string &table_id, uint64_t &result) {
}
Status MySQLMetaImpl::DropAll() {
if (boost::filesystem::is_directory(options_.path)) {
boost::filesystem::remove_all(options_.path);
}
try {
ScopedConnection connectionPtr(*mysql_connection_pool_, safe_grab);
......
......@@ -1205,9 +1205,7 @@ Status SqliteMetaImpl::Count(const std::string &table_id, uint64_t &result) {
}
Status SqliteMetaImpl::DropAll() {
if (boost::filesystem::is_directory(options_.path)) {
boost::filesystem::remove_all(options_.path);
}
return Status::OK();
}
......
......@@ -40,7 +40,7 @@ set(unittest_libs
add_subdirectory(server)
add_subdirectory(db)
add_subdirectory(knowhere)
#add_subdirectory(knowhere)
add_subdirectory(metrics)
#add_subdirectory(scheduler)
#add_subdirectory(storage)
\ No newline at end of file
......@@ -90,5 +90,5 @@ endif()
target_link_libraries(db_test ${db_libs} ${knowhere_libs} ${unittest_libs})
install(TARGETS db_test DESTINATION bin)
install(TARGETS db_test DESTINATION unittest)
......@@ -112,7 +112,7 @@ TEST_F(MySQLDBTest, DB_TEST) {
std::this_thread::sleep_for(std::chrono::seconds(3));
}
std::cout << "Search AAA done" << std::endl;
std::cout << "All search done!" << std::endl;
});
int loop = INSERT_LOOP;
......@@ -257,13 +257,13 @@ TEST_F(MySQLDBTest, DELETE_TEST) {
std::this_thread::sleep_for(std::chrono::microseconds(1));
}
std::vector<engine::meta::DateT> dates;
stat = db_->DeleteTable(TABLE_NAME, dates);
// std::cout << "5 sec start" << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(5));
// std::cout << "5 sec finish" << std::endl;
ASSERT_TRUE(stat.ok());
db_->HasTable(TABLE_NAME, has_table);
ASSERT_FALSE(has_table);
// std::vector<engine::meta::DateT> dates;
// stat = db_->DeleteTable(TABLE_NAME, dates);
//// std::cout << "5 sec start" << std::endl;
// std::this_thread::sleep_for(std::chrono::seconds(5));
//// std::cout << "5 sec finish" << std::endl;
// ASSERT_TRUE(stat.ok());
//
// db_->HasTable(TABLE_NAME, has_table);
// ASSERT_FALSE(has_table);
};
......@@ -82,6 +82,7 @@ void DBTest::SetUp() {
}
void DBTest::TearDown() {
db_->DropAll();
delete db_;
engine::ResMgrInst::GetInstance()->Stop();
......@@ -124,12 +125,11 @@ zilliz::milvus::engine::DBMetaOptions MySQLTest::getDBMetaOptions() {
zilliz::milvus::engine::Options MySQLDBTest::GetOptions() {
auto options = engine::OptionsFactory::Build();
options.meta.path = "/tmp/milvus_test";
// options.meta.backend_uri = DBTestEnvironment::getURI();
//
// if(options.meta.backend_uri.empty()) {
// options.meta.backend_uri = "mysql://root:Fantast1c@192.168.1.194:3306/";
// }
options.meta.backend_uri = "mysql://root:Fantast1c@192.168.1.194:3306/";
options.meta.backend_uri = DBTestEnvironment::getURI();
if(options.meta.backend_uri.empty()) {
options.meta.backend_uri = "mysql://root:Fantast1c@192.168.1.194:3306/";
}
return options;
}
......
......@@ -22,4 +22,4 @@ set(knowhere_libs
add_executable(knowhere_test knowhere_test.cpp ${knowhere_src} ${helper})
target_link_libraries(knowhere_test ${knowhere_libs} ${unittest_libs})
install(TARGETS knowhere_test DESTINATION bin)
\ No newline at end of file
install(TARGETS knowhere_test DESTINATION unittest)
\ No newline at end of file
......@@ -104,4 +104,4 @@ else()
openblas)
endif()
install(TARGETS metrics_test DESTINATION bin)
\ No newline at end of file
install(TARGETS metrics_test DESTINATION unittest)
\ No newline at end of file
......@@ -91,5 +91,5 @@ endif ()
target_link_libraries(scheduler_test ${scheduler_libs} ${knowhere_libs} ${unittest_libs})
install(TARGETS scheduler_test DESTINATION bin)
install(TARGETS scheduler_test DESTINATION unittest)
......@@ -65,7 +65,7 @@ target_link_libraries(server_test
${unittest_libs}
)
install(TARGETS server_test DESTINATION bin)
install(TARGETS server_test DESTINATION unittest)
configure_file(appendix/server_config.yaml
"${CMAKE_CURRENT_BINARY_DIR}/milvus/conf/server_config.yaml"
......
......@@ -6,6 +6,7 @@
#include <gtest/gtest.h>
#include "cache/CpuCacheMgr.h"
#include "cache/GpuCacheMgr.h"
#include "server/ServerConfig.h"
#include "utils/Error.h"
#include "wrapper/knowhere/vec_index.h"
......@@ -146,6 +147,9 @@ TEST(CacheTest, CPU_CACHE_TEST) {
}
TEST(CacheTest, GPU_CACHE_TEST) {
server::ConfigNode& config = server::ServerConfig::GetInstance().GetConfig(server::CONFIG_CACHE);
config.AddSequenceItem(server::CONFIG_GPU_IDS, "0");
cache::CacheMgr* gpu_mgr = cache::GpuCacheMgr::GetInstance(0);
const int dim = 256;
......
......@@ -38,4 +38,4 @@ target_link_libraries(s3_test
curl
crypto)
install(TARGETS s3_test DESTINATION bin)
\ No newline at end of file
install(TARGETS s3_test DESTINATION unittest)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册