From 835570dfaa20020dbb1948f8d59e4d2f59197145 Mon Sep 17 00:00:00 2001 From: ryjiang Date: Mon, 25 Nov 2024 14:38:46 +0800 Subject: [PATCH] Fix 2.5 function tests (#378) Signed-off-by: ryjiang --- test/grpc/Functions.spec.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/test/grpc/Functions.spec.ts b/test/grpc/Functions.spec.ts index fcf554a7..558bf075 100644 --- a/test/grpc/Functions.spec.ts +++ b/test/grpc/Functions.spec.ts @@ -184,12 +184,20 @@ describe(`Functions schema API`, () => { consistency_level: ConsistencyLevelEnum.Strong, }); - expect(query.status.error_code).toEqual(ErrorCode.SUCCESS); - expect(query.data.length).toEqual(10); - // data should have 'sparse' field - expect(query.data[0].hasOwnProperty('sparse')).toBeTruthy(); - // data should have 'sparse2' field - expect(query.data[0].hasOwnProperty('sparse2')).toBeTruthy(); + expect(query.status.error_code).toEqual(ErrorCode.UnexpectedError); + expect(query.status.reason).toEqual( + 'not allowed to retrieve raw data of field sparse' + ); + + const query2 = await milvusClient.query({ + collection_name: COLLECTION, + limit: 10, + expr: 'id > 0', + output_fields: ['vector', 'id', 'text'], + consistency_level: ConsistencyLevelEnum.Strong, + }); + + expect(query2.data.length).toEqual(10); }); it(`search with varchar should success`, async () => {