You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+21-2Lines changed: 21 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -217,9 +217,11 @@ the pages will re-render and the browser will automatically refresh.
217
217
218
218
### Usage
219
219
220
-
- Run `just run-server` with optional args to set up the server.
221
-
All given flags will be passed to `run-orchestration.sh` in `$DRIVERS_TOOLS`.
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
223
- Run `just setup-tests` with optional args to set up the test environment, secrets, etc.
224
+
See `just setup-tests -h` for a full list of available options.
223
225
- Run `just run-tests` to run the tests in an appropriate Python environment.
224
226
- When done, run `just teardown-tests` to clean up and `just stop-server` to stop the server.
225
227
@@ -346,11 +348,28 @@ If you are running one of the `no-responder` tests, omit the `run-server` step.
346
348
- Run the tests: `just run-tests`.
347
349
348
350
## Enable Debug Logs
351
+
349
352
- Use `-o log_cli_level="DEBUG" -o log_cli=1` with `just test` or `pytest`.
350
353
- Add `log_cli_level = "DEBUG` and `log_cli = 1` to the `tool.pytest.ini_options` section in `pyproject.toml` for Evergreen patches or to enable debug logs by default on your machine.
351
354
- You can also set `DEBUG_LOG=1` and run either `just setup-tests` or `just-test`.
355
+
- Finally, you can use `just setup-tests --debug-log`.
352
356
- For evergreen patch builds, you can use `evergreen patch --param DEBUG_LOG=1` to enable debug logs for the patch.
353
357
358
+
## Adding a new test suite
359
+
360
+
- If adding new tests files that should only be run for that test suite, add a pytest marker to the file and add
361
+
to the list of pytest markers in `pyproject.toml`. Then add the test suite to the `TEST_SUITE_MAP` in `.evergreen/scripts/utils.py`. If for some reason it is not a pytest-runnable test, add it to the list of `EXTRA_TESTS` instead.
362
+
- If the test uses Atlas or otherwise doesn't use `run-orchestration.sh`, add it to the `NO_RUN_ORCHESTRATION` list in
363
+
`.evergreen/scripts/utils.py`.
364
+
- If there is something special required to run the local server or there is an extra flag that should always be set
365
+
like `AUTH`, add that logic to `.evergreen/scripts/run_server.py`.
366
+
- The bulk of the logic will typically be in `.evergreen/scripts/setup_tests.py`. This is where you should fetch secrets and make them available using `write_env`, start services, and write other env vars needed using `write_env`.
367
+
- If there are any special test considerations, including not running `pytest` at all, handle it in `.evergreen/scripts/run_tests.py`.
368
+
- If there are any services or atlas clusters to teardown, handle them in `.evergreen/scripts/teardown_tests.py`.
369
+
- Add functions to generate the test variant(s) and task(s) to the `.evergreen/scripts/generate_config.py`.
370
+
- Regenerate the test variants and tasks using the instructions in `.evergreen/scripts/generate_config.py`.
371
+
- Make sure to add instructions for running the test suite to `CONTRIBUTING.md`.
372
+
354
373
## Re-sync Spec Tests
355
374
356
375
If you would like to re-sync the copy of the specification tests in the
0 commit comments