Skip to content

Commit

Permalink
add more test for functions
Browse files Browse the repository at this point in the history
Signed-off-by: ryjiang <[email protected]>
  • Loading branch information
shanghaikid committed Nov 26, 2024
1 parent 835570d commit 08afa8d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/grpc/Functions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
dynamicFields,
} from '../tools';

const milvusClient = new MilvusClient({ address: IP, logLevel: 'debug' });
const milvusClient = new MilvusClient({ address: IP, logLevel: 'info' });
const COLLECTION = GENERATE_NAME();
const dbParam = {
db_name: 'Functions',
Expand Down Expand Up @@ -49,7 +49,6 @@ const createCollectionParams = genCollectionParams({
name: 'sparse2',
description: 'sparse field2',
data_type: DataType.SparseFloatVector,
is_function_output: true,
},
],
functions: [
Expand Down Expand Up @@ -102,6 +101,7 @@ describe(`Functions schema API`, () => {
const sparse = describe.schema.fields.find(
field => field.is_function_output
);

// expect the 'sparse' field's name to be 'sparse'
expect(sparse!.name).toEqual('sparse');

Expand All @@ -117,6 +117,13 @@ describe(`Functions schema API`, () => {
'sparse2',
]);
expect(describe.schema.functions[1].type).toEqual('BM25');

// find the `sparse2` field
const sparse2 = describe.schema.fields.find(
field => field.name === 'sparse2'
);
// its function output should be true
expect(sparse2!.is_function_output).toEqual(true);
});

it(`Insert data with function field should success`, async () => {
Expand Down

0 comments on commit 08afa8d

Please sign in to comment.