Skip to content
Merged
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
38 changes: 34 additions & 4 deletions src/test/spec/json/uri-options/read-preference-options.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,44 @@
"maxStalenessSeconds": 120
}
},
{
"description": "Single readPreferenceTags is parsed as array of size one",
"uri": "mongodb://example.com/?readPreference=secondary&readPreferenceTags=dc:ny",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {
"readPreferenceTags": [
{
"dc": "ny"
}
]
}
},
{
"description": "Read preference tags are case sensitive",
"uri": "mongodb://example.com/?readPreference=secondary&readPreferenceTags=dc:NY",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {
"readPreferenceTags": [
{
"dc": "NY"
}
]
}
},
{
"description": "Invalid readPreferenceTags causes a warning",
"uri": "mongodb://example.com/?readPreferenceTags=invalid",
"valid": true,
"warning": true,
"hosts": null,
"auth": null,
"options": {}
"options": null
},
{
"description": "Non-numeric maxStalenessSeconds causes a warning",
Expand All @@ -37,7 +67,7 @@
"warning": true,
"hosts": null,
"auth": null,
"options": {}
"options": null
},
{
"description": "Too low maxStalenessSeconds causes a warning",
Expand All @@ -46,7 +76,7 @@
"warning": true,
"hosts": null,
"auth": null,
"options": {}
"options": null
}
]
}
}
31 changes: 26 additions & 5 deletions src/test/spec/json/uri-options/read-preference-options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,55 @@ tests:
options:
readPreference: "primaryPreferred"
readPreferenceTags:
-
-
dc: "ny"
rack: "1"
-
dc: "ny"
maxStalenessSeconds: 120
-
description: "Single readPreferenceTags is parsed as array of size one"
uri: "mongodb://example.com/?readPreference=secondary&readPreferenceTags=dc:ny"
valid: true
warning: false
hosts: ~
auth: ~
options:
readPreferenceTags:
-
dc: "ny"
-
description: "Read preference tags are case sensitive"
uri: "mongodb://example.com/?readPreference=secondary&readPreferenceTags=dc:NY"
valid: true
warning: false
hosts: ~
auth: ~
options:
readPreferenceTags:
-
dc: "NY"
-
description: "Invalid readPreferenceTags causes a warning"
uri: "mongodb://example.com/?readPreferenceTags=invalid"
valid: true
warning: true
hosts: ~
auth: ~
options: {}
options: ~
-
description: "Non-numeric maxStalenessSeconds causes a warning"
uri: "mongodb://example.com/?maxStalenessSeconds=invalid"
valid: true
warning: true
hosts: ~
auth: ~
options: {}
options: ~
-
description: "Too low maxStalenessSeconds causes a warning"
uri: "mongodb://example.com/?maxStalenessSeconds=-2"
valid: true
warning: true
hosts: ~
auth: ~
options: {}

options: ~