Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
1b72761
Add a mongot search sidecar to the replica-set target
danielfrankcom Jun 17, 2026
c9d0da7
Add search stage tests
danielfrankcom Jun 23, 2026
8f9b4d4
merge from upstream/main
danielfrankcom Jun 25, 2026
44a668c
Use the thread timeout method so wedged tests are killed
danielfrankcom Jun 25, 2026
60428ff
Capture per-service container logs from the test jobs
danielfrankcom Jun 25, 2026
b93de5d
Cap the mongot JVM heap to keep the replset CI runner in memory
danielfrankcom Jun 25, 2026
1efa866
Add required-field validation for in/near/equals/range operators
danielfrankcom Jun 26, 2026
c6096dc
Add count null-default and non-finite threshold tests
danielfrankcom Jun 26, 2026
1f6a718
Add doesNotAffect operator option tests for equals/in/range
danielfrankcom Jun 26, 2026
447ff1c
Add searchNodePreference and returnScope stage option tests
danielfrankcom Jun 26, 2026
2c17775
Add operator score modifier variant and validity tests
danielfrankcom Jun 26, 2026
892f448
Add per-operator score compatibility tests
danielfrankcom Jun 26, 2026
52758a6
Pin the mongot image to 1.70.1 and migrate its config to the new sync…
danielfrankcom Jul 1, 2026
a1f8417
Add queryString, moreLikeThis, and embeddedDocument operator tests
danielfrankcom Jul 1, 2026
f8d1624
Add text multi-analyzer path tests
danielfrankcom Jul 1, 2026
87555f9
Add returnScope tests
danielfrankcom Jul 1, 2026
2c74432
Add operator-vocabulary and prerequisite rejection tests
danielfrankcom Jul 1, 2026
936ba71
merge from upstream/main
danielfrankcom Jul 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ jobs:
--json-report --json-report-file=${{ github.workspace }}/.test-results/${{ matrix.target.name }}-report.json \
--junitxml=${{ github.workspace }}/.test-results/${{ matrix.target.name }}-results.xml

- name: Dump container logs
if: always()
run: |
# One file per service in the profile
mkdir -p "${{ github.workspace }}/.test-results/container-logs"
for svc in $(docker compose -f dev/compose.yaml --profile ${{ matrix.target.profile }} config --services); do
docker compose -f dev/compose.yaml --profile ${{ matrix.target.profile }} \
logs --no-color --timestamps "$svc" \
> "${{ github.workspace }}/.test-results/container-logs/${svc}.log" 2>&1 || true
done

- name: Upload test results
if: always()
uses: actions/upload-artifact@v7
Expand Down
51 changes: 49 additions & 2 deletions dev/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# query: <optional connection-string query string, without leading '?'>
#
# A service with no `x-test-target` is not a test target and is ignored by the
# registry.
# registry (e.g. the mongot sidecar, which is reached only through its mongod).
#
# Memory: each mongod caps its WiredTiger cache (--wiredTigerCacheSizeGB). By
# default a mongod sizes its cache to ~50% of the host/VM RAM; with several
Expand Down Expand Up @@ -60,7 +60,26 @@ services:
mongo-replset:
image: mongo:8.2.4
profiles: ["mongo-replset", "all"]
command: ["--replSet", "rs0", "--bind_ip_all", "--wiredTigerCacheSizeGB", "1.5"]
command:
- "--replSet"
- "rs0"
- "--bind_ip_all"
- "--wiredTigerCacheSizeGB"
- "1.5"
# Point at the mongot search sidecar so this replica set also serves the
# search surfaces. mongot is transparent to all other behavior, so the
# set behaves identically to a plain replica set apart from gaining
# search; it is one target, not two.
- "--setParameter"
- "mongotHost=mongot:27028"
- "--setParameter"
- "searchIndexManagementHostAndPort=mongot:27028"
- "--setParameter"
- "useGrpcForSearch=true"
- "--setParameter"
- "skipAuthenticationToMongot=true"
- "--setParameter"
- "skipAuthenticationToSearchIndexManagementServer=true"
ports:
- "27018:27017"
healthcheck:
Expand All @@ -71,3 +90,31 @@ services:
x-test-target:
engine: mongodb
query: directConnection=true

# mongot: the search sidecar for the mongo-replset target. Not a test target
# on its own; the suite reaches it only through mongo-replset. mongot is
# MongoDB Search Community Edition (SSPL, same license as the server). It
# replicates from the replica set as an authenticated sync source and reads
# its password from a file, so the entrypoint writes that file (a fixed
# local-dev secret, matched by the searchCoordinator user the harness creates
# on the replica set) with owner-only permissions before launching. It retries
# the connection until that user exists.
mongot:
image: mongodb/mongodb-community-search:1.70.1
profiles: ["mongo-replset", "all"]
entrypoint:
- "sh"
- "-c"
- >
umask 077 &&
mkdir -p /mongot-secrets &&
printf '%s' "$$MONGOT_SYNC_PASSWORD" > /mongot-secrets/passwordFile &&
exec /mongot-community/mongot --config /mongot-config/mongot.yml
environment:
# Fixed local-dev secret shared with the searchCoordinator user the
# harness provisions on mongo-replset. Not a real credential.
MONGOT_SYNC_PASSWORD: "searchSyncPassword"
# Cap mongot's JVM heap. Unset, the JVM sizes its max heap to ~25% of host RAM.
JAVA_TOOL_OPTIONS: "-Xmx1g"
volumes:
- ./mongot.yml:/mongot-config/mongot.yml:ro
32 changes: 32 additions & 0 deletions dev/mongot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# mongot configuration for the mongo-replset target (dev/compose.yaml service
# "mongot"). mongot is MongoDB Search Community Edition (SSPL), the same license
# as the server. It runs alongside the replica set's mongod and serves the
# search and vector search surfaces.
#
# mongot replicates from the mongod replica set as a sync source. It requires an
# authenticated connection (it has no unauthenticated mode), so it logs in as a
# dedicated user holding the searchCoordinator role. That user and its password
# file are provisioned by the target's startup (see dev/compose.yaml).
syncSource:
replicaSet:
hostAndPort: "mongo-replset:27017"
scramAuth:
username: "searchSyncUser"
authSource: "admin"
passwordFile: "/mongot-secrets/passwordFile"
tls:
enabled: false
storage:
dataPath: "/var/lib/mongot"
server:
grpc:
# mongod reaches mongot here (see mongotHost / searchIndexManagementHostAndPort
# on the mongo-replset service). Bound on all interfaces so the mongod
# container can connect over the compose network.
address: "0.0.0.0:27028"
tls:
mode: "disabled"
healthCheck:
address: "0.0.0.0:8080"
logging:
verbosity: INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""Shared fixtures for $search stage tests.

The dynamic-mapping ``indexed_collection`` corpus is queried read-only by most
$search test files, so it is built once per package here rather than duplicated
per file. Single-operator corpora (wildcard, equals, in, ...) stay inline in
their own test file, since each is used by exactly one file."""

from __future__ import annotations

import pytest

from documentdb_tests.compatibility.tests.core.operator.stages.search.utils.search_common import (
FIXTURE_DOCS,
create_dynamic_search_index,
)
from documentdb_tests.framework import fixtures


@pytest.fixture(scope="package")
def indexed_collection(engine_client, worker_id):
"""A package-scoped collection populated with the fixture docs and a ready
dynamic search index, shared read-only across the matching tests so the
index is built and polled once rather than per test."""
db_name = fixtures.generate_database_name("stages_search_shared", worker_id)
fixtures.cleanup_database(engine_client, db_name)
db = engine_client[db_name]
coll = db["indexed"]
coll.insert_many(FIXTURE_DOCS)
create_dynamic_search_index(coll)
yield coll
fixtures.cleanup_database(engine_client, db_name)
Loading
Loading