mongo/buildscripts/resmokelib/extensions
Sean Lyons 5e6e35755f SERVER-127113: Add bazel targets for extension resmoke suites (#54033)
GitOrigin-RevId: db2bf329f8a21a54fd8ef8143b1918e56647c40e
2026-05-20 18:20:34 +00:00
..
__init__.py SERVER-127113: Add bazel targets for extension resmoke suites (#54033) 2026-05-20 18:20:34 +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-127113: Add bazel targets for extension resmoke suites (#54033) 2026-05-20 18:20:34 +00:00
delete_extension_configs.py SERVER-127113: Add bazel targets for extension resmoke suites (#54033) 2026-05-20 18:20:34 +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-127113: Add bazel targets for extension resmoke suites (#54033) 2026-05-20 18:20:34 +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