Skip to content

Add Accumulator Coverage to TEST_COVERAGE.md#245

Open
alinaliBQ wants to merge 2 commits into
documentdb:mainfrom
alinaliBQ:accumulator-coverage
Open

Add Accumulator Coverage to TEST_COVERAGE.md#245
alinaliBQ wants to merge 2 commits into
documentdb:mainfrom
alinaliBQ:accumulator-coverage

Conversation

@alinaliBQ
Copy link
Copy Markdown
Contributor

Add Accumulator Test Coverage section to TEST_COVERAGE.md, based on @eerxuan's comment: #214 (review)

alinaliBQ added 2 commits May 27, 2026 12:52
Signed-off-by: Alina (Xi) Li <[email protected]>
Signed-off-by: Alina (Xi) Li <[email protected]>
@alinaliBQ alinaliBQ marked this pull request as ready for review May 27, 2026 21:13
@alinaliBQ alinaliBQ requested a review from a team as a code owner May 27, 2026 21:13
@documentdb-triage-tool documentdb-triage-tool Bot added documentation Improvements or additions to documentation enhancement New feature or request labels May 27, 2026
@documentdb-triage-tool
Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: documentation, enhancement
Project fields suggested: Component docs · Priority P3 · Effort S · Status Needs Review
Confidence: 0.90 (mixed)

Reasoning

component from path globs (docs); effort from diff stats (38+0 LOC, 1 files); LLM: Adds accumulator test coverage documentation to TEST_COVERAGE.md, a small documentation-only change.

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.

Comment on lines +420 to +422
### 18. Accumulator Coverage

**Rule**: Each accumulator must be tested for its expression error propagation, empty-group result, order dependence, and sibling-accumulator interactions. Tests live under
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add space before

Copy link
Copy Markdown
Collaborator

@eerxuan eerxuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Add a rule to TEST_COVERAGE.md for deprecated features that we don't want to test. Add Code data type and mapReduce, reIndex, function, $accumulator, $where, currentOp command, filemd5, collStats command.
  • Add a rule to list cross-cutting features:
### N. Foundational Spec Behaviors — Test Once

  **Rule**: Foundational spec behaviors (BSON type ordering, collation rules, GeoJSON parsing, etc.) are tested comprehensively in their dedicated directory and assumed consistent
  elsewhere. Consumers test only that they correctly delegate to the foundational behavior, not the foundational behavior itself.

  **Rationale**: We are compatibility tests, not comprehensive functional tests. Re-verifying foundational behavior across every consumer multiplies cases without adding signal — if the foundational behavior diverges, it shows
  in the foundational test, not in 50 downstream tests.

  **Examples**:
  - BSON type ordering → `tests/core/bson_types/`. Operators that use it (e.g. `$max`, `$gt`, `$sort`) get 1-2 wiring cases, not the full type-pair matrix.
  - Collation comparison → `tests/core/collation/`. Commands that accept `collation` test syntactic acceptance only. Sub-fields testing and semantic behavior is in 'tests/core/collation/'.
  - GeoJSON parsing and validation → `geospatial/specifiers/geometry/`. Geo operators that accept GeoJSON — test that the operator wires to the GeoJSON parser, not GeoJSON syntax tests.
  - Wire-protocol namespace validation → TBD. Commands that take a namespace as their first field — single representative case, not the full character matrix.
  - Field path validation  → Issue #118. 

  **Test naming convention**: wiring tests typically use the suffix `_bson_wiring.py` or `_<feature>_wiring.py`. Compare to `tests/core/operator/expressions/comparisons/gt/test_gt_bson_wiring.py` for the right
  shape — small, representative, explicitly named.

  **Carve-outs**: Per Rule 2's exception, parameters whose behavior genuinely varies per command (readConcern, writeConcern) are still tested exhaustively per command. The "test once" rule applies to behaviors that
   should be uniform across consumers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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