88 "github.com/10gen/migration-verifier/internal/util"
99 mapset "github.com/deckarep/golang-set/v2"
1010 "github.com/pkg/errors"
11+ "github.com/rs/zerolog"
1112 "github.com/stretchr/testify/suite"
1213 "go.mongodb.org/mongo-driver/bson"
1314 "go.mongodb.org/mongo-driver/mongo"
@@ -27,6 +28,8 @@ type IntegrationTestSuite struct {
2728 testContext context.Context
2829 contextCanceller context.CancelCauseFunc
2930 initialDbNames mapset.Set [string ]
31+
32+ zerologGlobalLogLevel zerolog.Level
3033}
3134
3235var _ suite.TestingSuite = & IntegrationTestSuite {}
@@ -111,11 +114,14 @@ func (suite *IntegrationTestSuite) SetupTest() {
111114 }
112115
113116 suite .testContext , suite .contextCanceller = ctx , canceller
117+ suite .zerologGlobalLogLevel = zerolog .GlobalLevel ()
114118}
115119
116120func (suite * IntegrationTestSuite ) TearDownTest () {
117121 suite .T ().Logf ("Tearing down test %#q" , suite .T ().Name ())
118122
123+ zerolog .SetGlobalLevel (suite .zerologGlobalLogLevel )
124+
119125 suite .contextCanceller (errors .Errorf ("tearing down test %#q" , suite .T ().Name ()))
120126 suite .testContext , suite .contextCanceller = nil , nil
121127 ctx := context .Background ()
0 commit comments