Loading ci/jenkins/jenkinsfile/coverage.groovy +1 −1 Original line number Diff line number Diff line timeout(time: 60, unit: 'MINUTES') { timeout(time: 30, unit: 'MINUTES') { dir ("ci/jenkins/scripts") { sh "./coverage.sh -o /opt/milvus -u root -p 123456 -t \$POD_IP" // Set some env variables so codecov detection script works correctly Loading ci/jenkins/scripts/coverage.sh +6 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ for test in `ls ${DIR_UNITTEST}`; do if [ $? -ne 0 ]; then echo ${args} echo ${DIR_UNITTEST}/${test} "run failed" exit -1 fi done Loading @@ -134,5 +135,10 @@ ${LCOV_CMD} -r "${FILE_INFO_OUTPUT}" -o "${FILE_INFO_OUTPUT_NEW}" \ "*/src/external/easyloggingpp/easylogging++.h" \ "*/src/external/easyloggingpp/easylogging++.cc" if [ $? -ne 0 ]; then echo "gen ${FILE_INFO_OUTPUT_NEW} failed" exit -2 fi # gen html report # ${LCOV_GEN_CMD} "${FILE_INFO_OUTPUT_NEW}" --output-directory ${DIR_LCOV_OUTPUT}/ core/coverage.sh +5 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ for test in `ls ${DIR_UNITTEST}`; do if [ $? -ne 0 ]; then echo ${args} echo ${DIR_UNITTEST}/${test} "run failed" exit -1 fi done Loading @@ -125,5 +126,9 @@ ${LCOV_CMD} -r "${FILE_INFO_OUTPUT}" -o "${FILE_INFO_OUTPUT_NEW}" \ "*/src/external/easyloggingpp/easylogging++.cc" \ "*/src/external/*" if [ $? -ne 0 ]; then echo "generate ${FILE_INFO_OUTPUT_NEW} failed" exit -2 fi # gen html report ${LCOV_GEN_CMD} "${FILE_INFO_OUTPUT_NEW}" --output-directory ${DIR_LCOV_OUTPUT}/ tests/milvus_python_test/test_add_vectors.py +7 −5 Original line number Diff line number Diff line Loading @@ -407,6 +407,7 @@ class TestAddBase: def get_vector_id(self, request): yield request.param @pytest.mark.level(2) def test_add_vectors_ids_invalid(self, connect, table, get_vector_id): ''' target: test add vectors in table, use customize ids, which are not int64 Loading Loading @@ -573,7 +574,7 @@ class TestAddBase: nq = 100 vectors = gen_vectors(nq, dim) table_list = [] for i in range(50): for i in range(20): table_name = gen_unique_str('test_add_vector_multi_tables') table_list.append(table_name) param = {'table_name': table_name, Loading @@ -581,9 +582,9 @@ class TestAddBase: 'index_file_size': index_file_size, 'metric_type': MetricType.L2} connect.create_table(param) time.sleep(2) for j in range(10): for i in range(50): time.sleep(5) for j in range(5): for i in range(20): status, ids = connect.add_vectors(table_name=table_list[i], records=vectors) assert status.OK() Loading Loading @@ -974,6 +975,7 @@ class TestAddIP: def get_vector_id(self, request): yield request.param @pytest.mark.level(2) def test_add_vectors_ids_invalid(self, connect, ip_table, get_vector_id): ''' target: test add vectors in table, use customize ids, which are not int64 Loading Loading @@ -1223,7 +1225,7 @@ class TestAddTableVectorsInvalid(object): with pytest.raises(Exception) as e: status, result = connect.add_vectors(table, tmp_single_vector) @pytest.mark.level(1) @pytest.mark.level(2) def test_add_vectors_with_invalid_vectors(self, connect, table, gen_vector): tmp_vectors = copy.deepcopy(self.vectors) tmp_vectors[1][1] = gen_vector Loading tests/milvus_python_test/test_index.py +14 −7 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ import numpy from milvus import Milvus, IndexType, MetricType from utils import * nb = 100000 nb = 10000 dim = 128 index_file_size = 10 vectors = gen_vectors(nb, dim) Loading @@ -37,7 +37,10 @@ class TestIndexBase: params=gen_simple_index_params() ) def get_simple_index_params(self, request): yield request.param if "internal" not in args: if request.param["index_type"] == IndexType.IVF_SQ8H: pytest.skip("sq8h not support in open source") return request.param """ ****************************************************************** Loading Loading @@ -515,14 +518,17 @@ class TestIndexIP: params=gen_simple_index_params() ) def get_simple_index_params(self, request): yield request.param if "internal" not in args: if request.param["index_type"] == IndexType.IVF_SQ8H: pytest.skip("sq8h not support in open source") return request.param """ ****************************************************************** The following cases are used to test `create_index` function ****************************************************************** """ @pytest.mark.level(2) @pytest.mark.timeout(BUILD_TIMEOUT) def test_create_index(self, connect, ip_table, get_index_params): ''' Loading Loading @@ -557,6 +563,7 @@ class TestIndexIP: logging.getLogger().info(index_params) status, ids = connect.add_vectors(ip_table, vectors) status = connect.create_index(ip_table, index_params) assert status.OK() logging.getLogger().info(connect.describe_index(ip_table)) query_vecs = [vectors[0], vectors[1], vectors[2]] top_k = 5 Loading Loading @@ -927,19 +934,19 @@ class TestIndexTableInvalid(object): def get_table_name(self, request): yield request.param # @pytest.mark.level(1) @pytest.mark.level(2) def test_create_index_with_invalid_tablename(self, connect, get_table_name): table_name = get_table_name status = connect.create_index(table_name, random.choice(gen_index_params())) assert not status.OK() # @pytest.mark.level(1) @pytest.mark.level(2) def test_describe_index_with_invalid_tablename(self, connect, get_table_name): table_name = get_table_name status, result = connect.describe_index(table_name) assert not status.OK() # @pytest.mark.level(1) @pytest.mark.level(2) def test_drop_index_with_invalid_tablename(self, connect, get_table_name): table_name = get_table_name status = connect.drop_index(table_name) Loading Loading
ci/jenkins/jenkinsfile/coverage.groovy +1 −1 Original line number Diff line number Diff line timeout(time: 60, unit: 'MINUTES') { timeout(time: 30, unit: 'MINUTES') { dir ("ci/jenkins/scripts") { sh "./coverage.sh -o /opt/milvus -u root -p 123456 -t \$POD_IP" // Set some env variables so codecov detection script works correctly Loading
ci/jenkins/scripts/coverage.sh +6 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ for test in `ls ${DIR_UNITTEST}`; do if [ $? -ne 0 ]; then echo ${args} echo ${DIR_UNITTEST}/${test} "run failed" exit -1 fi done Loading @@ -134,5 +135,10 @@ ${LCOV_CMD} -r "${FILE_INFO_OUTPUT}" -o "${FILE_INFO_OUTPUT_NEW}" \ "*/src/external/easyloggingpp/easylogging++.h" \ "*/src/external/easyloggingpp/easylogging++.cc" if [ $? -ne 0 ]; then echo "gen ${FILE_INFO_OUTPUT_NEW} failed" exit -2 fi # gen html report # ${LCOV_GEN_CMD} "${FILE_INFO_OUTPUT_NEW}" --output-directory ${DIR_LCOV_OUTPUT}/
core/coverage.sh +5 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ for test in `ls ${DIR_UNITTEST}`; do if [ $? -ne 0 ]; then echo ${args} echo ${DIR_UNITTEST}/${test} "run failed" exit -1 fi done Loading @@ -125,5 +126,9 @@ ${LCOV_CMD} -r "${FILE_INFO_OUTPUT}" -o "${FILE_INFO_OUTPUT_NEW}" \ "*/src/external/easyloggingpp/easylogging++.cc" \ "*/src/external/*" if [ $? -ne 0 ]; then echo "generate ${FILE_INFO_OUTPUT_NEW} failed" exit -2 fi # gen html report ${LCOV_GEN_CMD} "${FILE_INFO_OUTPUT_NEW}" --output-directory ${DIR_LCOV_OUTPUT}/
tests/milvus_python_test/test_add_vectors.py +7 −5 Original line number Diff line number Diff line Loading @@ -407,6 +407,7 @@ class TestAddBase: def get_vector_id(self, request): yield request.param @pytest.mark.level(2) def test_add_vectors_ids_invalid(self, connect, table, get_vector_id): ''' target: test add vectors in table, use customize ids, which are not int64 Loading Loading @@ -573,7 +574,7 @@ class TestAddBase: nq = 100 vectors = gen_vectors(nq, dim) table_list = [] for i in range(50): for i in range(20): table_name = gen_unique_str('test_add_vector_multi_tables') table_list.append(table_name) param = {'table_name': table_name, Loading @@ -581,9 +582,9 @@ class TestAddBase: 'index_file_size': index_file_size, 'metric_type': MetricType.L2} connect.create_table(param) time.sleep(2) for j in range(10): for i in range(50): time.sleep(5) for j in range(5): for i in range(20): status, ids = connect.add_vectors(table_name=table_list[i], records=vectors) assert status.OK() Loading Loading @@ -974,6 +975,7 @@ class TestAddIP: def get_vector_id(self, request): yield request.param @pytest.mark.level(2) def test_add_vectors_ids_invalid(self, connect, ip_table, get_vector_id): ''' target: test add vectors in table, use customize ids, which are not int64 Loading Loading @@ -1223,7 +1225,7 @@ class TestAddTableVectorsInvalid(object): with pytest.raises(Exception) as e: status, result = connect.add_vectors(table, tmp_single_vector) @pytest.mark.level(1) @pytest.mark.level(2) def test_add_vectors_with_invalid_vectors(self, connect, table, gen_vector): tmp_vectors = copy.deepcopy(self.vectors) tmp_vectors[1][1] = gen_vector Loading
tests/milvus_python_test/test_index.py +14 −7 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ import numpy from milvus import Milvus, IndexType, MetricType from utils import * nb = 100000 nb = 10000 dim = 128 index_file_size = 10 vectors = gen_vectors(nb, dim) Loading @@ -37,7 +37,10 @@ class TestIndexBase: params=gen_simple_index_params() ) def get_simple_index_params(self, request): yield request.param if "internal" not in args: if request.param["index_type"] == IndexType.IVF_SQ8H: pytest.skip("sq8h not support in open source") return request.param """ ****************************************************************** Loading Loading @@ -515,14 +518,17 @@ class TestIndexIP: params=gen_simple_index_params() ) def get_simple_index_params(self, request): yield request.param if "internal" not in args: if request.param["index_type"] == IndexType.IVF_SQ8H: pytest.skip("sq8h not support in open source") return request.param """ ****************************************************************** The following cases are used to test `create_index` function ****************************************************************** """ @pytest.mark.level(2) @pytest.mark.timeout(BUILD_TIMEOUT) def test_create_index(self, connect, ip_table, get_index_params): ''' Loading Loading @@ -557,6 +563,7 @@ class TestIndexIP: logging.getLogger().info(index_params) status, ids = connect.add_vectors(ip_table, vectors) status = connect.create_index(ip_table, index_params) assert status.OK() logging.getLogger().info(connect.describe_index(ip_table)) query_vecs = [vectors[0], vectors[1], vectors[2]] top_k = 5 Loading Loading @@ -927,19 +934,19 @@ class TestIndexTableInvalid(object): def get_table_name(self, request): yield request.param # @pytest.mark.level(1) @pytest.mark.level(2) def test_create_index_with_invalid_tablename(self, connect, get_table_name): table_name = get_table_name status = connect.create_index(table_name, random.choice(gen_index_params())) assert not status.OK() # @pytest.mark.level(1) @pytest.mark.level(2) def test_describe_index_with_invalid_tablename(self, connect, get_table_name): table_name = get_table_name status, result = connect.describe_index(table_name) assert not status.OK() # @pytest.mark.level(1) @pytest.mark.level(2) def test_drop_index_with_invalid_tablename(self, connect, get_table_name): table_name = get_table_name status = connect.drop_index(table_name) Loading