Skip to content

Commit b55af99

Browse files
authored
GODRIVER-2196 Do not expect both valid false and warning true in URI options tests (#776)
1 parent 34f18fc commit b55af99

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

data/uri-options/README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ The ``valid`` and ``warning`` fields are boolean in order to keep the tests
3838
flexible. We are not concerned with asserting the format of specific error or
3939
warnings messages strings.
4040

41+
Under normal circumstances, it should not be necessary to specify both
42+
``valid: false`` and ``warning: true``. Typically, a URI test case will either
43+
yield an error (e.g. options conflict) or a warning (e.g. invalid type or value
44+
for an option), but not both.
45+
4146
Use as unit tests
4247
=================
4348

data/uri-options/srv-options.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"description": "Non-SRV URI with custom srvServiceName",
1616
"uri": "mongodb://example.com/?srvServiceName=customname",
1717
"valid": false,
18-
"warning": true,
18+
"warning": false,
1919
"hosts": null,
2020
"auth": null,
2121
"options": {}
@@ -34,7 +34,7 @@
3434
{
3535
"description": "SRV URI with negative integer for srvMaxHosts",
3636
"uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=-1",
37-
"valid": false,
37+
"valid": true,
3838
"warning": true,
3939
"hosts": null,
4040
"auth": null,
@@ -43,7 +43,7 @@
4343
{
4444
"description": "SRV URI with invalid type for srvMaxHosts",
4545
"uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=foo",
46-
"valid": false,
46+
"valid": true,
4747
"warning": true,
4848
"hosts": null,
4949
"auth": null,
@@ -53,7 +53,7 @@
5353
"description": "Non-SRV URI with srvMaxHosts",
5454
"uri": "mongodb://example.com/?srvMaxHosts=2",
5555
"valid": false,
56-
"warning": true,
56+
"warning": false,
5757
"hosts": null,
5858
"auth": null,
5959
"options": {}
@@ -62,7 +62,7 @@
6262
"description": "SRV URI with positive srvMaxHosts and replicaSet",
6363
"uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2&replicaSet=foo",
6464
"valid": false,
65-
"warning": true,
65+
"warning": false,
6666
"hosts": null,
6767
"auth": null,
6868
"options": {}
@@ -71,7 +71,7 @@
7171
"description": "SRV URI with positive srvMaxHosts and loadBalanced=true",
7272
"uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2&loadBalanced=true",
7373
"valid": false,
74-
"warning": true,
74+
"warning": false,
7575
"hosts": null,
7676
"auth": null,
7777
"options": {}

data/uri-options/srv-options.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tests:
1010
- description: "Non-SRV URI with custom srvServiceName"
1111
uri: "mongodb://example.com/?srvServiceName=customname"
1212
valid: false
13-
warning: true
13+
warning: false
1414
hosts: ~
1515
auth: ~
1616
options: {}
@@ -24,39 +24,39 @@ tests:
2424
srvMaxHosts: 2
2525
- description: "SRV URI with negative integer for srvMaxHosts"
2626
uri: "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=-1"
27-
valid: false
27+
valid: true
2828
warning: true
2929
hosts: ~
3030
auth: ~
3131
options: {}
3232
- description: "SRV URI with invalid type for srvMaxHosts"
3333
uri: "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=foo"
34-
valid: false
34+
valid: true
3535
warning: true
3636
hosts: ~
3737
auth: ~
3838
options: {}
3939
- description: "Non-SRV URI with srvMaxHosts"
4040
uri: "mongodb://example.com/?srvMaxHosts=2"
4141
valid: false
42-
warning: true
42+
warning: false
4343
hosts: ~
4444
auth: ~
4545
options: {}
4646
# Note: Testing URI validation for srvMaxHosts conflicting with either
47-
# loadBalanced=true or # replicaSet specified via TXT records is covered by
47+
# loadBalanced=true or replicaSet specified via TXT records is covered by
4848
# the Initial DNS Seedlist Discovery test suite.
4949
- description: "SRV URI with positive srvMaxHosts and replicaSet"
5050
uri: "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2&replicaSet=foo"
5151
valid: false
52-
warning: true
52+
warning: false
5353
hosts: ~
5454
auth: ~
5555
options: {}
5656
- description: "SRV URI with positive srvMaxHosts and loadBalanced=true"
5757
uri: "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2&loadBalanced=true"
5858
valid: false
59-
warning: true
59+
warning: false
6060
hosts: ~
6161
auth: ~
6262
options: {}

0 commit comments

Comments
 (0)