mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
37 lines
797 B
Go
37 lines
797 B
Go
package workflow
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/formancehq/go-libs/testing/docker"
|
|
"github.com/formancehq/go-libs/testing/utils"
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/formancehq/go-libs/logging"
|
|
"go.temporal.io/sdk/testsuite"
|
|
|
|
"github.com/formancehq/go-libs/testing/platform/pgtesting"
|
|
)
|
|
|
|
var (
|
|
srv *pgtesting.PostgresServer
|
|
devServer *testsuite.DevServer
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
utils.WithTestMain(func(t *utils.TestingTForMain) int {
|
|
srv = pgtesting.CreatePostgresServer(t, docker.NewPool(t, logging.Testing()))
|
|
|
|
var err error
|
|
devServer, err = testsuite.StartDevServer(context.Background(), testsuite.DevServerOptions{})
|
|
require.NoError(t, err)
|
|
|
|
t.Cleanup(func() {
|
|
require.NoError(t, devServer.Stop())
|
|
})
|
|
|
|
return m.Run()
|
|
})
|
|
}
|