Add Accumulator Coverage to TEST_COVERAGE.md#245
Open
alinaliBQ wants to merge 2 commits into
Open
Conversation
Signed-off-by: Alina (Xi) Li <[email protected]>
Signed-off-by: Alina (Xi) Li <[email protected]>
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent 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 |
eerxuan
reviewed
May 27, 2026
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 |
eerxuan
reviewed
May 28, 2026
Collaborator
eerxuan
left a comment
There was a problem hiding this comment.
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Accumulator Test Coverage section to
TEST_COVERAGE.md, based on @eerxuan's comment: #214 (review)