Skip to content

Commit 8a94de1

Browse files
authored
PYTHON-5343 Clean up contributing docs (#2390)
1 parent 87c015f commit 8a94de1

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

CONTRIBUTING.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,15 @@ just docs-serve
190190
Browse to the link provided, and then as you make changes to docstrings or narrative docs,
191191
the pages will re-render and the browser will automatically refresh.
192192

193-
194193
## Running Tests Locally
195194

196-
- Ensure you have started the appropriate Mongo Server(s).
197195
- Run `just install` to set a local virtual environment, or you can manually
198196
create a virtual environment and run `pytest` directly. If you want to use a specific
199197
version of Python, remove the `.venv` folder and set `PYTHON_BINARY` before running `just install`.
198+
- Ensure you have started the appropriate Mongo Server(s). You can run `just run-server` with optional args
199+
to set up the server. All given options will be passed to
200+
[`run-orchestration.sh`](https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/run-orchestration.sh). Run `$DRIVERS_TOOLS/evergreen/run-orchestration.sh -h`
201+
for a full list of options.
200202
- Run `just test` or `pytest` to run all of the tests.
201203
- Append `test/<mod_name>.py::<class_name>::<test_name>` to run
202204
specific tests. You can omit the `<test_name>` to test a full class
@@ -213,18 +215,36 @@ the pages will re-render and the browser will automatically refresh.
213215
`git clone [email protected]:mongodb-labs/drivers-evergreen-tools.git`.
214216
- Run `export DRIVERS_TOOLS=$PWD/drivers-evergreen-tools`. This can be put into a `.bashrc` file
215217
for convenience.
216-
- Set up access to [Drivers test secrets](https://github.com/mongodb-labs/drivers-evergreen-tools/tree/master/.evergreen/secrets_handling#secrets-handling).
218+
- Some tests require access to [Drivers test secrets](https://github.com/mongodb-labs/drivers-evergreen-tools/tree/master/.evergreen/secrets_handling#secrets-handling).
217219

218220
### Usage
219221

220-
- Run `just run-server` with optional args to set up the server. All given options will be passed to
221-
`run-orchestration.sh` in `$DRIVERS_TOOLS`. See `$DRIVERS_TOOLS/evergreen/run-orchestration.sh -h`
222-
for a full list of options.
222+
- Run `just run-server` with optional args to set up the server.
223223
- Run `just setup-tests` with optional args to set up the test environment, secrets, etc.
224224
See `just setup-tests -h` for a full list of available options.
225225
- Run `just run-tests` to run the tests in an appropriate Python environment.
226226
- When done, run `just teardown-tests` to clean up and `just stop-server` to stop the server.
227227

228+
### SSL tests
229+
230+
- Run `just run-server --ssl` to start the server with TLS enabled.
231+
- Run `just setup-tests --ssl`.
232+
- Run `just run-tests`.
233+
234+
Note: for general testing purposes with an TLS-enabled server, you can use the following (this should ONLY be used
235+
for local testing):
236+
237+
```python
238+
from pymongo import MongoClient
239+
240+
client = MongoClient(
241+
"mongodb://localhost:27017?tls=true&tlsAllowInvalidCertificates=true"
242+
)
243+
```
244+
245+
If you want to use the actual certificate file then set `tlsCertificateKeyFile` to the local path
246+
to `<repo_roo>/test/certificates/client.pem` and `tlsCAFile` to the local path to `<repo_roo>/test/certificates/ca.pem`.
247+
228248
### Encryption tests
229249

230250
- Run `just run-server` to start the server.
@@ -434,6 +454,7 @@ run `pre-commit run --all-files --hook-stage manual ruff` and fix all reported e
434454
hook again.
435455

436456
## Converting a test to async
457+
437458
The `tools/convert_test_to_async.py` script takes in an existing synchronous test file and outputs a
438459
partially-converted asynchronous version of the same name to the `test/asynchronous` directory.
439460
Use this generated file as a starting point for the completed conversion.

0 commit comments

Comments
 (0)