mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
Co-authored-by: Antoine Wacheux <[email protected]> Co-authored-by: Maxence Maireaux <[email protected]> Co-authored-by: Brieuc Caillot <[email protected]>
27 lines
543 B
Go
27 lines
543 B
Go
package benchmarks
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/formancehq/stack/libs/go-libs/logging"
|
|
"github.com/formancehq/stack/libs/go-libs/pgtesting"
|
|
"github.com/ory/dockertest/v3/docker"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
|
|
if err := pgtesting.CreatePostgresServer(pgtesting.WithDockerHostConfigOption(func(hostConfig *docker.HostConfig) {
|
|
hostConfig.CPUCount = 2
|
|
})); err != nil {
|
|
logging.Error(err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
code := m.Run()
|
|
if err := pgtesting.DestroyPostgresServer(); err != nil {
|
|
logging.Error(err)
|
|
}
|
|
os.Exit(code)
|
|
}
|