Merge multiple functions for creating consul containers into one. (#6612)

Merge both functions for creating mongodb containers into one.
Add retries to docker container cleanups.
Require $VAULT_ACC be set to enable AWS tests.
This commit is contained in:
ncabatoff
2019-04-22 12:26:10 -04:00
committed by GitHub
parent e0c71cb282
commit 0f1569b7f5
28 changed files with 295 additions and 441 deletions

View File

@@ -10,6 +10,7 @@ import (
"testing"
"time"
"github.com/hashicorp/vault/helper/testhelpers/docker"
"github.com/hashicorp/vault/sdk/database/dbplugin"
"github.com/ory/dockertest"
)
@@ -34,10 +35,7 @@ func preparePostgresTestContainer(t *testing.T) (cleanup func(), retURL string)
}
cleanup = func() {
err := pool.Purge(resource)
if err != nil {
t.Fatalf("Failed to cleanup local container: %s", err)
}
docker.CleanupResource(t, pool, resource)
}
retURL = fmt.Sprintf("postgres://postgres:secret@localhost:%s/database?sslmode=disable", resource.GetPort("5432/tcp"))