diff --git a/Makefile b/Makefile index 9617a2d3..55d75453 100644 --- a/Makefile +++ b/Makefile @@ -218,10 +218,16 @@ change-copyright-year: ./utils/missing_license.sh change-year test: gofiles - go test -v -coverprofile=/tmp/coverage.out -run=${TESTRUN} ./internal/... ./pkg/... + go test -v -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/... test-integration: gofiles - go test -v github.com/ProtonMail/proton-bridge/v2/tests + go test -v -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 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 a4a7900c..b3ad00a4 100644 --- a/tests/bdd_test.go +++ b/tests/bdd_test.go @@ -29,6 +29,7 @@ import ( "github.com/cucumber/godog" "github.com/stretchr/testify/require" "gitlab.protontech.ch/go/liteapi/server/backend" + "go.uber.org/goleak" ) func init() { @@ -57,6 +58,10 @@ 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) {