Add $toString, $toBool, $toObjectId tests#688
Conversation
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
…-tests Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
…-tests Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
…-tests Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
…-tests Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage); effort from diff stats (3041+0 LOC, 25 files); LLM: Adds new compatibility test cases for $toString, $toBool, and $toObjectId operators, expanding test coverage across multiple related issues. If a label is wrong, remove it manually and ping |
danielfrankcom
left a comment
There was a problem hiding this comment.
Sorry I missed this before, but all of the $toX operators also need to be parameterized against $convert: {input, to} since they are an alias, and the $convert coverage relies on them existing.
See this comment.
| @pytest.mark.parametrize( | ||
| "test", pytest_params(TOSTRING_ARITY_TESTS + TOSTRING_INVALID_FIELD_PATH_TESTS) | ||
| ) | ||
| def test_toString_arity(collection, test: ExpressionTestCase): |
There was a problem hiding this comment.
I think every test in these files was originally parameterized over $convert too. These $toX operators are essentially an alias for $convert: {input, to}.
I missed this in the context of #684 but we should probably fix it there too as it's a significant coverage gap. The $convert tests rely on these split coverage.
| expected=None, | ||
| ), | ||
| ExpressionTestCase( | ||
| "composite_array_path", |
There was a problem hiding this comment.
I think we need an equivalent case for the other 2 operators, this seems to be the only one.
This PR adds the $toString, $toBool, and $toObjectId tests. It was originally authored by @danielfrankcom
Ref: Issue #15, #331, #325, #330