Skip to content

Add query and write tests for findAndModify#619

Open
vic-tsang wants to merge 2 commits into
documentdb:mainfrom
vic-tsang:query/write/findAndModify/tests
Open

Add query and write tests for findAndModify#619
vic-tsang wants to merge 2 commits into
documentdb:mainfrom
vic-tsang:query/write/findAndModify/tests

Conversation

@vic-tsang

Copy link
Copy Markdown
Collaborator

This PR contains:

  • query and write tests for findAndModify

Note: I have omitted the following tests as it's already covered in the respective files:

  • Collation matching, sort, and remove behavior with findAndModify (5 cases)

    • Covered by: core/collation/command_level/operations/test_operations_find_and_modify.py (14 cases, superset)
  • Collation missing locale validation error (1 case)

    • Covered by: core/collation/command_level/operations/test_operations_find_and_modify.pyvalidation_missing_locale
  • findAndModify rejected on views

    • Covered by: core/collections/views/test_views_write_rejection.pyfind_and_modify_rejected
  • findAndModify update rejected on timeseries collections

    • Covered by: core/collections/timeseries/test_timeseries_updates.pyfind_and_modify_update_rejected
  • findAndModify update succeeds on capped collections

    • Covered by: core/collections/capped_collections/test_capped_collections_write_position.pytest_capped_find_and_modify_position (stronger
      test that also verifies position preservation)

Ref:

@vic-tsang vic-tsang requested a review from a team as a code owner June 17, 2026 17:38
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Jun 17, 2026
@documentdb-triage-tool

Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: compatibility test, 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); effort from diff stats (2854+0 LOC, 11 files); LLM: Adds new query and write compatibility tests for findAndModify, expanding test coverage under documentdb_tests/compatibility/tests/.

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.

@vic-tsang vic-tsang force-pushed the query/write/findAndModify/tests branch from 430998b to 7ea777c Compare June 18, 2026 16:58
Signed-off-by: Victor Tsang <vitsangp@amazon.com>
@vic-tsang vic-tsang force-pushed the query/write/findAndModify/tests branch from 7ea777c to 6559185 Compare June 18, 2026 16:59
@SaiPradyumn

Copy link
Copy Markdown

nit: test_findAndModify_update_modes.py contains two standalone tests that belong elsewhere:

  • test_findAndModify_upsert_unique_index_updates_instead_of_dup → belongs in test_findAndModify_upsert.py
  • test_findAndModify_upsert_array_filters_no_matching_array → also more of an upsert or arrayFilters edge case
    than "update modes"

Signed-off-by: Victor Tsang <vitsangp@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility test Compatibility test related enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants