Skip to content

Commit

Permalink
add more test for data api
Browse files Browse the repository at this point in the history
Signed-off-by: ryjiang <[email protected]>
  • Loading branch information
shanghaikid committed Aug 21, 2024
1 parent 2d4f355 commit e386f84
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/grpc/Data.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,32 @@ describe(`Data.API`, () => {
});

expect(query.status.error_code).toEqual(ErrorCode.SUCCESS);

// query varchar ids collection
const query0 = await milvusClient.query({
collection_name: VARCHAR_ID_COLLECTION_NAME,
expr: 'id != ""',
});

// get first 3 ids
const ids = query0.data.slice(0, 3).map(d => d.id);
// query by ids
const queryVarcharIds = await milvusClient.query({
collection_name: VARCHAR_ID_COLLECTION_NAME,
ids: ids,
});
expect(queryVarcharIds.status.error_code).toEqual(ErrorCode.SUCCESS);
expect(queryVarcharIds.data.length).toEqual(3);
});

it('delete withouth colleciton name should throw error', async () => {
try {
await milvusClient.deleteEntities({
expr: 'id > 0',
} as any);
} catch (error) {
expect(error.message).toEqual(ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
}
});

it(`delete by ids should success`, async () => {
Expand Down

0 comments on commit e386f84

Please sign in to comment.