Add $toString, $toBool, $toObjectId tests, and convert coverage#688
Add $toString, $toBool, $toObjectId tests, and convert coverage#688PatersonProjects wants to merge 14 commits into
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.
There was a problem hiding this comment.
I have added a new type utility to allow each test to also run with $convert. It works a little differently than it originally did, so that the tests can keep using ExpressionTestCase, rather than needing their own classes, but should have the same end functionality.
…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>
This PR adds the $toString, $toBool, and $toObjectId tests. It also adds the utilities needed to run the $convert versions of the tests in this PR and in PR #684. It was originally authored by @danielfrankcom
Ref: Issue #15, #331, #325, #330