Skip to content

Commit

Permalink
Update cases due to error message change (#630)
Browse files Browse the repository at this point in the history
Signed-off-by: ThreadDao <[email protected]>
  • Loading branch information
ThreadDao authored Nov 30, 2023
1 parent d1df1d6 commit fbc33f5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions test/testcases/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func TestDropDb(t *testing.T) {

// verify current db
_, err = mc.ListCollections(ctx)
common.CheckErr(t, err, false, fmt.Sprintf("database=%s: database not found", dbName))
common.CheckErr(t, err, false, fmt.Sprintf("database not found[database=%s]", dbName))

// using default db and verify collections
mc.UsingDatabase(ctx, common.DefaultDb)
Expand Down Expand Up @@ -195,7 +195,7 @@ func TestUsingDb(t *testing.T) {
// using not existed db
dbName := common.GenRandomString(4)
err := mc.UsingDatabase(ctx, dbName)
common.CheckErr(t, err, false, fmt.Sprintf("connect fail, database=%s: database not found", dbName))
common.CheckErr(t, err, false, fmt.Sprintf("connect fail, database not found[database=%s]", dbName))

// using empty db
err = mc.UsingDatabase(ctx, "")
Expand Down
4 changes: 2 additions & 2 deletions test/testcases/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ func TestCreateIndexArrayField(t *testing.T) {
if field.DataType == entity.FieldTypeArray {
// create scalar index
err := mc.CreateIndex(ctx, collName, field.Name, scalarIdx, false, client.WithIndexName("scalar_index"))
common.CheckErr(t, err, false, "create index on Array field: invalid parameter")
common.CheckErr(t, err, false, "create index on json field is not supported: invalid parameter")
// create vector index
err1 := mc.CreateIndex(ctx, collName, field.Name, vectorIdx, false, client.WithIndexName("vector_index"))
common.CheckErr(t, err1, false, "create index on Array field: invalid parameter")
common.CheckErr(t, err1, false, "create index on json field is not supported: invalid parameter")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/testcases/insert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestInsertAutoIdPkData(t *testing.T) {
// insert
pkColumn, floatColumn, vecColumn := common.GenDefaultColumnData(0, common.DefaultNb, common.DefaultDim)
_, errInsert := mc.Insert(ctx, collName, "", pkColumn, floatColumn, vecColumn)
common.CheckErr(t, errInsert, false, "the length of passed fields is equal to needed: expected=2, actual=3: invalid parameter")
common.CheckErr(t, errInsert, false, "the number of fields is less than needed")

// flush and check row count
errFlush := mc.Flush(ctx, collName, false)
Expand Down
8 changes: 4 additions & 4 deletions test/testcases/resource_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ func TestTransferInvalidNodes(t *testing.T) {
errMsg string
}
invalidNodes := []invalidNodesStruct{
{nodesNum: 0, errMsg: "expected=NumNode > 0, actual=invalid NumNode"},
{nodesNum: -1, errMsg: "expected=NumNode > 0, actual=invalid NumNode"},
{nodesNum: 0, errMsg: "invalid parameter[expected=NumNode > 0][actual=invalid NumNode 0]"},
{nodesNum: -1, errMsg: "invalid parameter[expected=NumNode > 0][actual=invalid NumNode -1]"},
{nodesNum: 99, errMsg: "nodes not enough"},
}
// transfer node
Expand Down Expand Up @@ -412,8 +412,8 @@ func TestTransferReplicaInvalidReplicaNumber(t *testing.T) {
errMsg string
}
invalidReplicas := []invalidReplicasStruct{
{replicaNumber: 0, errMsg: "expected=NumReplica > 0, actual=invalid NumReplica"},
{replicaNumber: -1, errMsg: "expected=NumReplica > 0, actual=invalid NumReplica"},
{replicaNumber: 0, errMsg: "invalid parameter[expected=NumReplica > 0][actual=invalid NumReplica 0]"},
{replicaNumber: -1, errMsg: "invalid parameter[expected=NumReplica > 0][actual=invalid NumReplica -1]"},
{replicaNumber: 1, errMsg: "only found [0] replicas in source resource group"},
}

Expand Down
2 changes: 1 addition & 1 deletion test/testcases/upsert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestUpsertAutoID(t *testing.T) {
// upsert with pks
pkColumn := entity.NewColumnInt64(common.DefaultIntFieldName, ids.(*entity.ColumnInt64).Data()[:100])
_, err = mc.Upsert(ctx, collName, "", pkColumn, floatColumn1, vecColumn1)
common.CheckErr(t, err, false, "the length of passed fields is equal to needed")
common.CheckErr(t, err, false, "the number of fields is less than needed")
}

func TestUpsertVarcharPk(t *testing.T) {
Expand Down

0 comments on commit fbc33f5

Please sign in to comment.