mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
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:
@@ -6,11 +6,12 @@ import (
|
||||
"testing"
|
||||
|
||||
log "github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/vault/helper/testhelpers/docker"
|
||||
"github.com/hashicorp/vault/sdk/helper/logging"
|
||||
"github.com/hashicorp/vault/sdk/physical"
|
||||
"github.com/ory/dockertest"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
"github.com/ory/dockertest"
|
||||
)
|
||||
|
||||
func TestPostgreSQLBackend(t *testing.T) {
|
||||
@@ -100,10 +101,7 @@ func prepareTestContainer(t *testing.T, logger log.Logger) (cleanup func(), retC
|
||||
retConnString = fmt.Sprintf("postgres://postgres@localhost:%v/postgres?sslmode=disable", resource.GetPort("5432/tcp"))
|
||||
|
||||
cleanup = func() {
|
||||
err := pool.Purge(resource)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to cleanup docker Postgres: %s", err)
|
||||
}
|
||||
docker.CleanupResource(t, pool, resource)
|
||||
}
|
||||
|
||||
// Provide a test function to the pool to test if docker instance service is up.
|
||||
|
||||
Reference in New Issue
Block a user