mongo/buildscripts/resmokelib
Steve McClure 32e8f260de SERVER-124136 Format markdown via prettier: wrap lines and use width of 100 (#52231)
GitOrigin-RevId: 3305c1e2ee3a6a2c3a5b2b7883b0f491a59ed646
2026-04-21 19:20:11 +00:00
..
core SERVER-122254 Increase intensity of Timeseries Write PBT and add resmoke CLI arguments (#50090) 2026-03-26 14:34:55 +00:00
discovery SERVER-120217 Update to using rules python (#48943) 2026-03-06 01:52:51 +00:00
extensions SERVER-124136 Format markdown via prettier: wrap lines and use width of 100 (#52231) 2026-04-21 19:20:11 +00:00
generate_fcv_constants SERVER-120217 Update to using rules python (#48943) 2026-03-06 01:52:51 +00:00
generate_fuzz_config SERVER-124136 Format markdown via prettier: wrap lines and use width of 100 (#52231) 2026-04-21 19:20:11 +00:00
hang_analyzer SERVER-124136 Format markdown via prettier: wrap lines and use width of 100 (#52231) 2026-04-21 19:20:11 +00:00
logging SERVER-122144 Fix race condition in BufferedFileHandler (#50685) 2026-03-31 14:57:04 +00:00
multiversion SERVER-120217 Update to using rules python (#48943) 2026-03-06 01:52:51 +00:00
powercycle SERVER-124136 Format markdown via prettier: wrap lines and use width of 100 (#52231) 2026-04-21 19:20:11 +00:00
run SERVER-122254 Increase intensity of Timeseries Write PBT and add resmoke CLI arguments (#50090) 2026-03-26 14:34:55 +00:00
setup_multiversion SERVER-120217 Update to using rules python (#48943) 2026-03-06 01:52:51 +00:00
symbolizer SERVER-120217 Update to using rules python (#48943) 2026-03-06 01:52:51 +00:00
testing SERVER-124136 Format markdown via prettier: wrap lines and use width of 100 (#52231) 2026-04-21 19:20:11 +00:00
utils SERVER-123419: Fix HistoryDict.copy() re-entrancy via __setitem__ (#51131) 2026-04-06 17:18:22 +00:00
__init__.py SERVER-94816 Add Resmoke run / test-discovery CLI option to calculate a subset of tests to use when more complex suite exists (#27943) 2024-10-22 02:53:12 +00:00
BUILD.bazel SERVER-123109 Add wasm support for s390x and fix ppc platform (#50992) 2026-04-02 22:05:36 +00:00
cli.py SERVER-104350 Enable Resmoke telemetry in workstation bazel invocations (#35421) 2025-04-25 20:56:06 +00:00
config.py SERVER-123226: Use BUILD_WORKSPACE_DIRECTORY as RESMOKE_ROOT (#50956) 2026-04-01 18:37:56 +00:00
configure_resmoke.py SERVER-122254 Increase intensity of Timeseries Write PBT and add resmoke CLI arguments (#50090) 2026-03-26 14:34:55 +00:00
errors.py SERVER-90570: Enable formatting checks for buildscripts directory, excluding idl (#22254) 2024-05-16 22:07:36 +00:00
flags.py
multiversionconstants.py SERVER-120474 Get modularized resmoke to work in other directories (#49174) 2026-03-11 17:50:56 +00:00
multiversionsetupconstants.py Revert "SERVER-86852 Add support for requires_fcv_tag_latest resmoke suite tag (#19971)" 2024-03-30 07:28:57 +00:00
OWNERS.yml SERVER-105622 Fix ownership on some correctness/build files (#36626) 2025-05-28 21:30:57 +00:00
parser.py SERVER-120474 Get modularized resmoke to work in other directories (#49174) 2026-03-11 17:50:56 +00:00
plugin.py SERVER-106408: Begin using configuration dict instead of namespace (#38308) 2025-07-10 16:37:35 +00:00
README.md SERVER-124136 Format markdown via prettier: wrap lines and use width of 100 (#52231) 2026-04-21 19:20:11 +00:00
reportfile.py
selector.py SERVER-120474 Get modularized resmoke to work in other directories (#49174) 2026-03-11 17:50:56 +00:00
sighandler.py SERVER-108127 Add test timeouts to Resmoke (#40419) 2025-08-26 20:16:02 +00:00
suite_hierarchy.py SERVER-122029 Remove use of simulate_atlas_proxy.js (#50818) 2026-04-01 00:13:05 +00:00
suitesconfig.py SERVER-123027 Auto-derive resmoke_suite_test srcs from suite YAML selectors (#50756) 2026-03-31 18:07:20 +00:00

Resmoke

Resmoke is MongoDB's integration test runner.

The JS Tests it can run live in the jstests/ directory - reference its README to learn about their content.

Build

Though the source is built with bazel, resmoke is not yet integrated. This means that the source has to be built prior to using resmoke, eg:

bazel build install-dist-test

Actions

    run                 Runs the specified tests.
    list-suites         Lists the names of the suites available to execute.
    generate-matrix-suites
                        Generate matrix suite config files from the mapping files.
    find-suites         Lists the names of the suites that will execute the specified tests.
    list-tags           Lists the tags and their documentation available in the suites.
    generate-multiversion-exclude-tags
                        Create a tag file associating multiversion tests to tags for exclusion. Compares the BACKPORTS_REQUIRED_FILE on the current branch with the same file on the last-lts and/or last-continuous branch to determine which tests should be
                        denylisted.
    core-analyzer       Analyzes the core dumps from the specified input files.
    hang-analyzer       Hang Analyzer module. A prototype hang analyzer for Evergreen integration to help investigate test timeouts 1. Script supports taking dumps, and/or dumping a summary of useful information about a process 2. Script will iterate
                        through a list of interesting processes, and run the tools from step 1. The list of processes can be provided as an option. 3. Java processes will be dumped using jstack, if available. Supports Linux, MacOS X, and Windows.
    powercycle          Powercycle test. Tests robustness of mongod to survive multiple powercycle events. Client & server side powercycle test script. This script is used in conjunction with certain Evergreen hosts created with the `evergreen host
                        create` command.
    generate-fcv-constants
                        ==SUPPRESS==
    test-discovery      Discover what tests are run by a suite.
    suiteconfig         Display configuration of a test suite.
    multiversion-config
                        Display configuration for multiversion testing
    generate-fuzz-config
                        Generate a mongod.conf and mongos.conf using config fuzzer.

Note: bisect, setup-multiversion, and symbolize commands have been moved to db-contrib-tool.

Suites

Many of the above commands use the concept of a "suite". Loosely, suites group which tests run, and how.

Read more about suites here.

run

The run command is the most used feature of resmoke.

The most typical approach is to run a particular JS test file given a suite, eg:

buildscripts/resmoke.py run --suites=no_passthrough jstests/noPassthrough/shell/js/string.js

That executes the content of that file, using the suite configuration as a fixture setup. The suite "no_passthrough" is associated with the file buildscripts/resmokeconfig/suites/no_passthrough.yml.

Run has 100+ flags! Use resmoke run --help to inspect them. To avoid risk of multiple sources of truth that can drift and become stale, we do not attempt to document them all here - they should each be self-descriptive and documented within the CLI help.

Below are very high-level descriptions for high-usage flags.

Suites (--suites)

The run subcommand can run suites (list of tests and the MongoDB topology and configuration to run them against), and explicitly named test files.

A single suite can be specified using the --suite flag, and multiple suites can be specified by providing a comma separated list to the --suites flag.

Additional documentation on our suite configuration can be found in buildscripts/resmokeconfig/suites/README.md.

Testable Installations (--installDir)

resmoke can run tests against any testable installation of MongoDB (such as ASAN, Debug, Release). When possible, resmoke will automatically locate and run with a locally built copy of MongoDB Server, so long as that build was installed to a subdirectory of the root of the git repository, and there is exactly one build. In other situations, the --installDir flag, passed to run subcommand, can be used to indicate the location of the mongod/mongos binaries.

As an alternative, you may instead prefer to use the resmoke.py wrapper script located in the same directory as the mongod binary, which will automatically set installDir for you.

Note that this wrapper is unavailable in packaged installations of MongoDB Server, such as those provided by Homebrew, and other package managers. If you would like to run tests against a packaged installation, you must explicitly pass --installDir to resmoke.py

Resmoke test telemetry

We capture telemetry from resmoke using open telemetry.

Using open telemetry (OTel) we capture more specific information about the internals of resmoke. This data is used for improvements specifically when running in evergreen. This data is captured on every resmoke invocation but only sent to honeycomb when running in evergreen. More info about how we use OTel in resmoke can be found here.