未验证 提交 552c6acb 编写于 作者: N nico 提交者: GitHub

Update test cases (#25858)

Signed-off-by: Nnico <cheng.yuan@zilliz.com>
上级 fe1c0ffe
......@@ -12,7 +12,7 @@ allure-pytest==2.7.0
pytest-print==0.2.1
pytest-level==0.1.1
pytest-xdist==2.5.0
pymilvus==2.4.0.dev101
pymilvus==2.4.0.dev103
pytest-rerunfailures==9.1.1
git+https://github.com/Projectplace/pytest-tags
ndg-httpsclient
......
......@@ -1187,10 +1187,11 @@ class TestInsertInvalid(TestcaseBase):
schema = cf.gen_collection_schema([string_field, embedding_field], auto_id=True)
collection_w = self.init_collection_wrap(schema=schema)
data = [[[random.random() for _ in range(ct.default_dim)] for _ in range(2)]]
error = {ct.err_code: 1, ct.err_msg: "the length (18) of 0th string exceeds max length (6)"}
collection_w.insert(data=data, check_task=CheckTasks.err_res, check_items=error)
res = collection_w.insert(data=data)[0]
assert res.insert_count == 2
@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.skip("no error code provided now")
def test_insert_over_resource_limit(self):
"""
target: test insert over RPC limitation 64MB (67108864)
......
......@@ -1162,17 +1162,11 @@ class TestCollectionSearchInvalid(TestcaseBase):
dim=dim, is_index=False)[0:5]
# 2. create index
default_index = {"index_type": "BIN_FLAT", "params": {"nlist": 128}, "metric_type": metric}
collection_w.create_index("binary_vector", default_index)
collection_w.load()
# 3. generate search vectors
binary_vectors = cf.gen_binary_vectors(nq, dim)[1]
# 4. search and compare the distance
search_params = {"metric_type": metric, "params": {"nprobe": 10, "radius": 10, "range_filter": 1}}
collection_w.search(binary_vectors[:nq], "binary_vector",
search_params, default_limit,
check_task=CheckTasks.err_res,
check_items={"err_code": 1,
"err_msg": f"invalid metric type"})[0]
collection_w.create_index("binary_vector", default_index,
check_task=CheckTasks.err_res,
check_items={"err_code": 1,
"err_msg": "metric type not found or not supported, "
"supported: [HAMMING JACCARD]"})
@pytest.mark.tags(CaseLabel.L1)
def test_search_dynamic_compare_two_fields(self):
......@@ -1232,6 +1226,8 @@ class TestCollectionSearch(TestcaseBase):
@pytest.fixture(scope="function", params=["JACCARD", "HAMMING", "TANIMOTO"])
def metrics(self, request):
if request.param == "TANIMOTO":
pytest.skip("TANIMOTO not supported now")
yield request.param
@pytest.fixture(scope="function", params=[False, True])
......@@ -6007,6 +6003,8 @@ class TestCollectionRangeSearch(TestcaseBase):
@pytest.fixture(scope="function", params=["JACCARD", "HAMMING", "TANIMOTO"])
def metrics(self, request):
if request.param == "TANIMOTO":
pytest.skip("TANIMOTO not supported now")
yield request.param
@pytest.fixture(scope="function", params=[False, True])
......@@ -8364,8 +8362,9 @@ class TestCollectionLoadOperation(TestcaseBase):
partition_w2.release()
# search on collection
collection_w.search(vectors[:1], field_name, default_search_params, 200,
check_task=CheckTasks.check_search_results,
check_items={"nq": 1, "limit": 0})
check_task=CheckTasks.err_res,
check_items={ct.err_code: 1,
ct.err_msg: "fail to get shard leaders from QueryCoord: collection not loaded"})
@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.xfail(reason="issue #24446")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册