-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
base: master
Are you sure you want to change the base?
test: add create collection V2 cases for milvus client #43841
Conversation
Signed-off-by: Orpheus Wang <[email protected]>
Signed-off-by: Orpheus Wang <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 9Eurydice9 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 |
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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]>
@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): | ||
""" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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): | |||
""" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modified
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
@9Eurydice9 cpu-e2e job failed, comment |
Signed-off-by: Orpheus Wang <[email protected]>
Signed-off-by: Orpheus Wang <[email protected]>
issue: #43590
Migrate collection test cases from TestcaseBase to TestMilvusClientV2Base