Skip to content

Commit

Permalink
test: add test cases for text match feature
Browse files Browse the repository at this point in the history
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
  • Loading branch information
zhuwenxing committed Sep 20, 2024
1 parent 2906920 commit 51329c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ pyopenssl
pyasn1
pytest-html==3.1.1
delayed-assert==0.3.5
kubernetes==17.17.0
kubernetes==24.2.0
PyYAML==6.0
pytest-sugar==0.9.5
pytest-parallel
pytest-random-order
numpy==1.25.0
numpy==1.24.4
# for customize config test
python-benedict==0.24.3
timeout-decorator==0.5.0
Expand All @@ -52,3 +52,7 @@ tenacity==8.1.0
# for bf16 datatype
jax==0.4.13
jaxlib==0.4.13

# for text match
bm25s==0.2.0
jieba==0.42.1
5 changes: 5 additions & 0 deletions tests/testcases/test_restore_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from common.common_type import CaseLabel
from utils.util_log import test_log as log
from api.milvus_backup import MilvusBackupClient
from faker import Faker
fake_en = Faker("en_US")
prefix = "restore_backup"
backup_prefix = "backup"
suffix = "_bak"
Expand Down Expand Up @@ -652,13 +654,15 @@ def test_milvus_restore_back_with_f16_bf16_datatype(self, include_dynamic, inclu

@pytest.mark.parametrize("include_partition_key", [True])
@pytest.mark.parametrize("include_dynamic", [True])
@pytest.mark.parametrize("enable_text_match", [True])
@pytest.mark.tags(CaseLabel.MASTER)
def test_milvus_restore_back_with_sparse_vector_datatype(self, include_dynamic, include_partition_key):
self._connect()
name_origin = cf.gen_unique_str(prefix)
back_up_name = cf.gen_unique_str(backup_prefix)
fields = [cf.gen_int64_field(name="int64", is_primary=True),
cf.gen_int64_field(name="key"),
cf.gen_string_field(name="text", enable_match=True),
cf.gen_json_field(name="json"),
cf.gen_array_field(name="var_array", element_type=DataType.VARCHAR),
cf.gen_array_field(name="int_array", element_type=DataType.INT64),
Expand All @@ -681,6 +685,7 @@ def test_milvus_restore_back_with_sparse_vector_datatype(self, include_dynamic,
[i for i in range(nb)],
[i % 3 for i in range(nb)],
[{f"key_{str(i)}": i} for i in range(nb)],
[fake_en.text() for i in range(nb)],
[[str(x) for x in range(10)] for i in range(nb)],
[[int(x) for x in range(10)] for i in range(nb)],
[[np.float32(i) for i in range(128)] for _ in range(nb)],
Expand Down

0 comments on commit 51329c4

Please sign in to comment.