2022-04-08 13:50:25 +00:00
# Testing
Most tests for MongoDB are run through resmoke, our test runner and orchestration tool.
The entry point for resmoke can be found at `buildscripts/resmoke.py`
2025-07-16 16:16:42 -04:00
## Concepts
2022-04-08 13:50:25 +00:00
2025-07-16 16:16:42 -04:00
Learn more about related topics using their own targeted documentation:
2022-04-08 13:50:25 +00:00
2025-07-16 16:16:42 -04:00
- [resmoke ](../../buildscripts/resmokelib/README.md ), the test runner
- [suites ](../../buildscripts/resmokeconfig/suites/README.md ), how tests are grouped and configured
- [fixtures ](../../buildscripts/resmokelib/testing/fixtures/README.md ), specify the server topology that tests run against
- [hooks ](../../buildscripts/resmokelib/testing/hooks/README.md ), logic to run before, after and/or between individual tests
2025-10-20 18:05:08 -04:00
- [testcases ](../../buildscripts/resmokelib/testing/testcases/README.md ), Python-based unittest interfaces that resmoke can run as different "kinds" of tests.
2022-04-08 13:50:25 +00:00
2025-07-16 16:16:42 -04:00
## Basic Example
2022-04-08 13:50:25 +00:00
2025-07-16 16:16:42 -04:00
First, ensure that your python `venv` is active and up to date:
2022-04-08 13:50:25 +00:00
2025-07-16 16:16:42 -04:00
```
python3 -m venv python3-venv
source python3-venv/bin/activate
buildscripts/poetry_sync.sh
```
2022-04-08 13:50:25 +00:00
2025-07-16 16:16:42 -04:00
and you've built the source binaries to run against, eg:
2022-04-08 13:50:25 +00:00
2025-07-16 16:16:42 -04:00
```
bazel build install-dist-test
```
2022-04-08 13:50:25 +00:00
2025-07-16 16:16:42 -04:00
Now, **run the test content ** from one test file:
2023-08-30 23:05:34 +00:00
2025-07-16 16:16:42 -04:00
```
buildscripts/resmoke.py run --suites=no_passthrough jstests/noPassthrough/shell/js/string.js
```
2023-08-30 23:05:34 +00:00
2025-07-16 16:16:42 -04:00
The suite defined in [buildscripts/resmokeconfig/suites/no_passthrough.yml ](../../buildscripts/resmokeconfig/suites/no_passthrough.yml ) includes that `string.js` file via glob selections, specifies no fixtures, no hooks, and a minimal config for the executor.