Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
d41d619
Phase 3: Added implementation plan and details of implementation
krishnasai453 Jun 24, 2026
fa5bca0
Add changeStream stage tests (#601)
danielfrankcom Jun 24, 2026
e904e5c
Add listLocalSessions stage tests (#605)
danielfrankcom Jun 24, 2026
01405a8
Add `setQuerySettings` tests (#610)
alinaliBQ Jun 25, 2026
7a38ed4
Add `profile` tests (#621)
alinaliBQ Jun 25, 2026
7f044f5
Add `serverStatus` tests (#623)
alinaliBQ Jun 25, 2026
b5fb810
Add `applyOps` tests (#624)
alinaliBQ Jun 25, 2026
10fd3d8
Add replaceRoot aggregation stage tests (#572)
danielfrankcom Jun 25, 2026
3eb70a6
Add redact aggregation stage tests (#584)
danielfrankcom Jun 25, 2026
f6b3307
Add currentOp stage tests (#592)
danielfrankcom Jun 25, 2026
2969bcc
Add `whatsmyuri` command tests (#643)
alinaliBQ Jun 25, 2026
299f0a9
added complete fix for bitAnd operator
krishnasai453 Jul 1, 2026
0bde932
removed the strategy text
krishnasai453 Jul 1, 2026
6972e93
Add $planCacheListFilters command tests (#588)
alinaliBQ Jul 2, 2026
0d2ea39
Add $planCacheClearFilters command tests (#583)
alinaliBQ Jul 2, 2026
81b942b
Add update array tests for $push (#598)
vic-tsang Jul 2, 2026
8e01541
Add listCommands tests (#609)
PatersonProjects Jul 2, 2026
a1737eb
Add lockInfo tests (#612)
PatersonProjects Jul 2, 2026
13632cb
Add `removeQuerySettings` tests (#613)
alinaliBQ Jul 2, 2026
2e606ea
Feature: query-and-write readConcern parameter (#615)
imforster Jul 2, 2026
0aa29ff
Add query and write tests for findAndModify (#619)
vic-tsang Jul 2, 2026
977fd3f
Feature: query-and-write writeConcern parameter (#620)
imforster Jul 2, 2026
b72f7ed
Add compactStructuredEncryptionData administration command tests (#625)
imforster Jul 2, 2026
369c88a
Add collMod command tests (#626)
danielfrankcom Jul 2, 2026
ce4db22
Add autoCompact command tests (#629)
danielfrankcom Jul 2, 2026
df5f31b
Add query and write tests for bulkWrite (#630)
vic-tsang Jul 2, 2026
d227fe3
Add getDefaultRWConcern command tests (#633)
danielfrankcom Jul 2, 2026
3023aec
Add admin command tests for getParameter (#634)
vic-tsang Jul 2, 2026
beb08e5
Add `hello` tests (#632)
alinaliBQ Jul 2, 2026
b8389a4
Add getCmdLineOpts tests (#635)
PatersonProjects Jul 2, 2026
6f9546b
Add `top` tests (#636)
alinaliBQ Jul 2, 2026
eef01e4
Add admin command tests for killOp (#637)
vic-tsang Jul 2, 2026
09433fa
Avoid scanning historical oplog in cluster-wide changeStream tests (#…
danielfrankcom Jul 3, 2026
1ae6063
Add `validate` tests (#639)
alinaliBQ Jul 3, 2026
8c826fd
Add getLog tests (#640)
PatersonProjects Jul 3, 2026
d73329d
Add fsyncUnlock command tests (#641)
danielfrankcom Jul 3, 2026
c4dbb6d
Add admin command tests for logRotate (#642)
vic-tsang Jul 3, 2026
18c75e4
Add hostInfo tests (#644)
PatersonProjects Jul 3, 2026
c5dd02e
Add `killSessions` command tests (#593)
alinaliBQ Jul 6, 2026
304192f
Add update tests for pullAll (#602)
vic-tsang Jul 6, 2026
6082421
abort Transaction tests (#600)
alinaliBQ Jul 6, 2026
15ac10c
commit Transaction tests (#560)
alinaliBQ Jul 7, 2026
3979cb4
Add getClusterParameter tests (#656)
PatersonProjects Jul 7, 2026
cceac4c
Add $ping tests (#616)
PatersonProjects Jul 7, 2026
4844d32
Add `setFeatureCompatibilityVersion` tests (#647)
alinaliBQ Jul 7, 2026
159b5a7
Add `setUserWriteBlockMode` tests (#658)
alinaliBQ Jul 7, 2026
68b5982
Add abs expression tests (#659)
danielfrankcom Jul 7, 2026
799faa7
Added $add and $ceil tests (#660)
PatersonProjects Jul 7, 2026
dd0f373
Add searchMeta stage tests (#638)
danielfrankcom Jul 7, 2026
ecd681d
Add $dbStats tests (#622)
PatersonProjects Jul 7, 2026
740bc4e
Add $exp expression tests (#663)
danielfrankcom Jul 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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
@@ -1,4 +1,4 @@
"""Tests for collation in bulkWrite operations."""
"""Tests for collation in the bulkWrite command."""

from __future__ import annotations

Expand All @@ -8,13 +8,14 @@
CommandContext,
CommandTestCase,
)
from documentdb_tests.framework.assertions import assertResult
from documentdb_tests.framework.executor import execute_command
from documentdb_tests.framework.assertions import assertSuccessPartial
from documentdb_tests.framework.executor import execute_admin_command
from documentdb_tests.framework.parametrize import pytest_params
from documentdb_tests.framework.target_collection import CustomCollection

# Property [BulkWrite Update Collation]: individual update operations within a
# bulkWrite can specify collation, affecting filter matching independently.
# bulkWrite command can specify collation, affecting filter matching
# independently of other operations in the same command.
COLLATION_BULK_UPDATE_TESTS: list[CommandTestCase] = [
CommandTestCase(
"bulk_update_case_insensitive",
Expand All @@ -23,21 +24,24 @@
{"_id": 2, "x": "banana", "v": 1},
],
command=lambda ctx: {
"update": ctx.collection,
"updates": [
"bulkWrite": 1,
"ops": [
{
"q": {"x": "apple"},
"u": {"$set": {"v": 2}},
"update": 0,
"filter": {"x": "apple"},
"updateMods": {"$set": {"v": 2}},
"collation": {"locale": "en", "strength": 2},
},
{
"q": {"x": "BANANA"},
"u": {"$set": {"v": 3}},
"update": 0,
"filter": {"x": "BANANA"},
"updateMods": {"$set": {"v": 3}},
"collation": {"locale": "en", "strength": 2},
},
],
"nsInfo": [{"ns": ctx.namespace}],
},
expected={"ok": 1.0, "n": 2, "nModified": 2},
expected={"ok": 1.0, "nMatched": 2, "nModified": 2},
msg="bulkWrite updates should each use their own collation",
),
CommandTestCase(
Expand All @@ -47,26 +51,30 @@
{"_id": 2, "x": "banana", "v": 1},
],
command=lambda ctx: {
"update": ctx.collection,
"updates": [
"bulkWrite": 1,
"ops": [
{
"q": {"x": "apple"},
"u": {"$set": {"v": 2}},
"update": 0,
"filter": {"x": "apple"},
"updateMods": {"$set": {"v": 2}},
"collation": {"locale": "en", "strength": 2},
},
{
"q": {"x": "BANANA"},
"u": {"$set": {"v": 3}},
"update": 0,
"filter": {"x": "BANANA"},
"updateMods": {"$set": {"v": 3}},
},
],
"nsInfo": [{"ns": ctx.namespace}],
},
expected={"ok": 1.0, "n": 1, "nModified": 1},
expected={"ok": 1.0, "nMatched": 1, "nModified": 1},
msg="bulkWrite with mixed collation: only collated op should match case-insensitively",
),
]

# Property [BulkWrite Delete Collation]: individual delete operations within a
# bulkWrite can specify collation, affecting filter matching independently.
# bulkWrite command can specify collation, affecting filter matching
# independently of other operations in the same command.
COLLATION_BULK_DELETE_TESTS: list[CommandTestCase] = [
CommandTestCase(
"bulk_delete_case_insensitive",
Expand All @@ -76,16 +84,18 @@
{"_id": 3, "x": "cherry"},
],
command=lambda ctx: {
"delete": ctx.collection,
"deletes": [
"bulkWrite": 1,
"ops": [
{
"q": {"x": "apple"},
"limit": 0,
"delete": 0,
"filter": {"x": "apple"},
"multi": True,
"collation": {"locale": "en", "strength": 2},
},
],
"nsInfo": [{"ns": ctx.namespace}],
},
expected={"ok": 1.0, "n": 1},
expected={"ok": 1.0, "nDeleted": 1},
msg="bulkWrite delete with collation should match case-insensitively",
),
CommandTestCase(
Expand All @@ -96,15 +106,17 @@
{"_id": 3, "x": "banana"},
],
command=lambda ctx: {
"delete": ctx.collection,
"deletes": [
"bulkWrite": 1,
"ops": [
{
"q": {"x": "apple"},
"limit": 0,
"delete": 0,
"filter": {"x": "apple"},
"multi": True,
},
],
"nsInfo": [{"ns": ctx.namespace}],
},
expected={"ok": 1.0, "n": 1},
expected={"ok": 1.0, "nDeleted": 1},
msg="bulkWrite delete without collation should use binary comparison",
),
]
Expand All @@ -120,15 +132,17 @@
{"_id": 2, "x": "banana", "v": 1},
],
command=lambda ctx: {
"update": ctx.collection,
"updates": [
"bulkWrite": 1,
"ops": [
{
"q": {"x": "apple"},
"u": {"$set": {"v": 2}},
"update": 0,
"filter": {"x": "apple"},
"updateMods": {"$set": {"v": 2}},
},
],
"nsInfo": [{"ns": ctx.namespace}],
},
expected={"ok": 1.0, "n": 1, "nModified": 1},
expected={"ok": 1.0, "nMatched": 1, "nModified": 1},
msg="bulkWrite update should inherit collection default collation",
),
CommandTestCase(
Expand All @@ -139,15 +153,17 @@
{"_id": 2, "x": "banana"},
],
command=lambda ctx: {
"delete": ctx.collection,
"deletes": [
"bulkWrite": 1,
"ops": [
{
"q": {"x": "apple"},
"limit": 0,
"delete": 0,
"filter": {"x": "apple"},
"multi": True,
},
],
"nsInfo": [{"ns": ctx.namespace}],
},
expected={"ok": 1.0, "n": 1},
expected={"ok": 1.0, "nDeleted": 1},
msg="bulkWrite delete should inherit collection default collation",
),
]
Expand All @@ -161,14 +177,8 @@

@pytest.mark.parametrize("test", pytest_params(COLLATION_BULK_WRITE_TESTS))
def test_collation_bulk_write(database_client, collection, test):
"""Test collation behavior in bulkWrite operations."""
"""Test collation behavior in the bulkWrite command."""
collection = test.prepare(database_client, collection)
ctx = CommandContext.from_collection(collection)
result = execute_command(collection, test.build_command(ctx))
assertResult(
result,
expected=test.build_expected(ctx),
error_code=test.error_code,
msg=test.msg,
raw_res=True,
)
result = execute_admin_command(collection, test.build_command(ctx))
assertSuccessPartial(result, test.build_expected(ctx), msg=test.msg)
Loading