Skip to content

Commit 0e53eab

Browse files
Add additional URI options tests
Co-Authored-By: [email protected] <[email protected]>
1 parent 9d0d3f0 commit 0e53eab

File tree

6 files changed

+303
-0
lines changed

6 files changed

+303
-0
lines changed

source/uri-options/tests/proxy-srv-options.json

Lines changed: 80 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
tests:
2+
- description: "proxyHost with SRV URI"
3+
uri: "mongodb+srv://test1.test.build.10gen.cc/?proxyHost=proxy.example.com"
4+
valid: true
5+
warning: false
6+
hosts: ~
7+
auth: ~
8+
options:
9+
proxyHost: "proxy.example.com"
10+
11+
- description: "proxyPort with SRV URI"
12+
uri: "mongodb+srv://test1.test.build.10gen.cc/?proxyPort=1080"
13+
valid: true
14+
warning: false
15+
hosts: ~
16+
auth: ~
17+
options:
18+
proxyPort: 1080
19+
20+
- description: "proxyUsername with SRV URI"
21+
uri: "mongodb+srv://test1.test.build.10gen.cc/?proxyUsername=user"
22+
valid: true
23+
warning: false
24+
hosts: ~
25+
auth: ~
26+
options:
27+
proxyUsername: "user"
28+
29+
- description: "proxyPassword with SRV URI"
30+
uri: "mongodb+srv://test1.test.build.10gen.cc/?proxyPassword=password"
31+
valid: true
32+
warning: false
33+
hosts: ~
34+
auth: ~
35+
options:
36+
proxyPassword: "password"
37+
38+
- description: "invalid proxyPort with SRV URI causes a warning"
39+
uri: "mongodb+srv://test1.test.build.10gen.cc/?proxyPort=invalid"
40+
valid: true
41+
warning: true
42+
hosts: ~
43+
auth: ~
44+
options: ~
45+
46+
- description: "negative proxyPort with SRV URI causes a warning"
47+
uri: "mongodb+srv://test1.test.build.10gen.cc/?proxyPort=-1"
48+
valid: true
49+
warning: true
50+
hosts: ~
51+
auth: ~
52+
options: ~
53+
54+
- description: "complete proxy configuration with SRV URI"
55+
uri: "mongodb+srv://test1.test.build.10gen.cc/?proxyHost=proxy.example.com&proxyPort=1080&proxyUsername=user&proxyPassword=password"
56+
valid: true
57+
warning: false
58+
hosts: ~
59+
auth: ~
60+
options:
61+
proxyHost: "proxy.example.com"
62+
proxyPort: 1080
63+
proxyUsername: "user"
64+
proxyPassword: "password"

source/uri-options/tests/serverMonitoring-options.json

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
tests:
2+
- description: "serverMonitoringMode=auto with SRV URI"
3+
uri: "mongodb+srv://test1.test.build.10gen.cc/?serverMonitoringMode=auto"
4+
valid: true
5+
warning: false
6+
hosts: ~
7+
auth: ~
8+
options:
9+
serverMonitoringMode: "auto"
10+
11+
- description: "serverMonitoringMode=stream with SRV URI"
12+
uri: "mongodb+srv://test1.test.build.10gen.cc/?serverMonitoringMode=stream"
13+
valid: true
14+
warning: false
15+
hosts: ~
16+
auth: ~
17+
options:
18+
serverMonitoringMode: "stream"
19+
20+
- description: "serverMonitoringMode=poll with SRV URI"
21+
uri: "mongodb+srv://test1.test.build.10gen.cc/?serverMonitoringMode=poll"
22+
valid: true
23+
warning: false
24+
hosts: ~
25+
auth: ~
26+
options:
27+
serverMonitoringMode: "poll"
28+
29+
- description: "invalid serverMonitoringMode with SRV URI"
30+
uri: "mongodb+srv://test1.test.build.10gen.cc/?serverMonitoringMode=invalid"
31+
valid: true
32+
warning: true
33+
hosts: ~
34+
auth: ~
35+
options: ~

source/uri-options/tests/timeout-options.json

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
tests:
2+
- description: "timeoutMS with valid integer value"
3+
uri: "mongodb://example.com/?timeoutMS=5000"
4+
valid: true
5+
warning: false
6+
hosts: ~
7+
auth: ~
8+
options:
9+
timeoutMS: 5000
10+
11+
- description: "timeoutMS with zero value"
12+
uri: "mongodb://example.com/?timeoutMS=0"
13+
valid: true
14+
warning: false
15+
hosts: ~
16+
auth: ~
17+
options:
18+
timeoutMS: 0
19+
20+
- description: "timeoutMS with negative value causes a warning"
21+
uri: "mongodb://example.com/?timeoutMS=-1000"
22+
valid: true
23+
warning: true
24+
hosts: ~
25+
auth: ~
26+
options: ~
27+
28+
- description: "timeoutMS with non-integer value causes a warning"
29+
uri: "mongodb://example.com/?timeoutMS=invalid"
30+
valid: true
31+
warning: true
32+
hosts: ~
33+
auth: ~
34+
options: ~

0 commit comments

Comments
 (0)