Skip to content

Commit 18365f8

Browse files
authored
CSHARP-5371: URI options spec tests specify may empty options (#1656)
1 parent c71ca1e commit 18365f8

19 files changed

+251
-218
lines changed

specifications/uri-options/tests/compression-options.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"warning": true,
3636
"hosts": null,
3737
"auth": null,
38-
"options": {}
38+
"options": null
3939
},
4040
{
4141
"description": "Too low zlibCompressionLevel causes a warning",
@@ -44,7 +44,7 @@
4444
"warning": true,
4545
"hosts": null,
4646
"auth": null,
47-
"options": {}
47+
"options": null
4848
},
4949
{
5050
"description": "Too high zlibCompressionLevel causes a warning",
@@ -53,7 +53,7 @@
5353
"warning": true,
5454
"hosts": null,
5555
"auth": null,
56-
"options": {}
56+
"options": null
5757
}
5858
]
5959
}

specifications/uri-options/tests/compression-options.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tests:
77
hosts: ~
88
auth: ~
99
options:
10-
compressors:
10+
compressors:
1111
- "zlib"
1212
zlibCompressionLevel: 9
1313
-
@@ -28,21 +28,21 @@ tests:
2828
warning: true
2929
hosts: ~
3030
auth: ~
31-
options: {}
31+
options: ~
3232
-
3333
description: "Too low zlibCompressionLevel causes a warning"
3434
uri: "mongodb://example.com/?compressors=zlib&zlibCompressionLevel=-2"
3535
valid: true
3636
warning: true
3737
hosts: ~
3838
auth: ~
39-
options: {}
39+
options: ~
4040
-
4141
description: "Too high zlibCompressionLevel causes a warning"
4242
uri: "mongodb://example.com/?compressors=zlib&zlibCompressionLevel=10"
4343
valid: true
4444
warning: true
4545
hosts: ~
4646
auth: ~
47-
options: {}
47+
options: ~
4848

specifications/uri-options/tests/concern-options.json

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,14 @@
3636
"w": "arbitraryButStillValid"
3737
}
3838
},
39-
{
40-
"description": "Too low w causes a warning",
41-
"uri": "mongodb://example.com/?w=-2",
42-
"valid": true,
43-
"warning": true,
44-
"hosts": null,
45-
"auth": null,
46-
"options": {}
47-
},
4839
{
4940
"description": "Non-numeric wTimeoutMS causes a warning",
5041
"uri": "mongodb://example.com/?wTimeoutMS=invalid",
5142
"valid": true,
5243
"warning": true,
5344
"hosts": null,
5445
"auth": null,
55-
"options": {}
46+
"options": null
5647
},
5748
{
5849
"description": "Too low wTimeoutMS causes a warning",
@@ -61,7 +52,7 @@
6152
"warning": true,
6253
"hosts": null,
6354
"auth": null,
64-
"options": {}
55+
"options": null
6556
},
6657
{
6758
"description": "Invalid journal causes a warning",
@@ -70,7 +61,7 @@
7061
"warning": true,
7162
"hosts": null,
7263
"auth": null,
73-
"options": {}
64+
"options": null
7465
}
7566
]
7667
}

specifications/uri-options/tests/concern-options.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ tests:
3636
warning: true
3737
hosts: ~
3838
auth: ~
39-
options: {}
39+
options: ~
4040
-
4141
description: "Too low wTimeoutMS causes a warning"
4242
uri: "mongodb://example.com/?wTimeoutMS=-2"
4343
valid: true
4444
warning: true
4545
hosts: ~
4646
auth: ~
47-
options: {}
47+
options: ~
4848
-
4949
description: "Invalid journal causes a warning"
5050
uri: "mongodb://example.com/?journal=invalid"
5151
valid: true
5252
warning: true
5353
hosts: ~
5454
auth: ~
55-
options: {}
55+
options: ~

specifications/uri-options/tests/connection-options.json

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"tests": [
33
{
44
"description": "Valid connection and timeout options are parsed correctly",
5-
"uri": "mongodb://example.com/?appname=URI-OPTIONS-SPEC-TEST&connectTimeoutMS=20000&heartbeatFrequencyMS=5000&localThresholdMS=3000&maxIdleTimeMS=50000&replicaSet=uri-options-spec&retryWrites=true&serverSelectionTimeoutMS=15000&socketTimeoutMS=7500",
5+
"uri": "mongodb://example.com/?appname=URI-OPTIONS-SPEC-TEST&connectTimeoutMS=20000&heartbeatFrequencyMS=5000&localThresholdMS=3000&maxIdleTimeMS=50000&replicaSet=uri-options-spec&retryWrites=true&serverSelectionTimeoutMS=15000&socketTimeoutMS=7500&timeoutMS=100",
66
"valid": true,
77
"warning": false,
88
"hosts": null,
@@ -16,7 +16,8 @@
1616
"replicaSet": "uri-options-spec",
1717
"retryWrites": true,
1818
"serverSelectionTimeoutMS": 15000,
19-
"socketTimeoutMS": 7500
19+
"socketTimeoutMS": 7500,
20+
"timeoutMS": 100
2021
}
2122
},
2223
{
@@ -26,7 +27,7 @@
2627
"warning": true,
2728
"hosts": null,
2829
"auth": null,
29-
"options": {}
30+
"options": null
3031
},
3132
{
3233
"description": "Too low connectTimeoutMS causes a warning",
@@ -35,7 +36,7 @@
3536
"warning": true,
3637
"hosts": null,
3738
"auth": null,
38-
"options": {}
39+
"options": null
3940
},
4041
{
4142
"description": "Non-numeric heartbeatFrequencyMS causes a warning",
@@ -44,7 +45,7 @@
4445
"warning": true,
4546
"hosts": null,
4647
"auth": null,
47-
"options": {}
48+
"options": null
4849
},
4950
{
5051
"description": "Too low heartbeatFrequencyMS causes a warning",
@@ -53,7 +54,7 @@
5354
"warning": true,
5455
"hosts": null,
5556
"auth": null,
56-
"options": {}
57+
"options": null
5758
},
5859
{
5960
"description": "Non-numeric localThresholdMS causes a warning",
@@ -62,7 +63,7 @@
6263
"warning": true,
6364
"hosts": null,
6465
"auth": null,
65-
"options": {}
66+
"options": null
6667
},
6768
{
6869
"description": "Too low localThresholdMS causes a warning",
@@ -71,7 +72,7 @@
7172
"warning": true,
7273
"hosts": null,
7374
"auth": null,
74-
"options": {}
75+
"options": null
7576
},
7677
{
7778
"description": "Invalid retryWrites causes a warning",
@@ -80,7 +81,7 @@
8081
"warning": true,
8182
"hosts": null,
8283
"auth": null,
83-
"options": {}
84+
"options": null
8485
},
8586
{
8687
"description": "Non-numeric serverSelectionTimeoutMS causes a warning",
@@ -89,7 +90,7 @@
8990
"warning": true,
9091
"hosts": null,
9192
"auth": null,
92-
"options": {}
93+
"options": null
9394
},
9495
{
9596
"description": "Too low serverSelectionTimeoutMS causes a warning",
@@ -98,7 +99,7 @@
9899
"warning": true,
99100
"hosts": null,
100101
"auth": null,
101-
"options": {}
102+
"options": null
102103
},
103104
{
104105
"description": "Non-numeric socketTimeoutMS causes a warning",
@@ -107,7 +108,7 @@
107108
"warning": true,
108109
"hosts": null,
109110
"auth": null,
110-
"options": {}
111+
"options": null
111112
},
112113
{
113114
"description": "Too low socketTimeoutMS causes a warning",
@@ -116,7 +117,7 @@
116117
"warning": true,
117118
"hosts": null,
118119
"auth": null,
119-
"options": {}
120+
"options": null
120121
},
121122
{
122123
"description": "directConnection=true",
@@ -136,7 +137,7 @@
136137
"warning": false,
137138
"hosts": null,
138139
"auth": null,
139-
"options": {}
140+
"options": null
140141
},
141142
{
142143
"description": "directConnection=false",
@@ -167,7 +168,7 @@
167168
"warning": true,
168169
"hosts": null,
169170
"auth": null,
170-
"options": {}
171+
"options": null
171172
},
172173
{
173174
"description": "loadBalanced=true",
@@ -210,7 +211,7 @@
210211
"warning": true,
211212
"hosts": null,
212213
"auth": null,
213-
"options": {}
214+
"options": null
214215
},
215216
{
216217
"description": "loadBalanced=true with multiple hosts causes an error",
@@ -219,7 +220,7 @@
219220
"warning": false,
220221
"hosts": null,
221222
"auth": null,
222-
"options": {}
223+
"options": null
223224
},
224225
{
225226
"description": "loadBalanced=true with directConnection=true causes an error",
@@ -228,7 +229,7 @@
228229
"warning": false,
229230
"hosts": null,
230231
"auth": null,
231-
"options": {}
232+
"options": null
232233
},
233234
{
234235
"description": "loadBalanced=true with replicaSet causes an error",
@@ -237,7 +238,36 @@
237238
"warning": false,
238239
"hosts": null,
239240
"auth": null,
240-
"options": {}
241+
"options": null
242+
},
243+
{
244+
"description": "timeoutMS=0",
245+
"uri": "mongodb://example.com/?timeoutMS=0",
246+
"valid": true,
247+
"warning": false,
248+
"hosts": null,
249+
"auth": null,
250+
"options": {
251+
"timeoutMS": 0
252+
}
253+
},
254+
{
255+
"description": "Non-numeric timeoutMS causes a warning",
256+
"uri": "mongodb://example.com/?timeoutMS=invalid",
257+
"valid": true,
258+
"warning": true,
259+
"hosts": null,
260+
"auth": null,
261+
"options": null
262+
},
263+
{
264+
"description": "Too low timeoutMS causes a warning",
265+
"uri": "mongodb://example.com/?timeoutMS=-2",
266+
"valid": true,
267+
"warning": true,
268+
"hosts": null,
269+
"auth": null,
270+
"options": null
241271
}
242272
]
243273
}

0 commit comments

Comments
 (0)