Merge pull request #993 from fluxcd/cleanup-minio-test-container

purge minio test container at the end of tests
This commit is contained in:
Sunny 2022-12-23 15:09:36 +05:30 committed by GitHub
commit c8feb3ac17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import (
"github.com/google/uuid"
miniov7 "github.com/minio/minio-go/v7"
"github.com/ory/dockertest/v3"
"github.com/ory/dockertest/v3/docker"
"gotest.tools/assert"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -125,6 +126,8 @@ func TestMain(m *testing.M) {
"MINIO_ROOT_PASSWORD=" + testMinioRootPassword,
},
Cmd: []string{"server", "/data", "--console-address", ":9001"},
}, func(config *docker.HostConfig) {
config.AutoRemove = true
})
if err != nil {
log.Fatalf("could not start resource: %s", err)
@ -168,6 +171,7 @@ func TestMain(m *testing.M) {
run := m.Run()
removeObjectFromBucket(ctx)
deleteBucket(ctx)
purgeResource()
os.Exit(run)
}