Skip to content

Commit 5ef2244

Browse files
Cont. working on dep
1 parent cba91b7 commit 5ef2244

File tree

8 files changed

+36
-12
lines changed

8 files changed

+36
-12
lines changed

mongo/read_write_concern_spec_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
)
2525

2626
const (
27-
readWriteConcernTestsDir = "../testdata/read-write-concern"
27+
readWriteConcernTestsDir = "../testdata/source/read-write-concern/tests/"
2828
connstringTestsDir = "connection-string"
2929
documentTestsDir = "document"
3030
)

x/mongo/driver/auth/auth_spec_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type testContainer struct {
3838
}
3939

4040
// Note a test supporting the deprecated gssapiServiceName property was removed from data/auth/auth_tests.json
41-
const authTestsDir = "../../../../testdata/source/auth/tests/legacy"
41+
const authTestsDir = "../../../../testdata/source/auth/tests/legacy/"
4242

4343
func runTestsInFile(t *testing.T, dirname string, filename string) {
4444
filepath := path.Join(dirname, filename)

x/mongo/driver/connstring/connstring_spec_test.go

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ type testContainer struct {
4747
Tests []testCase
4848
}
4949

50-
const connstringTestsDir = "../../../../testdata/source/connection-string/"
51-
const urioptionsTestDir = "../../../../testdata/source/uri-options/"
50+
const connstringTestsDir = "../../../../testdata/source/connection-string/tests/"
51+
const urioptionsTestDir = "../../../../testdata/source/uri-options/tests/"
5252

5353
func (h *host) toString() string {
5454
switch h.Type {
@@ -108,8 +108,26 @@ var skipKeywords = []string{
108108
"tlsDisableCertificateRevocationCheck",
109109
"serverSelectionTryOnce",
110110

111-
// GODRIVER-2348: the wtimeoutMS write concern option is not supported.
111+
// These tests violate current Go Driver behavior
112+
"Empty integer option values are ignored", // PEC-1545
113+
"Empty boolean option value are ignored", // SPEC-1545
114+
"Comma in a key value pair causes a warning", // DRIVERS-2915
115+
116+
// Unclear ~ possible bugs
117+
"maxConnecting=0 causes a warning", // DRIVERS-1943
118+
119+
// TODO(GODRIVER-2348): the wtimeoutMS write concern option is not supported.
112120
"wTimeoutMS",
121+
122+
// TODO(GODRIVER-2991): make delimiting slash between hosts and options
123+
// optional.
124+
"Missing delimiting slash between hosts and options",
125+
126+
// TODO(GODRIVER-2183): Socks5 Proxy Support
127+
"proxyPort",
128+
"proxyHost",
129+
"proxyPassword",
130+
"proxyUsername",
113131
}
114132

115133
func runTest(t *testing.T, test testCase, warningsError bool) {
@@ -163,7 +181,7 @@ func runTest(t *testing.T, test testCase, warningsError bool) {
163181
// for options that are present.
164182
var ok bool
165183

166-
_, ok = test.Options["maxpoolsize"]
184+
_, ok = test.Options["maxPoolSize"]
167185
require.Equal(t, ok, cs.MaxPoolSizeSet)
168186
}
169187

@@ -220,13 +238,13 @@ func verifyConnStringOptions(t *testing.T, cs *connstring.ConnString, options ma
220238
require.Equal(t, value, float64(cs.MaxConnIdleTime/time.Millisecond))
221239
case "maxpoolsize":
222240
require.True(t, cs.MaxPoolSizeSet)
223-
require.Equal(t, value, cs.MaxPoolSize)
241+
require.Equal(t, value, float64(cs.MaxPoolSize))
224242
case "maxstalenessseconds":
225243
require.True(t, cs.MaxStalenessSet)
226244
require.Equal(t, value, float64(cs.MaxStaleness/time.Second))
227245
case "minpoolsize":
228246
require.True(t, cs.MinPoolSizeSet)
229-
require.Equal(t, value, int64(cs.MinPoolSize))
247+
require.Equal(t, value, float64(cs.MinPoolSize))
230248
case "readpreference":
231249
require.Equal(t, value, cs.ReadPreference)
232250
case "readpreferencetags":
@@ -285,7 +303,12 @@ func verifyConnStringOptions(t *testing.T, cs *connstring.ConnString, options ma
285303
require.Equal(t, value, cs.SSLDisableOCSPEndpointCheck)
286304
case "servermonitoringmode":
287305
require.Equal(t, value, cs.ServerMonitoringMode)
306+
case "timeoutms":
307+
require.Equal(t, value, float64(cs.Timeout/time.Millisecond))
308+
case "maxconnecting":
309+
require.Equal(t, value, float64(cs.MaxConnecting))
288310
default:
311+
fmt.Println(key)
289312
opt, ok := cs.UnknownOptions[key]
290313
require.True(t, ok)
291314
require.Contains(t, opt, fmt.Sprint(value))

x/mongo/driver/mongocrypt/mongocrypt_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"go.mongodb.org/mongo-driver/v2/x/mongo/driver/mongocrypt/options"
2424
)
2525

26+
// TODO: create new directory for mongocrypt
2627
const resourcesDir = "../../../../testdata/mongocrypt"
2728

2829
func noerr(t *testing.T, err error) {

x/mongo/driver/topology/CMAP_spec_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ type testInfo struct {
114114
sync.Mutex
115115
}
116116

117-
const cmapTestDir = "../../../../testdata/connection-monitoring-and-pooling/"
117+
const cmapTestDir = "../../../../testdata/source/connection-monitoring-and-pooling/tests/cmap-format/"
118118

119119
func TestCMAPSpec(t *testing.T) {
120120
for _, testFileName := range spectest.FindJSONFilesInDir(t, cmapTestDir) {

x/mongo/driver/topology/sdam_spec_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func serverClosed(e *event.ServerClosedEvent) {
203203
lock.Unlock()
204204
}
205205

206-
const testsDir string = "../../../../testdata/server-discovery-and-monitoring/"
206+
const testsDir string = "../../../../testdata/source/server-discovery-and-monitoring/tests/"
207207

208208
var publishedEvents []interface{}
209209
var lock sync.Mutex

x/mongo/driver/topology/server_rtt_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestServerSelectionRTTSpec(t *testing.T) {
2727
NewAvgRtt float64 `json:"new_avg_rtt"`
2828
}
2929

30-
const testsDir string = "../../../../testdata/server-selection/rtt"
30+
const testsDir string = "../../../../testdata/source/server-selection/tests/rtt/"
3131

3232
for _, file := range spectest.FindJSONFilesInDir(t, testsDir) {
3333
func(t *testing.T, filename string) {

x/mongo/driver/topology/topology_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ type inWindowTestCase struct {
808808
// can't be effectively accomplished just with server descriptions like most other server selection
809809
// algorithms.
810810
func TestServerSelectionSpecInWindow(t *testing.T) {
811-
const testsDir = "../../../../testdata/server-selection/in_window"
811+
const testsDir = "../../../../testdata/source/server-selection/tests/in_window/"
812812

813813
files := spectest.FindJSONFilesInDir(t, testsDir)
814814

0 commit comments

Comments
 (0)