Skip to content

Add setQuerySettings tests#610

Merged
eerxuan merged 4 commits into
documentdb:mainfrom
alinaliBQ:setQuerySettings
Jun 25, 2026
Merged

Add setQuerySettings tests#610
eerxuan merged 4 commits into
documentdb:mainfrom
alinaliBQ:setQuerySettings

Conversation

@alinaliBQ

@alinaliBQ alinaliBQ commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

This change adds tests for the setQuerySettings command operator. In order to define the SettingsTestCase class, I renamed query-planning to query_planning. Reason is that hyphens aren't allowed in identifiers, so directories that need to be imported must use underscores instead.

Add command operator tests for setQuerySettings. Tests database setQuerySettings behavior, output collection, syntax, and expected errors.

Edit: replica_set is needed because query settings are not supported on standalone instances

@documentdb-triage-tool

Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: compatibility test, enhancement
Project fields suggested: Component test-coverage · Priority P2 · Effort XL · Status In Progress
Confidence: 0.85 (mixed)

Reasoning

component from path globs (test-coverage, test-framework); effort from diff stats (3863+1 LOC, 31 files); LLM: Adds new test coverage for the setQuerySettings command operator, covering behavior, output, syntax, and error cases — a functional test expansion across multiple test scenarios.

If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Jun 16, 2026
@alinaliBQ alinaliBQ marked this pull request as ready for review June 16, 2026 18:45
@alinaliBQ alinaliBQ requested a review from a team as a code owner June 16, 2026 18:45

@eerxuan eerxuan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please use @pytest.mark.no_parallel. The test cases can interact each other.
  2. Please rebase and use @pytest.mark.requires(...)

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
@alinaliBQ

Copy link
Copy Markdown
Contributor Author

@eerxuan I have added @pytest.mark.no_parallel and rebased to use @pytest.mark.requires(change_streams=True).

@eerxuan

eerxuan commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Why does this feature tests require change_streams? Can add a new capability if needed.

@alinaliBQ

Copy link
Copy Markdown
Contributor Author

change_streams is needed because query settings are not supported on standalone instances.

@eerxuan

eerxuan commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

So you need a capability called "query_settings" which only supported under replicaset target.

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
@alinaliBQ

Copy link
Copy Markdown
Contributor Author

Ok, I have looked and cluster_admin seems appropriate here, so I changed to use it instead of change_streams.

"cluster_admin": (
"cluster-wide admin features are available (query settings, default RW concern, "
"user write-block mode, query sampling)"

@eerxuan eerxuan merged commit 453f99c into documentdb:main Jun 25, 2026
14 checks passed
RyanGarfinkel pushed a commit to RyanGarfinkel/functional-tests that referenced this pull request Jun 29, 2026
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: RyanGarfinkel <113050972+RyanGarfinkel@users.noreply.github.com>
krishnasai453 pushed a commit to krishnasai453/functional-tests that referenced this pull request Jul 8, 2026
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
SarthakDalmia1 pushed a commit to SarthakDalmia1/functional-tests that referenced this pull request Jul 10, 2026
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Sarthak Dalmia <sadalmia@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility test Compatibility test related enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants