Skip to content

Commit

Permalink
Merge pull request #727 from teamhanko/fix_test_container_names
Browse files Browse the repository at this point in the history
fix: use uuid for docker database container names in test
  • Loading branch information
like-a-bause authored Apr 14, 2023
2 parents 9b48d5b + 7f3ea65 commit 0407d34
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions backend/test/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import (
"github.com/go-testfixtures/testfixtures/v3"
"github.com/gobuffalo/pop/v6"
"github.com/gobuffalo/pop/v6/logging"
"github.com/gofrs/uuid"
"github.com/stretchr/testify/suite"
"github.com/teamhanko/hanko/backend/config"
"github.com/teamhanko/hanko/backend/crypto"
"github.com/teamhanko/hanko/backend/persistence"
"strings"
"testing"
)

Expand All @@ -28,11 +27,11 @@ func (s *Suite) SetupSuite() {
//pop.Debug = true
if s.Name == "" {
var err error
s.Name, err = crypto.GenerateRandomStringURLSafe(5)
s.Name = strings.ReplaceAll(s.Name, "=", "")
id, err := uuid.NewV4()
if err != nil {
s.Fail("failed to generate database container name")
}
s.Name = id.String()
}
dialect := "postgres"
db, err := StartDB(s.Name, dialect)
Expand Down

0 comments on commit 0407d34

Please sign in to comment.