mongo/buildscripts/resmokelib
seanzimm 751005bf89 SERVER-115568: Remove check that does not work with missing collections in validate hook (#45318)
GitOrigin-RevId: 6dce4821ae7c3dd304a584a825a4e381ccec6891
2025-12-16 21:39:01 +00:00
..
core SERVER-100136 Build tracedirectory in all variants (#43408) 2025-10-31 19:12:30 +00:00
discovery SERVER-106408: Begin using configuration dict instead of namespace (#38308) 2025-07-10 16:37:35 +00:00
extensions SERVER-109992 Add e2e noPassthrough tests for extension loading with config options (#41503) 2025-09-24 17:41:41 +00:00
generate_fcv_constants SERVER-97704 Wrapped resmoke in bazel (#29688) 2024-12-03 06:05:55 +00:00
generate_fuzz_config SERVER-112797 Set security cluster parameters periodically at runtime in config fuzzer (#45148) 2025-12-15 22:18:00 +00:00
hang_analyzer SERVER-115169 core-analyzer: only parse dwarf versions from compile units we create (#45029) 2025-12-15 22:00:56 +00:00
logging SERVER-104807 Make EvergreenLogFormatter use the same timestamp formats (#35847) 2025-05-08 14:48:39 +00:00
multiversion SERVER-106408: Begin using configuration dict instead of namespace (#38308) 2025-07-10 16:37:35 +00:00
powercycle SERVER-115022: Replace pipes with shlex for Python 3.13 compatibility (#44931) 2025-12-09 22:43:37 +00:00
run SERVER-112797 Set security cluster parameters periodically at runtime in config fuzzer (#45148) 2025-12-15 22:18:00 +00:00
setup_multiversion SERVER-111295 Set python as formatter in format_multirun (#41677) 2025-09-24 17:41:24 +00:00
symbolizer SERVER-106408: Begin using configuration dict instead of namespace (#38308) 2025-07-10 16:37:35 +00:00
testing SERVER-115568: Remove check that does not work with missing collections in validate hook (#45318) 2025-12-16 21:39:01 +00:00
utils SERVER-113205 Investigate transitioning_replicaset_incompatible exclusion usages (#43897) 2025-11-13 15:37:01 +00:00
BUILD.bazel SERVER-110814 Move extension `.conf` helpers to dedicated files (#41279) 2025-09-15 21:06:37 +00:00
OWNERS.yml SERVER-105622 Fix ownership on some correctness/build files (#36626) 2025-05-28 21:30:57 +00:00
README.md SERVER-107798: Build out Resmoke-related Readme's (#38778) 2025-07-21 13:34:20 +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
cli.py SERVER-104350 Enable Resmoke telemetry in workstation bazel invocations (#35421) 2025-04-25 20:56:06 +00:00
config.py SERVER-113067 Add timeout for resmoke hooks when hang analyzer is set (#44262) 2025-11-24 14:47:39 +00:00
configure_resmoke.py SERVER-113067 Add timeout for resmoke hooks when hang analyzer is set (#44262) 2025-11-24 14:47:39 +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 SERVER-76739 Archive data missing on evergreen task timeouts 2023-05-16 15:39:06 +00:00
multiversionconstants.py SERVER-109953 Make resmoke test targets more hermetic (#40868) 2025-09-03 19:18:13 +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
parser.py SERVER-95419: Improve config fuzzer documentation and consolidate files (#40342) 2025-08-21 21:43:25 +00:00
plugin.py SERVER-106408: Begin using configuration dict instead of namespace (#38308) 2025-07-10 16:37:35 +00:00
reportfile.py
selector.py SERVER-111295 Set python as formatter in format_multirun (#41677) 2025-09-24 17:41:24 +00:00
sighandler.py SERVER-108127 Add test timeouts to Resmoke (#40419) 2025-08-26 20:16:02 +00:00
suite_hierarchy.py SERVER-107223 Renamed auto_bootstrap suites to config_shard suites (#42580) 2025-10-16 19:53:47 +00:00
suitesconfig.py SERVER-111295 Set python as formatter in format_multirun (#41677) 2025-09-24 17:41:24 +00:00

README.md

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.