Skip to content

Add missing features supported in 8.2 and 8.3, add spec_since option for smoke test mode - #735

Merged
eerxuan merged 2 commits into
documentdb:mainfrom
eerxuan:add-missing-features-8.3
Nov 20, 2026
Merged

eerxuan merged 2 commits into
documentdb:mainfrom
eerxuan:add-missing-features-8.3

Conversation

@eerxuan

@eerxuan eerxuan commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds feature-tree rows and smoke tests for operators the reference server supports but docs/feature-tree.csv did not track, and a --spec-version option so smoke tests for features from other minor versions can live in the suite without failing runs against older servers.

Reference version and spec versions

Expected results are pinned to MongoDB 8.2.4, the CI target. Every test except smoke tests always runs and expects the 8.2.4 answer, whatever --spec-version is set to.

Only smoke tests (pytest.mark.smoke) can select a target minor version with --spec-version: 8.0, 8.2 (default) or 8.3. There is no 8.1 spec version; a feature added in 8.1 uses spec_since="8.2".

  • Gate a smoke test with the existing requires marker: requires(spec_since="8.3") for a feature added in 8.3, requires(spec_until=...) for one a later version removed. An ungated smoke test runs under every spec.
  • Works on a smoke test, a smoke test file (pytestmark), or a folder of smoke tests (spec_gate_folder(__file__, spec_since="8.3") in its conftest.py).
  • A spec gate on a test without the smoke marker stops collection with a usage error that lists the tests.
  • All requires markers on a test now combine (folder, module, class, test); the closest wins on the same key. Previously only the closest marker applied.
  • Out-of-scope smoke tests are deselected and listed in the .deselected.json sidecar, like unmet capabilities.
  • The marker validator rejects a spec gate that does not name a known version.
  • The JSON report records the spec version and each target's server version under run.

New smoke tests and tree rows

Spec 8.2 (15)

Area Operators
Window $firstN, $lastN, $median, $percentile, $minMaxScaler
Stages $score, $scoreFusion
Vector similarity (new category) $similarityCosine, $similarityDotProduct, $similarityEuclidean
System variables $$DESCEND, $$PRUNE, $$KEEP, $$USER_ROLES
Projection $meta

Spec 8.3 (11), folder-gated with spec_since="8.3": $mergeObjects (window), $$IDX, $currentDate, $toArray, $toObject, $subtype, $serializeEJSON, $deserializeEJSON, $createObjectId, $hash, $hexHash.

Gated spec_since="8.2" (10 smoke tests an 8.0 server fails): $concatArrays and $setUnion accumulators, $rankFusion (8.1), $sigmoid, $score, $scoreFusion, $minMaxScaler, $similarityCosine, $similarityDotProduct, $similarityEuclidean (8.2).

Tree rows only (4): $$NOW, $$CLUSTER_TIME, $$CURRENT, $$REMOVE already had smoke tests.

Each smoke test is a capability probe built on assertCommandSupported. The setFeatureCompatibilityVersion smoke test now sets the server's own current FCV, so it works on any server version.

Dev environment

  • dev/compose.yaml: new mongo-standalone-8.0 (mongo:8.0.38, port 27020) and mongo-standalone-8.3 (mongo:8.3.13, port 27019) services. Neither is auto-discovered or in the CI matrix; CI stays on 8.2.4.
  • Dev compose ports are published on 127.0.0.1 only.

Not added, already covered: $setUnion, the $first/$last array-element forms, $accumulator.

Follow-ups: non-operator features the tree does not track yet (schema validation, time series, pipeline updates, read preference/concern, sessions, BSON ordering and limits, Stable API, window bounds, change stream images, cluster parameters, security, wire protocol).

Testing

Server Run Result
mongo:8.2.4 full suite, default spec 53164 passed, 0 failed
mongo:8.0.38 -m smoke --spec-version 8.0 435 passed, 21 deselected by spec
mongo:8.2.4 -m smoke --spec-version 8.2 445 passed, 11 deselected by spec
mongo:8.3.13 -m smoke --spec-version 8.3 456 passed
  • A spec gate on a non-smoke test stops collection with a usage error.
  • black, isort, flake8, mypy and pytest -m unit pass.
  • Not run here: the replica-set + mongot target against 8.0 or 8.3.

@eerxuan
eerxuan requested a review from a team as a code owner November 5, 2026 00:13
@eerxuan
eerxuan force-pushed the add-missing-features-8.3 branch from efcc366 to fcf32ab Compare November 5, 2026 00:42
@eerxuan eerxuan changed the title Add missing features supported in 8.3 Add missing features supported in 8.2 Nov 5, 2026
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related documentation Improvements or additions to documentation enhancement New feature or request labels Nov 5, 2026
@documentdb-triage-tool

Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: compatibility test, documentation, enhancement
Project fields suggested: Component test-coverage · Priority P2 · Effort XL · Status Needs Review
Confidence: 0.85 (mixed)

Reasoning

component from path globs (test-coverage, docs); effort from diff stats (442+2 LOC, 28 files); LLM: Adds new smoke tests and feature-tree rows for 15+ operators supported in MongoDB 8.2, expanding compatibility test coverage across multiple operator categories.

If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

- Add a --spec-version option (8.0, 8.2, 8.3; default 8.2). It filters
  smoke tests only; out-of-scope smoke tests are deselected and listed in
  the .deselected.json sidecar.
- requires(spec_since=..., spec_until=...) gates are allowed only on
  smoke-marked tests. A spec gate on a non-smoke test stops collection with
  a usage error that lists the tests.
- Spec gates work at folder (spec_gate_folder in conftest.py), file
  (pytestmark), class and test level. All requires markers on a test now
  combine; the closest wins on the same key.
- The marker validator rejects a spec gate that does not name a known
  version. The JSON report records the spec version and server versions.
- Regular tests always run and expect the MongoDB 8.2.4 answer.
- Add smoke tests and feature-tree rows for 8.2 operators (window, score,
  scoreFusion, vector similarity, system variables, projection $meta) and
  for 8.3 operators (folder-gated with spec_since="8.3"). Gate the smoke
  tests an 8.0 server fails with spec_since="8.2".
- The setFeatureCompatibilityVersion smoke test sets the server's own
  current FCV, so it passes on any server version.
- dev/compose.yaml adds mongo:8.0.38 and mongo:8.3.13 standalone servers
  with no CI target; dev ports are published on 127.0.0.1 only.
- Update README and docs.

Signed-off-by: Yunxuan Shi <yunxuan@amazon.com>
@eerxuan
eerxuan force-pushed the add-missing-features-8.3 branch from f83a032 to f47f4c2 Compare November 19, 2026 20:21
@eerxuan eerxuan changed the title Add missing features supported in 8.2 Add missing features supported in 8.2 and 8.3, add spec_since option for smoke test mode Nov 19, 2026
@eerxuan
eerxuan merged commit 5afdfee into documentdb:main Nov 20, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility test Compatibility test related documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants