-
Type: Task
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
Not Needed
-
The tests currently have a few different ways of creating test clients:
- TestClient::new
- TestClient::with_options
- TestClient::with_handler
- TestClient::with_additional_options
- EventClient::new
- EventClient::with_options_and_handler
- EventClient::with_options
- EventClient::with_additional_options
Within these various methods, there are also a number of different ways of populating the options from MONGODB_URI and additional options provided by the runner:
- TestClient::options_for_multiple_mongoses
- update_options_for_testing
- ClientOptions::merge
- merge_uri_options
All of these different methods add a lot of complexity to configuring clients, and making small changes to runners or any of these methods can lead to tricky failures that are difficult to diagnose. Furthermore, different test runners make use of different combinations of these configurations, which can lead to inconsistencies between them.
We should try to consolidate all of these down to a much simpler set of methods that are easier to maintain and use.