-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathdb_test.go
40 lines (31 loc) · 894 Bytes
/
db_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) The EfficientGo Authors.
// Licensed under the Apache License 2.0.
package e2edb
import (
"context"
"testing"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"github.com/efficientgo/core/testutil"
"github.com/efficientgo/e2e"
)
func TestMinio(t *testing.T) {
t.Parallel()
e, err := e2e.New()
testutil.Ok(t, err)
t.Cleanup(e.Close)
minioContainer := NewMinio(e, "mintest", "bkt")
testutil.Ok(t, e2e.StartAndWaitReady(minioContainer))
endpoint := minioContainer.Endpoint("http")
accessKeyID := MinioAccessKey
secretAccessKey := MinioSecretKey
minioClient, err := minio.New(endpoint, &minio.Options{
Creds: credentials.NewStaticV4(accessKeyID, secretAccessKey, ""),
Secure: false,
})
testutil.Ok(t, err)
testutil.Ok(
t,
minioClient.MakeBucket(context.Background(), "test-bucket", minio.MakeBucketOptions{}),
)
}