@@ -204,25 +204,31 @@ the pages will re-render and the browser will automatically refresh.
204
204
` just test test/test_change_stream.py::TestUnifiedChangeStreamsErrors::test_change_stream_errors_on_ElectionInProgress ` .
205
205
- Use the ` -k ` argument to select tests by pattern.
206
206
207
+
208
+ ## Running tests that require secrets, services, or other configuration
209
+
210
+ - Clone ` drivers-evergreen-tools ` :
211
+ ` git clone [email protected] :mongodb-labs/drivers-evergreen-tools.git ` .
212
+ - Run ` export DRIVERS_TOOLS=$PWD/drivers-evergreen-tools ` . This can be put into a ` .bashrc ` file
213
+ for convenience.
214
+ - Run ` just run-server ` with optional args to set up the server.
215
+ - Run ` just setup-tests ` with optional args to set up the test environment, secrets, etc.
216
+ - Run ` just run-tests ` to run the tests in an appropriate Python environment.
217
+ - When done, run ` just teardown-tests ` to clean up and ` just stop-server ` to stop the server.
218
+
207
219
## Running Load Balancer Tests Locally
208
220
221
+ - Set up ` DRIVERS_TOOLS ` (see above).
209
222
- Install ` haproxy ` (available as ` brew install haproxy ` on macOS).
210
- - Clone ` drivers-evergreen-tools ` :
211
- ` git clone [email protected] :mongodb-labs/drivers-evergreen-tools.git ` .
212
- - Start the servers using
213
- ` LOAD_BALANCER=true TOPOLOGY=sharded_cluster AUTH=noauth SSL=nossl MONGODB_VERSION=6.0 DRIVERS_TOOLS=$PWD/drivers-evergreen-tools MONGO_ORCHESTRATION_HOME=$PWD/drivers-evergreen-tools/.evergreen/orchestration $PWD/drivers-evergreen-tools/.evergreen/run-orchestration.sh ` .
214
- - Set up the test using:
215
- ` MONGODB_URI='mongodb://localhost:27017,localhost:27018/' just setup-tests load-balancer ` .
216
- - Run the tests from the ` pymongo ` checkout directory using:
217
- ` just run-tests ` .
223
+ - Start the servers with ` just run-server load-balancer ` .
224
+ - Set up the test with ` just setup-tests load-balancer ` .
225
+ - Run the tests with ` just run-tests ` .
218
226
219
227
## Running Encryption Tests Locally
220
- - Clone ` drivers-evergreen-tools ` :
221
- ` git clone [email protected] :mongodb-labs/drivers-evergreen-tools.git ` .
222
- - Run ` export DRIVERS_TOOLS=$PWD/drivers-evergreen-tools `
228
+ - Set up ` DRIVERS_TOOLS ` (see above).
229
+ - Run ` just setup-tests ` to set up the server.
223
230
- Run ` AWS_PROFILE=<profile> just setup-tests encryption ` after setting up your AWS profile with ` aws configure sso ` .
224
231
- Run the tests with ` just run-tests ` .
225
- - When done, run ` just teardown-tests ` to clean up.
226
232
227
233
## Enable Debug Logs
228
234
- Use ` -o log_cli_level="DEBUG" -o log_cli=1 ` with ` just test ` or ` pytest ` .
0 commit comments