Skip to content

Add tests for missing URI options #1801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions source/uri-options/tests/connection-options.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions source/uri-options/tests/connection-options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,74 @@ tests:
hosts: ~
auth: ~
options: ~
-
description: "timeoutMS with large value"
uri: "mongodb://example.com/?timeoutMS=100000"
valid: true
warning: false
hosts: ~
auth: ~
options:
timeoutMS: 100000
-
description: "timeoutMS with SRV URI"
uri: "mongodb+srv://test1.test.build.10gen.cc/?timeoutMS=5000"
valid: true
warning: false
hosts: ~
auth: ~
options:
timeoutMS: 5000
-
description: "Valid appname is parsed correctly"
uri: "mongodb://example.com/?appname=MyApplication"
valid: true
warning: false
hosts: ~
auth: ~
options:
appname: "MyApplication"
-
description: "Empty appname is parsed correctly"
uri: "mongodb://example.com/?appname="
valid: true
warning: false
hosts: ~
auth: ~
options:
appname: ""
-
description: "retryReads=true is parsed correctly"
uri: "mongodb://example.com/?retryReads=true"
valid: true
warning: false
hosts: ~
auth: ~
options:
retryReads: true
-
description: "retryReads=false is parsed correctly"
uri: "mongodb://example.com/?retryReads=false"
valid: true
warning: false
hosts: ~
auth: ~
options:
retryReads: false
-
description: "Invalid retryReads causes a warning"
uri: "mongodb://example.com/?retryReads=invalid"
valid: true
warning: true
hosts: ~
auth: ~
options: ~
-
description: "retryWrites=false is parsed correctly"
uri: "mongodb://example.com/?retryWrites=false"
valid: true
warning: false
hosts: ~
auth: ~
options:
retryWrites: false
38 changes: 38 additions & 0 deletions source/uri-options/tests/connection-pool-options.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions source/uri-options/tests/connection-pool-options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,36 @@ tests:
hosts: ~
auth: ~
options: ~
-
description: "waitQueueTimeoutMS with valid value"
uri: "mongodb://example.com/?waitQueueTimeoutMS=1000"
valid: true
warning: false
hosts: ~
auth: ~
options:
waitQueueTimeoutMS: 1000
-
description: "waitQueueTimeoutMS with zero value causes a warning"
uri: "mongodb://example.com/?waitQueueTimeoutMS=0"
valid: true
warning: true
hosts: ~
auth: ~
options: ~
-
description: "waitQueueTimeoutMS with negative value causes a warning"
uri: "mongodb://example.com/?waitQueueTimeoutMS=-1"
valid: true
warning: true
hosts: ~
auth: ~
options: ~
-
description: "waitQueueTimeoutMS with non-integer value causes a warning"
uri: "mongodb://example.com/?waitQueueTimeoutMS=invalid"
valid: true
warning: true
hosts: ~
auth: ~
options: ~
64 changes: 64 additions & 0 deletions source/uri-options/tests/read-preference-options.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions source/uri-options/tests/read-preference-options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,57 @@ tests:
hosts: ~
auth: ~
options: ~
-
description: "readPreference=primary"
uri: "mongodb://example.com/?readPreference=primary"
valid: true
warning: false
hosts: ~
auth: ~
options:
readPreference: "primary"
-
description: "readPreference=secondary"
uri: "mongodb://example.com/?readPreference=secondary"
valid: true
warning: false
hosts: ~
auth: ~
options:
readPreference: "secondary"
-
description: "readPreference=secondaryPreferred"
uri: "mongodb://example.com/?readPreference=secondaryPreferred"
valid: true
warning: false
hosts: ~
auth: ~
options:
readPreference: "secondaryPreferred"
-
description: "readPreference=nearest"
uri: "mongodb://example.com/?readPreference=nearest"
valid: true
warning: false
hosts: ~
auth: ~
options:
readPreference: "nearest"
-
description: "Invalid readPreference does not cause a warning"
uri: "mongodb://example.com/?readPreference=invalid"
valid: true
warning: false
hosts: ~
auth: ~
options:
readPreference: "invalid"
-
description: "readPreferenceTags with primary causes a warning"
uri: "mongodb://example.com/?readPreference=primary&readPreferenceTags=dc:ny"
valid: true
warning: true
hosts: ~
auth: ~
options: ~

Loading