Skip to content

Commit

Permalink
test: simplify and reduce test cases
Browse files Browse the repository at this point in the history
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
  • Loading branch information
zhuwenxing committed Dec 17, 2024
1 parent e22a744 commit 025e4d0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 41 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,11 @@ jobs:
fail-fast: false
matrix:
deploy_tools: [docker-compose]
milvus_mode: [standalone]
image_tag: [master-latest, 2.3-latest, 2.4-latest]
milvus_mode: [cluster]
image_tag: [master-latest, 2.4-latest]
case_tag: [L0, L1, L2, MASTER]
exclude:
- image_tag: 2.3-latest
- image_tag: 2.4-latest
case_tag: MASTER

steps:
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/perf.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
name: Perf Test

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
schedule:
- cron: '0 4 * * *'
Expand All @@ -22,7 +16,7 @@ jobs:
matrix:
deploy_tools: [docker-compose]
milvus_mode: [standalone]
milvus_version: [master-latest, 2.3.0-latest, 2.2.0-latest]
milvus_version: [master-latest, 2.4-latest]

steps:
- uses: actions/checkout@v3
Expand Down
7 changes: 5 additions & 2 deletions deployment/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ image:
pullPolicy: IfNotPresent

etcd:
replicaCount: 3
replicaCount: 1
image:
repository: milvusdb/etcd
tag: 3.5.0-r7

dataNode:
replicas: 4

minio:
resources:
requests:
Expand Down Expand Up @@ -124,4 +127,4 @@ pulsar:
defaultRetentionTimeInMinutes: "10080"
defaultRetentionSizeInMB: "8192"
backlogQuotaDefaultLimitGB: "8"
backlogQuotaDefaultRetentionPolicy: producer_exception
backlogQuotaDefaultRetentionPolicy: producer_exception
4 changes: 2 additions & 2 deletions tests/base/client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ def prepare_data(self, name=None, db_name="default", nb=ct.default_nb, dim=ct.de
collection_w = self.init_collection_wrap(name=name, schema=default_schema, active_trace=True)
# create partitions
if enable_partition:
for i in range(5):
partition_w = self.init_partition_wrap(collection_wrap=collection_w)
for i in range(3):
self.init_partition_wrap(collection_wrap=collection_w)
assert collection_w.name == name
if nb > 0:
cf.insert_data(collection_w, nb=nb, is_binary=is_binary, auto_id=auto_id, dim=dim)
Expand Down
49 changes: 22 additions & 27 deletions tests/testcases/test_restore_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class TestRestoreBackup(TestcaseBase):
""" Test case of end to end"""

@pytest.mark.parametrize("nb", [3000])
@pytest.mark.parametrize("is_auto_id", [True, False])
@pytest.mark.parametrize("is_auto_id", [True])
@pytest.mark.parametrize("enable_partition", [False])
@pytest.mark.parametrize("is_async", [True, False])
@pytest.mark.parametrize("collection_need_to_restore", [1, 2, 3])
@pytest.mark.parametrize("collection_type", ["binary", "float", "all"])
@pytest.mark.parametrize("collection_need_to_restore", [3])
@pytest.mark.parametrize("collection_type", ["all"])
@pytest.mark.tags(CaseLabel.L0)
def test_milvus_restore_back(self, collection_type, collection_need_to_restore, is_async, is_auto_id, enable_partition, nb):
# prepare data
Expand Down Expand Up @@ -83,14 +83,13 @@ def test_milvus_restore_back(self, collection_type, collection_need_to_restore,
for name in restore_collections:
self.compare_collections(name, name+suffix, verify_by_query=True)

@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("nb", [3000])
@pytest.mark.parametrize("is_auto_id", [True])
@pytest.mark.parametrize("enable_partition", [True])
@pytest.mark.parametrize("is_async", [True])
@pytest.mark.parametrize("collection_need_to_restore", [3])
@pytest.mark.parametrize("collection_need_to_restore", [1])
@pytest.mark.parametrize("collection_type", ["all"])
@pytest.mark.tags(CaseLabel.L0)
def test_milvus_restore_back_with_multi_partition(self, collection_type, collection_need_to_restore, is_async, is_auto_id, enable_partition, nb):
# prepare data
names_origin = []
Expand Down Expand Up @@ -190,11 +189,11 @@ def test_milvus_restore_back_with_db_support(self):
assert collection_name + suffix in res
self.compare_collections(collection_name, collection_name + suffix)

@pytest.mark.parametrize("include_partition_key", [True, False])
@pytest.mark.parametrize("include_dynamic", [True, False])
@pytest.mark.parametrize("include_json", [True, False])
@pytest.mark.parametrize("include_partition_key", [True])
@pytest.mark.parametrize("include_dynamic", [True])
@pytest.mark.parametrize("include_json", [True])
@pytest.mark.tags(CaseLabel.L0)
def test_milvus_restore_back_with_new_feature_support(self, include_json, include_dynamic, include_partition_key):
def test_milvus_restore_back_with_json_dynamic_schema_partition_key(self, include_json, include_dynamic, include_partition_key):
self._connect()
name_origin = cf.gen_unique_str(prefix)
back_up_name = cf.gen_unique_str(backup_prefix)
Expand Down Expand Up @@ -268,7 +267,7 @@ def test_milvus_restore_back_with_new_feature_support(self, include_json, includ
@pytest.mark.parametrize("include_partition_key", [True])
@pytest.mark.parametrize("include_dynamic", [True])
@pytest.mark.parametrize("include_json", [True])
@pytest.mark.tags(CaseLabel.MASTER)
@pytest.mark.tags(CaseLabel.L2)
def test_milvus_restore_back_with_multi_json_datatype(self, include_json, include_dynamic, include_partition_key):
self._connect()
name_origin = cf.gen_unique_str(prefix)
Expand Down Expand Up @@ -349,8 +348,7 @@ def test_milvus_restore_back_with_multi_json_datatype(self, include_json, includ
all_backup = []
assert back_up_name not in all_backup


@pytest.mark.parametrize("drop_db", [True, False])
@pytest.mark.parametrize("drop_db", [True])
@pytest.mark.parametrize("str_json", [True, False])
@pytest.mark.tags(CaseLabel.L0)
def test_milvus_restore_with_db_collections(self, drop_db, str_json):
Expand Down Expand Up @@ -413,9 +411,9 @@ def test_milvus_restore_with_db_collections(self, drop_db, str_json):
if not drop_db:
self.compare_collections(collection_name, collection_name + suffix)

@pytest.mark.parametrize("include_partition_key", [True, False])
@pytest.mark.parametrize("include_dynamic", [True, False])
@pytest.mark.tags(CaseLabel.L0)
@pytest.mark.parametrize("include_partition_key", [True])
@pytest.mark.parametrize("include_dynamic", [True])
@pytest.mark.tags(CaseLabel.L2)
def test_milvus_restore_back_with_array_datatype(self, include_dynamic, include_partition_key):
self._connect()
name_origin = cf.gen_unique_str(prefix)
Expand Down Expand Up @@ -488,10 +486,9 @@ def test_milvus_restore_back_with_array_datatype(self, include_dynamic, include_
all_backup = []
assert back_up_name not in all_backup


@pytest.mark.parametrize("include_partition_key", [True, False])
@pytest.mark.parametrize("include_dynamic", [True, False])
@pytest.mark.tags(CaseLabel.MASTER)
@pytest.mark.parametrize("include_partition_key", [True])
@pytest.mark.parametrize("include_dynamic", [True])
@pytest.mark.tags(CaseLabel.L2)
def test_milvus_restore_back_with_multi_vector_datatype(self, include_dynamic, include_partition_key):
self._connect()
name_origin = cf.gen_unique_str(prefix)
Expand Down Expand Up @@ -570,10 +567,9 @@ def test_milvus_restore_back_with_multi_vector_datatype(self, include_dynamic, i
all_backup = []
assert back_up_name not in all_backup


@pytest.mark.parametrize("include_partition_key", [True, False])
@pytest.mark.parametrize("include_dynamic", [True, False])
@pytest.mark.tags(CaseLabel.MASTER)
@pytest.mark.parametrize("include_partition_key", [True])
@pytest.mark.parametrize("include_dynamic", [True])
@pytest.mark.tags(CaseLabel.L1)
def test_milvus_restore_back_with_f16_bf16_datatype(self, include_dynamic, include_partition_key):
self._connect()
name_origin = cf.gen_unique_str(prefix)
Expand Down Expand Up @@ -656,7 +652,7 @@ def test_milvus_restore_back_with_f16_bf16_datatype(self, include_dynamic, inclu
@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, enable_text_match):
def test_milvus_restore_back_with_sparse_vector_text_match_datatype(self, include_dynamic, include_partition_key, enable_text_match):
self._connect()
name_origin = cf.gen_unique_str(prefix)
back_up_name = cf.gen_unique_str(backup_prefix)
Expand Down Expand Up @@ -739,7 +735,6 @@ def test_milvus_restore_back_with_sparse_vector_datatype(self, include_dynamic,
all_backup = []
assert back_up_name not in all_backup


@pytest.mark.tags(CaseLabel.L1)
def test_milvus_restore_back_with_delete(self):
self._connect()
Expand Down Expand Up @@ -844,7 +839,7 @@ def test_milvus_restore_back_with_upsert(self):
output_fields = None
self.compare_collections(name_origin, name_origin + suffix, output_fields=output_fields, verify_by_query=True)

@pytest.mark.tags(CaseLabel.MASTER)
@pytest.mark.tags(CaseLabel.L1)
def test_milvus_restore_back_with_dup_pk(self):
self._connect()
name_origin = cf.gen_unique_str(prefix)
Expand Down

0 comments on commit 025e4d0

Please sign in to comment.