fix: Align minio object storage ut to new minio server behavior (#29014)

See also #29013

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/29003/head^2
congqixia 2023-12-06 15:42:43 +08:00 committed by GitHub
parent 4a067a4c8c
commit 6a86ac0ac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -153,19 +153,21 @@ func TestMinioObjectStorage(t *testing.T) {
key string key string
value []byte value []byte
}{ }{
{false, "abc/", []byte("123")}, // {true, "abc/", []byte("123")}, will write as abc
{true, "abc/d", []byte("1234")}, {true, "abc/d", []byte("1234")},
{false, "abc/d/e", []byte("12345")}, {true, "abc/d/e", []byte("12345")},
{true, "abc/e/d", []byte("12354")}, {true, "abc/e/d", []byte("12354")},
{true, "key_/1/1", []byte("111")}, {true, "key_/1/1", []byte("111")},
{true, "key_/1/2", []byte("222")}, {true, "key_/1/2", []byte("222")},
{false, "key_/1/2/3", []byte("333")}, {true, "key_/1/2/3", []byte("333")},
{true, "key_/2/3", []byte("333")}, {true, "key_/2/3", []byte("333")},
} }
for _, test := range prepareTests { for _, test := range prepareTests {
err := testCM.PutObject(ctx, config.bucketName, test.key, bytes.NewReader(test.value), int64(len(test.value))) t.Run(test.key, func(t *testing.T) {
require.Equal(t, test.valid, err == nil) err := testCM.PutObject(ctx, config.bucketName, test.key, bytes.NewReader(test.value), int64(len(test.value)))
require.Equal(t, test.valid, err == nil)
})
} }
insertWithPrefixTests := []struct { insertWithPrefixTests := []struct {