diff --git a/test/spec/connection-string/invalid-uris.json b/test/spec/connection-string/invalid-uris.json index e04da2b236f..a7accbd27d6 100644 --- a/test/spec/connection-string/invalid-uris.json +++ b/test/spec/connection-string/invalid-uris.json @@ -162,15 +162,6 @@ "auth": null, "options": null }, - { - "description": "Missing delimiting slash between hosts and options", - "uri": "mongodb://example.com?w=1", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, { "description": "Incomplete key value pair for option", "uri": "mongodb://example.com/?w", diff --git a/test/spec/connection-string/invalid-uris.yml b/test/spec/connection-string/invalid-uris.yml index 395e60eed95..79e110c79db 100644 --- a/test/spec/connection-string/invalid-uris.yml +++ b/test/spec/connection-string/invalid-uris.yml @@ -143,14 +143,6 @@ tests: hosts: ~ auth: ~ options: ~ - - - description: "Missing delimiting slash between hosts and options" - uri: "mongodb://example.com?w=1" - valid: false - warning: ~ - hosts: ~ - auth: ~ - options: ~ - description: "Incomplete key value pair for option" uri: "mongodb://example.com/?w" diff --git a/test/spec/connection-string/valid-options.json b/test/spec/connection-string/valid-options.json index 4c2bded9e72..01bc2264bba 100644 --- a/test/spec/connection-string/valid-options.json +++ b/test/spec/connection-string/valid-options.json @@ -20,6 +20,23 @@ "options": { "authmechanism": "MONGODB-CR" } + }, + { + "description": "Missing delimiting slash between hosts and options", + "uri": "mongodb://example.com?tls=true", + "valid": true, + "warning": false, + "hosts": [ + { + "type": "hostname", + "host": "example.com", + "port": null + } + ], + "auth": null, + "options": { + "tls": true + } } ] } diff --git a/test/spec/connection-string/valid-options.yml b/test/spec/connection-string/valid-options.yml index e1b94039c85..8cb0dea3a6e 100644 --- a/test/spec/connection-string/valid-options.yml +++ b/test/spec/connection-string/valid-options.yml @@ -15,3 +15,16 @@ tests: db: "admin" options: authmechanism: "MONGODB-CR" + - + description: "Missing delimiting slash between hosts and options" + uri: "mongodb://example.com?tls=true" + valid: true + warning: false + hosts: + - + type: "hostname" + host: "example.com" + port: ~ + auth: ~ + options: + tls: true diff --git a/test/spec/connection-string/valid-unix_socket-absolute.json b/test/spec/connection-string/valid-unix_socket-absolute.json index 5bb02476eb7..66491db13ba 100644 --- a/test/spec/connection-string/valid-unix_socket-absolute.json +++ b/test/spec/connection-string/valid-unix_socket-absolute.json @@ -30,6 +30,21 @@ "auth": null, "options": null }, + { + "description": "Unix domain socket (mixed case)", + "uri": "mongodb://%2Ftmp%2FMongoDB-27017.sock", + "valid": true, + "warning": false, + "hosts": [ + { + "type": "unix", + "host": "/tmp/MongoDB-27017.sock", + "port": null + } + ], + "auth": null, + "options": null + }, { "description": "Unix domain socket (absolute path with spaces in path)", "uri": "mongodb://%2Ftmp%2F %2Fmongodb-27017.sock", diff --git a/test/spec/connection-string/valid-unix_socket-absolute.yml b/test/spec/connection-string/valid-unix_socket-absolute.yml index 651e06fe399..cdfd00d3322 100644 --- a/test/spec/connection-string/valid-unix_socket-absolute.yml +++ b/test/spec/connection-string/valid-unix_socket-absolute.yml @@ -23,6 +23,18 @@ tests: port: ~ auth: ~ options: ~ + - + description: "Unix domain socket (mixed case)" + uri: "mongodb://%2Ftmp%2FMongoDB-27017.sock" + valid: true + warning: false + hosts: + - + type: "unix" + host: "/tmp/MongoDB-27017.sock" + port: ~ + auth: ~ + options: ~ - description: "Unix domain socket (absolute path with spaces in path)" uri: "mongodb://%2Ftmp%2F %2Fmongodb-27017.sock" diff --git a/test/spec/connection-string/valid-unix_socket-relative.json b/test/spec/connection-string/valid-unix_socket-relative.json index 2ce649ffc23..788720920ba 100644 --- a/test/spec/connection-string/valid-unix_socket-relative.json +++ b/test/spec/connection-string/valid-unix_socket-relative.json @@ -30,6 +30,21 @@ "auth": null, "options": null }, + { + "description": "Unix domain socket (mixed case)", + "uri": "mongodb://rel%2FMongoDB-27017.sock", + "valid": true, + "warning": false, + "hosts": [ + { + "type": "unix", + "host": "rel/MongoDB-27017.sock", + "port": null + } + ], + "auth": null, + "options": null + }, { "description": "Unix domain socket (relative path with spaces)", "uri": "mongodb://rel%2F %2Fmongodb-27017.sock", diff --git a/test/spec/connection-string/valid-unix_socket-relative.yml b/test/spec/connection-string/valid-unix_socket-relative.yml index 7164188b3b6..6d0d108205e 100644 --- a/test/spec/connection-string/valid-unix_socket-relative.yml +++ b/test/spec/connection-string/valid-unix_socket-relative.yml @@ -23,6 +23,18 @@ tests: port: ~ auth: ~ options: ~ + - + description: "Unix domain socket (mixed case)" + uri: "mongodb://rel%2FMongoDB-27017.sock" + valid: true + warning: false + hosts: + - + type: "unix" + host: "rel/MongoDB-27017.sock" + port: ~ + auth: ~ + options: ~ - description: "Unix domain socket (relative path with spaces)" uri: "mongodb://rel%2F %2Fmongodb-27017.sock" diff --git a/test/spec/connection-string/valid-warnings.json b/test/spec/connection-string/valid-warnings.json index 87f7248f21e..1eacbf8fcb1 100644 --- a/test/spec/connection-string/valid-warnings.json +++ b/test/spec/connection-string/valid-warnings.json @@ -63,6 +63,36 @@ "options": { "wtimeoutms": 10 } + }, + { + "description": "Empty integer option values are ignored", + "uri": "mongodb://localhost/?maxIdleTimeMS=", + "valid": true, + "warning": true, + "hosts": [ + { + "type": "hostname", + "host": "localhost", + "port": null + } + ], + "auth": null, + "options": null + }, + { + "description": "Empty boolean option value are ignored", + "uri": "mongodb://localhost/?journal=", + "valid": true, + "warning": true, + "hosts": [ + { + "type": "hostname", + "host": "localhost", + "port": null + } + ], + "auth": null, + "options": null } ] } diff --git a/test/spec/connection-string/valid-warnings.yml b/test/spec/connection-string/valid-warnings.yml index 4515c9a3bf3..ea9cc9d1ed7 100644 --- a/test/spec/connection-string/valid-warnings.yml +++ b/test/spec/connection-string/valid-warnings.yml @@ -49,3 +49,27 @@ tests: auth: ~ options: wtimeoutms: 10 + - + description: "Empty integer option values are ignored" + uri: "mongodb://localhost/?maxIdleTimeMS=" + valid: true + warning: true + hosts: + - + type: "hostname" + host: "localhost" + port: ~ + auth: ~ + options: ~ + - + description: "Empty boolean option value are ignored" + uri: "mongodb://localhost/?journal=" + valid: true + warning: true + hosts: + - + type: "hostname" + host: "localhost" + port: ~ + auth: ~ + options: ~ diff --git a/test/unit/connection_string.spec.test.ts b/test/unit/connection_string.spec.test.ts index 9a4625d3583..cc4fbb7c694 100644 --- a/test/unit/connection_string.spec.test.ts +++ b/test/unit/connection_string.spec.test.ts @@ -4,9 +4,6 @@ import { loadSpecTests } from '../spec'; import { executeUriValidationTest } from '../tools/uri_spec_runner'; const skipTests = [ - // TODO(NODE-3919): fix to match expected behavior - 'Missing delimiting slash between hosts and options', - // TODO(NODE-3914): Fix; note that wtimeoutms will be deprecated via DRIVERS-555 (NODE-3078) 'Deprecated (or unknown) options are ignored if replacement exists' ];