Add $abortTransaction command tests#600
Conversation
|
Once #560 is merged, I can rebase this PR if there are conflicts. |
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage, test-framework, ci); effort from diff stats (1817+0 LOC, 17 files); LLM: Adds new test coverage for the $abortTransaction command operator, covering behavior, output collection, syntax, and error cases — a meaningful functional addition to the test suite. If a label is wrong, remove it manually and ping |
8780e5b to
8ecb689
Compare
|
Rebased PR to get fix from #606 |
ff242bf to
91bd213
Compare
| Returns: | ||
| Result dict (abort response or readback) or Exception. | ||
| """ | ||
| from documentdb_tests.compatibility.tests.core.sessions.commands.utils.session_test_case import ( # noqa: E501 |
There was a problem hiding this comment.
Function is moved to SessionTestCase file and import is removed
| return e | ||
|
|
||
|
|
||
| def execute_session_command(collection, test_case) -> Any: |
There was a problem hiding this comment.
execute_session_command and execute_abort_session_command are ~95% duplicated. Recommend a single _execute_session_command(collection, test_case, *, abort: bool) with the divergent step
parameterized
There was a problem hiding this comment.
yea good point, merged these 2 functions and moved _execute_session_command to SessionTestCase file.
| ] | ||
|
|
||
|
|
||
| @pytest.mark.admin |
There was a problem hiding this comment.
@pytest.mark.admin allows users to filter with pytest -m admin to run only admin command tests. This tag indicates the test is an admin command test
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
d14d969 to
730e237
Compare
alinaliBQ
left a comment
There was a problem hiding this comment.
addressed comments
| return e | ||
|
|
||
|
|
||
| def execute_session_command(collection, test_case) -> Any: |
There was a problem hiding this comment.
yea good point, merged these 2 functions and moved _execute_session_command to SessionTestCase file.
| Returns: | ||
| Result dict (abort response or readback) or Exception. | ||
| """ | ||
| from documentdb_tests.compatibility.tests.core.sessions.commands.utils.session_test_case import ( # noqa: E501 |
There was a problem hiding this comment.
Function is moved to SessionTestCase file and import is removed
| ] | ||
|
|
||
|
|
||
| @pytest.mark.admin |
There was a problem hiding this comment.
@pytest.mark.admin allows users to filter with pytest -m admin to run only admin command tests. This tag indicates the test is an admin command test
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
e68d7bd to
717dab5
Compare
This change adds tests for the $abortTransaction command operator. Adds
execute_session_commandandexecute_abort_session_commandtodocumentdb_tests/framework/executor.py.Add command operator tests for $abortTransaction. Tests database $abortTransaction behavior, output collection, syntax, and expected errors.