Skip to content

Commit 140a494

Browse files
committed
set working dir and update contributing docs
1 parent 206b664 commit 140a494

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

.evergreen/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ functions:
205205
- command: subprocess.exec
206206
params:
207207
binary: bash
208+
working_dir: "src"
208209
include_expansions_in_env: [VERSION, TOPOLOGY, AUTH, SSL, ORCHESTRATION_FILE,
209210
STORAGE_ENGINE, REQUIRE_API_VERSION, DRIVERS_TOOLS, TEST_CRYPT_SHARED]
210211
args: [.evergreen/just.sh, run-server, "${TEST_NAME}", "${SUB_TEST_NAME}"]

CONTRIBUTING.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -204,25 +204,31 @@ the pages will re-render and the browser will automatically refresh.
204204
`just test test/test_change_stream.py::TestUnifiedChangeStreamsErrors::test_change_stream_errors_on_ElectionInProgress`.
205205
- Use the `-k` argument to select tests by pattern.
206206

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+
207219
## Running Load Balancer Tests Locally
208220

221+
- Set up `DRIVERS_TOOLS` (see above).
209222
- 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`.
218226

219227
## 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.
223230
- Run `AWS_PROFILE=<profile> just setup-tests encryption` after setting up your AWS profile with `aws configure sso`.
224231
- Run the tests with `just run-tests`.
225-
- When done, run `just teardown-tests` to clean up.
226232

227233
## Enable Debug Logs
228234
- Use `-o log_cli_level="DEBUG" -o log_cli=1` with `just test` or `pytest`.

0 commit comments

Comments
 (0)