diff --git a/Makefile b/Makefile index 55d75453..2c6bb540 100644 --- a/Makefile +++ b/Makefile @@ -218,16 +218,16 @@ change-copyright-year: ./utils/missing_license.sh change-year test: gofiles - go test -v -p=1 -count=1 -coverprofile=/tmp/coverage.out -run=${TESTRUN} ./internal/... ./pkg/... + go test -v -timeout=5m -p=1 -count=1 -coverprofile=/tmp/coverage.out -run=${TESTRUN} ./internal/... ./pkg/... test-race: gofiles - go test -v -p=1 -count=1 -race -failfast -run=${TESTRUN} ./internal/... ./pkg/... + go test -v -timeout=30m -p=1 -count=1 -race -failfast -run=${TESTRUN} ./internal/... ./pkg/... test-integration: gofiles - go test -v -p=1 -count=1 github.com/ProtonMail/proton-bridge/v2/tests + go test -v -timeout=10m -p=1 -count=1 github.com/ProtonMail/proton-bridge/v2/tests test-integration-race: gofiles - go test -v -p=1 -count=1 -race -failfast github.com/ProtonMail/proton-bridge/v2/tests + go test -v -timeout=60m -p=1 -count=1 -race -failfast github.com/ProtonMail/proton-bridge/v2/tests bench: go test -run '^$$' -bench=. -memprofile bench_mem.pprof -cpuprofile bench_cpu.pprof ./internal/store diff --git a/tests/bdd_test.go b/tests/bdd_test.go index b3ad00a4..a4a7900c 100644 --- a/tests/bdd_test.go +++ b/tests/bdd_test.go @@ -29,7 +29,6 @@ import ( "github.com/cucumber/godog" "github.com/stretchr/testify/require" "gitlab.protontech.ch/go/liteapi/server/backend" - "go.uber.org/goleak" ) func init() { @@ -58,10 +57,6 @@ func (s *scenario) close(tb testing.TB) { require.NoError(tb, s.t.close(context.Background())) } -func TestMain(m *testing.M) { - goleak.VerifyTestMain(m, goleak.IgnoreCurrent()) -} - func TestFeatures(testingT *testing.T) { suite := godog.TestSuite{ ScenarioInitializer: func(ctx *godog.ScenarioContext) { diff --git a/tests/main_test.go b/tests/main_test.go new file mode 100644 index 00000000..1e6d068d --- /dev/null +++ b/tests/main_test.go @@ -0,0 +1,11 @@ +package tests + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m, goleak.IgnoreCurrent()) +}