From 3f7352f3cf95a6f5f6f7f8a32896db1fddac6284 Mon Sep 17 00:00:00 2001 From: zhuwenxing Date: Sat, 16 Nov 2024 11:14:30 +0800 Subject: [PATCH] test: remove xfail of fts test cases after fix (#37724) Signed-off-by: zhuwenxing --- .../python_client/testcases/test_full_text_search.py | 9 ++++++--- tests/python_client/testcases/test_query.py | 11 +++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/python_client/testcases/test_full_text_search.py b/tests/python_client/testcases/test_full_text_search.py index d42295de68f82..acb66952c9669 100644 --- a/tests/python_client/testcases/test_full_text_search.py +++ b/tests/python_client/testcases/test_full_text_search.py @@ -1090,7 +1090,6 @@ class TestUpsertWithFullTextSearch(TestcaseBase): @pytest.mark.tags(CaseLabel.L0) @pytest.mark.parametrize("nullable", [False, True]) @pytest.mark.parametrize("tokenizer", ["standard"]) - @pytest.mark.xfail(reason="issue: https://github.com/milvus-io/milvus/issues/37021") def test_upsert_for_full_text_search(self, tokenizer, nullable): """ target: test upsert data for full text search @@ -1261,7 +1260,6 @@ class TestUpsertWithFullTextSearchNegative(TestcaseBase): @pytest.mark.tags(CaseLabel.L1) @pytest.mark.parametrize("nullable", [False]) @pytest.mark.parametrize("tokenizer", ["standard"]) - @pytest.mark.xfail(reason="issue: https://github.com/milvus-io/milvus/issues/37021") def test_upsert_for_full_text_search_with_no_varchar_data(self, tokenizer, nullable): """ target: test upsert data for full text search with no varchar data @@ -2327,8 +2325,13 @@ def test_full_text_search_with_jieba_tokenizer( 3. verify the result expected: full text search successfully and result is correct """ + if tokenizer == "jieba": + lang_type = "chinese" + else: + lang_type = "english" + analyzer_params = { - "tokenizer": tokenizer, + "type": lang_type, } dim = 128 fields = [ diff --git a/tests/python_client/testcases/test_query.py b/tests/python_client/testcases/test_query.py index 3a05e8a124d05..ade0607d94072 100644 --- a/tests/python_client/testcases/test_query.py +++ b/tests/python_client/testcases/test_query.py @@ -4631,10 +4631,9 @@ def test_query_text_match_en_normal( @pytest.mark.tags(CaseLabel.L0) @pytest.mark.parametrize("enable_partition_key", [True, False]) @pytest.mark.parametrize("enable_inverted_index", [True, False]) - @pytest.mark.parametrize("tokenizer", ["jieba"]) - @pytest.mark.xfail(reason="unstable") + @pytest.mark.parametrize("lang_type", ["chinese"]) def test_query_text_match_zh_normal( - self, tokenizer, enable_inverted_index, enable_partition_key + self, lang_type, enable_inverted_index, enable_partition_key ): """ target: test text match normal @@ -4644,7 +4643,7 @@ def test_query_text_match_zh_normal( expected: text match successfully and result is correct """ analyzer_params = { - "tokenizer": tokenizer, + "type": lang_type, } dim = 128 fields = [ @@ -4690,7 +4689,7 @@ def test_query_text_match_zh_normal( name=cf.gen_unique_str(prefix), schema=schema ) fake = fake_en - if tokenizer == "jieba": + if lang_type == "chinese": language = "zh" fake = fake_zh else: @@ -4763,7 +4762,7 @@ def test_query_text_match_zh_normal( res, _ = collection_w.query(expr=expr, output_fields=["id", field]) log.info(f"res len {len(res)}") for r in res: - assert any([token in r[field] for token in top_10_tokens]) + assert any([token in r[field] for token in top_10_tokens]), f"top 10 tokens {top_10_tokens} not in {r[field]}"