Skip to content

Add $ping tests#616

Open
PatersonProjects wants to merge 1 commit into
documentdb:mainfrom
PatersonProjects:ping_tests
Open

Add $ping tests#616
PatersonProjects wants to merge 1 commit into
documentdb:mainfrom
PatersonProjects:ping_tests

Conversation

@PatersonProjects

Copy link
Copy Markdown
Contributor

This PR adds the tests for the $ping operator, following the format of other diagnostic tests

Ref: Issue #43, #444

Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
@PatersonProjects PatersonProjects requested a review from a team as a code owner June 16, 2026 22:50
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Jun 16, 2026
@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 M · Status Needs Review
Confidence: 0.78 (mixed)

Reasoning

component from path globs (test-coverage); effort from diff stats (214+0 LOC, 5 files); LLM: Adds new test cases for the $ping operator following existing diagnostic test patterns, a focused test-coverage addition with minimal LOC impact.

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.

@PatersonProjects PatersonProjects changed the title $Add ping tests Add $ping tests Jun 19, 2026
@@ -0,0 +1,64 @@
"""Tests for ping command core behavior.

Validates that ping succeeds on both admin and non-admin databases,

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.

For consistency with buildInfo and listCommands tests, consider adding a test for ping on a nonexistent database (e.g., collection.database.client["nonexistent_db"]["coll"]).

pytestmark = pytest.mark.admin


ERROR_TESTS: list[DiagnosticTestCase] = [

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.

For consistency with buildInfo and listCommands error tests, consider adding a test that {"aggregate": "test", "pipeline": [{"$ping": {}}], "cursor": {}} returns UNKNOWN_PIPELINE_STAGE_ERROR.

@fanyangv fanyangv mentioned this pull request Jun 25, 2026
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.

2 participants