Signed-off-by: SoXX <soxx@fenpa.ws>
This commit is contained in:
parent
51aa79e4c2
commit
9c8a7c1e16
@ -3,17 +3,15 @@ package test
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"net/url"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"git.dragse.it/anthrove/otter-space-sdk/pkg/models"
|
"git.dragse.it/anthrove/otter-space-sdk/pkg/models"
|
||||||
migrate "github.com/rubenv/sql-migrate"
|
migrate "github.com/rubenv/sql-migrate"
|
||||||
postgrescontainer "github.com/testcontainers/testcontainers-go/modules/postgres"
|
postgrescontainer "github.com/testcontainers/testcontainers-go/modules/postgres"
|
||||||
"gorm.io/driver/postgres"
|
"gorm.io/driver/postgres"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
"gorm.io/gorm/logger"
|
"gorm.io/gorm/logger"
|
||||||
|
"net/url"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/testcontainers/testcontainers-go"
|
"github.com/testcontainers/testcontainers-go"
|
||||||
"github.com/testcontainers/testcontainers-go/wait"
|
"github.com/testcontainers/testcontainers-go/wait"
|
||||||
@ -34,9 +32,7 @@ func StartPostgresContainer(ctx context.Context) (*postgrescontainer.PostgresCon
|
|||||||
postgrescontainer.WithUsername(databaseUser),
|
postgrescontainer.WithUsername(databaseUser),
|
||||||
postgrescontainer.WithPassword(databasePassword),
|
postgrescontainer.WithPassword(databasePassword),
|
||||||
testcontainers.WithWaitStrategy(
|
testcontainers.WithWaitStrategy(
|
||||||
wait.ForLog("database system is ready to accept connections").
|
wait.ForLog("database system is ready to accept connections")))
|
||||||
WithOccurrence(2).WithStartupTimeout(10*time.Second)),
|
|
||||||
)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user