mongo/buildscripts/resmokelib/extensions
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
..
__init__.py SERVER-118987 Allow resmoke config to load specific extensions (#48193) 2026-02-20 18:53:11 +00:00
add_extensions_signature_pub_key_path.py SERVER-119906: Enable UP006 ruff rule (#48284) 2026-02-20 18:55:17 +00:00
BUILD.bazel SERVER-123445 Remove vector_search_extension suites and extension loading code (#51244) 2026-04-07 20:03:17 +00:00
constants.py SERVER-115286 Pass --extensionsSignaturePublicKeyPath on resmoke startup (#47368) 2026-02-01 02:18:46 +00:00
delete_extension_configs.py SERVER-110317 Modify --loadExtensions to only accept extension names (#41282) 2025-09-18 00:06:43 +00:00
find_and_generate_extension_configs.py SERVER-118987 Allow resmoke config to load specific extensions (#48193) 2026-02-20 18:53:11 +00:00
generate_extension_configs.py SERVER-109992 Add e2e noPassthrough tests for extension loading with config options (#41503) 2025-09-24 17:41:41 +00:00
OWNERS.yml SERVER-118519 Automate extension config file generation for running extensions passthroughs locally (#47320) 2026-02-03 00:58:08 +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

Extensions

This module provides utilities for setting up and configuring MongoDB extensions in resmoke test suites.

Overview

Extensions are dynamically loaded shared objects (.so files) that provide additional functionality to MongoDB. The utilities in this folder can handle:

  1. Discovering extension .so files in build directories
  2. Generating .conf configuration files for extensions
  3. Cleaning up configuration files after tests

Configuration File Generation in Tests

Extension .conf files are YAML configuration files that tell the server how to load an extension. They contain:

  • sharedLibraryPath: Path to the .so file
  • extensionOptions: Optional configuration parameters for the extension

For example:

# foo.conf
sharedLibraryPath: /path/to/libfoo_mongo_extension.so
extensionOptions:
  someSetting: <value>

How Config Files Are Generated

The generate_extension_configs.py module creates .conf files:

  1. Receives a list of .so file paths (either from automatic discovery via find_and_generate_extension_configs.py, or manually via --so-files command-line argument)
  2. For each .so, creates a .conf file in the temp directory (/tmp/mongo/extensions/)
  3. Looks up corresponding extension options from src/mongo/db/extension/test_examples/configurations.yml, if any are specified
  4. Writes the config file with sharedLibraryPath and any extensionOptions

Automatic Discovery and Generation

The find_and_generate_extension_configs.py module combines discovery and generation:

  1. Searches for *_mongo_extension.so files in build directories:
    • Evergreen: dist-test/lib/
    • Local: bazel-bin/install-dist-test/lib/ or bazel-bin/install-extensions/lib/
  2. Generates .conf files with a unique UUID suffix to avoid collisions
  3. Adds the loadExtensions parameter to mongod/mongos options