Skip to content

Commit 094212b

Browse files
committed
Test: resolve panic when MONGODB_TEST_CXN is not set
1 parent 236c791 commit 094212b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

log/mongo/mongo_log_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ func (suite *MongoLogTestSuite) TestMongoLog() {
110110
}
111111

112112
func (suite *MongoLogTestSuite) TearDownTest() {
113+
if suite.log == nil { // `TearDownTest` is called even if test is skipped
114+
return
115+
}
113116
entry := generateEntry(&suite.log.sessionID)
114117
_, err := suite.log.db.Database(suite.log.mongoDatabase).Collection(suite.log.messagesLogCollection).DeleteMany(context.Background(), entry)
115118
require.Nil(suite.T(), err)

0 commit comments

Comments
 (0)