Skip to content

test: add create collection V2 cases for milvus client #43841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

9Eurydice9
Copy link
Contributor

issue: #43590
Migrate collection test cases from TestcaseBase to TestMilvusClientV2Base

@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 9Eurydice9
To complete the pull request process, please assign xiaofan-luan after the PR has been reviewed.
You can assign the PR to them by writing /assign @xiaofan-luan in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sre-ci-robot sre-ci-robot added size/XL Denotes a PR that changes 500-999 lines. area/test sig/testing labels Aug 12, 2025
schema.add_field(ct.default_int64_field_name, DataType.INT64, is_primary=True, auto_id=None)
assert False
except Exception as e:
assert "Param auto_id must be bool type" in str(e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to use self.add_field() and then you can use check_task for err msg

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

schema.add_field("int_field", DataType.INT64, auto_id=True)
assert False
except Exception as e:
assert "auto_id can only be specified on the primary key field" in str(e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

schema.add_field(ct.default_int64_field_name, DataType.INT64, auto_id=True)
assert False, "Expected exception was not raised"
except Exception as e:
assert "auto_id can only be specified on the primary key field" in str(e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L2)
def test_milvus_client_collection_over_maximum_vector_and_over_all_fields(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we combine the following 4 tests into one?
test_milvus_client_collection_over_maximum_vector_and_over_all_fields
test_milvus_client_collection_multiple_vector_and_over_maximum_all_fields
test_milvus_client_collection_over_maximum_vector_fields
test_milvus_client_collection_over_maximum_fields

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also with following 2
test_milvus_client_collection_maximum_fields
test_milvus_client_collection_maximum_vector_and_maximum_fields

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

combined

Signed-off-by: Orpheus Wang <[email protected]>
Signed-off-by: Orpheus Wang <[email protected]>
Signed-off-by: Orpheus Wang <[email protected]>
@sre-ci-robot sre-ci-robot added size/XXL Denotes a PR that changes 1000+ lines. and removed size/XL Denotes a PR that changes 500-999 lines. labels Aug 14, 2025
@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.parametrize("invalid_dim", ct.invalid_dims)
def test_milvus_client_collection_vector_invalid_dim_fields(self, invalid_dim):
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this case anymore, as we have test_milvus_client_collection_vector_invalid_dim_default_schema

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleted

@@ -258,6 +400,59 @@ def test_milvus_client_collection_empty_fields(self):
self.create_collection(client, collection_name, schema=schema,
check_task=CheckTasks.err_res, check_items=error)

def test_milvus_client_collection_over_maximum_limits(self):
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add L2 tag to this test please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

# Create schema with primary field (no auto_id) and non-primary field with auto_id=False
schema = self.create_schema(client, enable_dynamic_field=False)[0]
schema.add_field("id", DataType.INT64, is_primary=True)
schema.add_field("field2", DataType.INT64, auto_id=False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to set auto_id=True here, because the default vaule of auto_id is False

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to update the test name accordingly, maybe comments as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

self.drop_collection(client, collection_name)

@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.xfail(reason="pymilvus issue, should use fieldschema as top priority")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please link an issue here for xfail

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have restructured this case, please check

@@ -950,6 +1454,23 @@ def test_milvus_client_collection_dup_name_drop(self):
f"[collection={collection_name}]"}
self.describe_collection(client1, collection_name, check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L1)
def test_milvus_client_collection_desc(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update this test to verify all the info for describe_collection

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we already had this test... please check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are already two cases regarding description:
one invalid case: test_milvus_client_collection_none_desc
one valid case: test_milvus_client_collection_long_desc

Copy link
Contributor

mergify bot commented Aug 14, 2025

@9Eurydice9 cpu-e2e job failed, comment /run-cpu-e2e can trigger the job again.

Signed-off-by: Orpheus Wang <[email protected]>
Signed-off-by: Orpheus Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test ci-passed dco-passed DCO check passed. kind/test sig/testing size/XXL Denotes a PR that changes 1000+ lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants