Add tests for slice, sort, merge, out, text, bit#627
Conversation
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage); effort from diff stats (876+0 LOC, 7 files); LLM: Adds new compatibility test cases for multiple operators/stages (slice, sort, merge, out, text, bit) as part of a tracked issue, expanding test coverage across several areas. If a label is wrong, remove it manually and ping |
4d3e11b to
72927cf
Compare
There was a problem hiding this comment.
Pull request overview
Adds new compatibility test coverage for Issue #618 by extending the functional test suite across several update operators/modifiers and aggregation/query features. These tests aim to lock in MongoDB parity for modifier interaction/order ($slice/$sort/$position), command-path behavior for $bit, $out/$merge stage composition, and $text + textScore placement/validation rules.
Changes:
- Add new
$pushmodifier interaction tests covering$sort+$position, and$slicecombined with$sort/$position. - Add
$bittests across additional command paths (findAndModify and a bulk-write scenario). - Add new aggregation stage composition tests for
$out(bucketing/window family) and$merge(integration with common pipeline stages), plus richer$textquery tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| documentdb_tests/compatibility/tests/core/operator/update/modifiers/sort/test_update_sort_with_position.py | New parametrized tests for $push $sort behavior when combined with $position. |
| documentdb_tests/compatibility/tests/core/operator/update/modifiers/slice/test_update_slice_combined_modifiers.py | New parametrized tests validating documented modifier-processing order for $slice with $sort/$position. |
| documentdb_tests/compatibility/tests/core/operator/update/bitwise/bit/test_bit_command_paths.py | Adds $bit coverage via findAndModify and a bulk-write path. |
| documentdb_tests/compatibility/tests/core/operator/stages/test_stages_combination_out_bucketing.py | Adds $out composition coverage with bucketing and window stages, plus $bucketAuto + $out. |
| documentdb_tests/compatibility/tests/core/operator/stages/test_stages_combination_merge.py | Adds $merge pipeline-integration tests mirroring existing composition patterns. |
| documentdb_tests/compatibility/tests/core/operator/query/text/test_text_meta_score_placement.py | Adds tests for $meta: "textScore" placement rules and metadata-not-available validation. |
| documentdb_tests/compatibility/tests/core/operator/query/text/test_text_compound_predicates.py | Adds $text compound predicate intersection tests (implicit/explicit $and, range, $in, $ne, etc.). |
| def test_bit_bulk_write_update_one(collection): | ||
| """$bit applied through a batched bulk write produces the bitwise result.""" | ||
| collection.insert_one({"_id": 1, "v": 13}) | ||
| collection.bulk_write([UpdateOne({"_id": 1}, {"$bit": {"v": {"and": 10}}})]) |
| ] | ||
|
|
||
|
|
||
| def run_find_and_modify(collection, test: BitFindAndModifyTest): |
| pytestmark = pytest.mark.find | ||
|
|
||
|
|
||
| def _create_text_index(collection): |
Signed-off-by: SarthakDalmia1 <sarthak.dalmia1@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cffb5410-c08b-4dad-bf0d-7f84c758fa37 Signed-off-by: SarthakDalmia1 <sarthak.dalmia1@gmail.com>
…go engine_xfail markers Remove the engine_xfail(engine="pgmongo") markers from the $out-after-$bucketAuto and $slice-0 combined-modifier cases. pgmongo is not a configured engine (only mongodb is wired up in dev/compose.yaml), so these markers are inert no-ops; per the DocumentDB test conventions, engine divergences are tracked in the DocumentDB repo rather than via engine_xfail here. The tests continue to assert native MongoDB (oracle) behavior. Docstrings updated to drop the "tracked engine divergence" framing accordingly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cffb5410-c08b-4dad-bf0d-7f84c758fa37 Signed-off-by: SarthakDalmia1 <sarthak.dalmia1@gmail.com>
69768a4 to
cb78ae3
Compare
This is part of the #618 issue