Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSDK-8952 Skip MDB tests until MDB instance is recreated #367

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions testutils/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,18 @@ func backingMongoDBClientWithOptions(baseOptions *options.ClientOptions) (*mongo
// BackingMongoDBClient returns a backing MongoDB client to use.
func BackingMongoDBClient(tb testing.TB) *mongo.Client {
tb.Helper()
client, err := backingMongoDBClient()
if err != nil {
skipWithError(tb, err)
return nil
}
return client
// TODO(RSDK-8952): Re-enable tests that interact with MDB once
// we resurrect the downed MBD instance or create a new one.
tb.Skip("skipping MongoDB related test for now; see RSDK-8952")
return nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks fine -- but given the tb.Skip did you need to early return and avoid the underlying code? My understanding of skip is that it won't execute any more code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should indeed exit, I got a linter error without that return nil below.

/*
client, err := backingMongoDBClient()
if err != nil {
skipWithError(tb, err)
return nil
}
return client
*/
}

// BackingMongoDBClientWithOptions returns a backing MongoDB client to use with the provided options.
Expand Down
Loading