Add $tsIncrement compatibility tests#654
Conversation
750e3be to
9e59c4e
Compare
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
9e59c4e to
3e5f020
Compare
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage, test-framework); effort from diff stats (267+0 LOC, 4 files); LLM failed: Invalid response body while trying to fetch https://api.anthropic.com/v1/messages: Premature close If a label is wrong, remove it manually and ping |
There was a problem hiding this comment.
Pull request overview
This PR expands the compatibility test coverage for the $tsIncrement aggregation expression operator, ensuring it behaves correctly across null/missing inputs, boundary values, invalid types, nested field paths, and usage inside common pipeline contexts like $match/$expr and $group.
Changes:
- Added a dedicated
TS_INCREMENT_TYPE_ERRORerror code constant for$tsIncrementtype-mismatch failures. - Introduced comprehensive
$tsIncrementexpression tests (null/missing, boundaries, invalid BSON types, nested field access). - Added “wiring” tests to validate
$tsIncrementworks inside$matchwith$exprand inside$groupexpressions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| documentdb_tests/framework/error_codes.py | Adds a new server error code constant for $tsIncrement type mismatches. |
| documentdb_tests/compatibility/tests/core/operator/stages/match/test_match_with_expr.py | Adds a $tsIncrement usage test inside $match + $expr. |
| documentdb_tests/compatibility/tests/core/operator/stages/group/test_group_expr_operators.py | Adds $group coverage for $tsIncrement in _id and accumulator expressions. |
| documentdb_tests/compatibility/tests/core/operator/expressions/timestamp/tsIncrement/test_tsIncrement.py | Adds broad operator-focused test coverage for $tsIncrement behavior and error handling. |
| import pytest | ||
| from bson import Int64, Timestamp | ||
|
|
||
| from documentdb_tests.framework.assertions import ( |
What does this PR do?
This PR introduces additional compatibility tests for the $tsIncrement operator. This includes null/missing values, invalid types, boundary values, and nested field access. Wiring tests were also added to verify functionality in $match, $expr, and $group expressions. An additional error code,
TS_INCREMENT_TYPE_ERRORwas added specifically for MongoDB type mismatches.Why was this PR needed?
This PR Closes #210, which required adding additional test coverage to the $tsIncrement operator. Initially, this operator only had one smoke test, which tested basic functionality, not including null/missing input and invalid types.
What are the relevant issue numbers?
Closes #210
Does this PR meet the acceptance criteria?