...

Text file src/go.mongodb.org/mongo-driver/testdata/uri-options/connection-options.yml

Documentation: go.mongodb.org/mongo-driver/testdata/uri-options

     1tests:
     2    -
     3        description: "Valid connection and timeout options are parsed correctly"
     4        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        valid: true
     6        warning: false
     7        hosts: ~
     8        auth: ~
     9        options:
    10            appname: "URI-OPTIONS-SPEC-TEST"
    11            connectTimeoutMS: 20000
    12            heartbeatFrequencyMS: 5000
    13            localThresholdMS: 3000
    14            maxIdleTimeMS: 50000
    15            replicaSet: "uri-options-spec"
    16            retryWrites: true
    17            serverSelectionTimeoutMS: 15000
    18            socketTimeoutMS: 7500
    19    -
    20        description: "Non-numeric connectTimeoutMS causes a warning"
    21        uri: "mongodb://example.com/?connectTimeoutMS=invalid"
    22        valid: true
    23        warning: true
    24        hosts: ~
    25        auth: ~
    26        options: {}
    27    -
    28        description: "Too low connectTimeoutMS causes a warning"
    29        uri: "mongodb://example.com/?connectTimeoutMS=-2"
    30        valid: true
    31        warning: true
    32        hosts: ~
    33        auth: ~
    34        options: {}
    35    -
    36        description: "Non-numeric heartbeatFrequencyMS causes a warning"
    37        uri: "mongodb://example.com/?heartbeatFrequencyMS=invalid"
    38        valid: true
    39        warning: true
    40        hosts: ~
    41        auth: ~
    42        options: {}
    43    -
    44        description: "Too low heartbeatFrequencyMS causes a warning"
    45        uri: "mongodb://example.com/?heartbeatFrequencyMS=-2"
    46        valid: true
    47        warning: true
    48        hosts: ~
    49        auth: ~
    50        options: {}
    51    -
    52        description: "Non-numeric localThresholdMS causes a warning"
    53        uri: "mongodb://example.com/?localThresholdMS=invalid"
    54        valid: true
    55        warning: true
    56        hosts: ~
    57        auth: ~
    58        options: {}
    59    -
    60        description: "Too low localThresholdMS causes a warning"
    61        uri: "mongodb://example.com/?localThresholdMS=-2"
    62        valid: true
    63        warning: true
    64        hosts: ~
    65        auth: ~
    66        options: {}
    67    - 
    68        description: "Invalid retryWrites causes a warning"
    69        uri: "mongodb://example.com/?retryWrites=invalid"
    70        valid: true
    71        warning: true
    72        hosts: ~
    73        auth: ~
    74        options: {}
    75    -
    76        description: "Non-numeric serverSelectionTimeoutMS causes a warning"
    77        uri: "mongodb://example.com/?serverSelectionTimeoutMS=invalid"
    78        valid: true
    79        warning: true
    80        hosts: ~
    81        auth: ~
    82        options: {}
    83    -
    84        description: "Too low serverSelectionTimeoutMS causes a warning"
    85        uri: "mongodb://example.com/?serverSelectionTimeoutMS=-2"
    86        valid: true
    87        warning: true
    88        hosts: ~
    89        auth: ~
    90        options: {}
    91    -
    92        description: "Non-numeric socketTimeoutMS causes a warning"
    93        uri: "mongodb://example.com/?socketTimeoutMS=invalid"
    94        valid: true
    95        warning: true
    96        hosts: ~
    97        auth: ~
    98        options: {}
    99    -
   100        description: "Too low socketTimeoutMS causes a warning"
   101        uri: "mongodb://example.com/?socketTimeoutMS=-2"
   102        valid: true
   103        warning: true
   104        hosts: ~
   105        auth: ~
   106        options: {}
   107    -
   108      description: directConnection=true
   109      uri: "mongodb://example.com/?directConnection=true"
   110      valid: true
   111      warning: false
   112      hosts: ~
   113      auth: ~
   114      options:
   115          directConnection: true
   116    -
   117      description: directConnection=true with multiple seeds
   118      uri: "mongodb://example1.com,example2.com/?directConnection=true"
   119      valid: false
   120      warning: false
   121      hosts: ~
   122      auth: ~
   123      options: {}
   124    -
   125      description: directConnection=false
   126      uri: "mongodb://example.com/?directConnection=false"
   127      valid: true
   128      warning: false
   129      hosts: ~
   130      auth: ~
   131      options:
   132          directConnection: false
   133    -
   134      description: directConnection=false with multiple seeds
   135      uri: "mongodb://example1.com,example2.com/?directConnection=false"
   136      valid: true
   137      warning: false
   138      hosts: ~
   139      auth: ~
   140      options:
   141          directConnection: false
   142    -
   143      description: Invalid directConnection value
   144      uri: "mongodb://example.com/?directConnection=invalid"
   145      valid: true
   146      warning: true
   147      hosts: ~
   148      auth: ~
   149      options: {}
   150    -
   151      description: loadBalanced=true
   152      uri: "mongodb://example.com/?loadBalanced=true"
   153      valid: true
   154      warning: false
   155      hosts: ~
   156      auth: ~
   157      options:
   158          loadBalanced: true
   159    -
   160      description: loadBalanced=true with directConnection=false
   161      uri: "mongodb://example.com/?loadBalanced=true&directConnection=false"
   162      valid: true
   163      warning: false
   164      hosts: ~
   165      auth: ~
   166      options:
   167          loadBalanced: true
   168          directConnection: false
   169    -
   170      description: loadBalanced=false
   171      uri: "mongodb://example.com/?loadBalanced=false"
   172      valid: true
   173      warning: false
   174      hosts: ~
   175      auth: ~
   176      options:
   177          loadBalanced: false
   178    -
   179      description: Invalid loadBalanced value
   180      uri: "mongodb://example.com/?loadBalanced=1"
   181      valid: true
   182      warning: true
   183      hosts: ~
   184      auth: ~
   185      options: {}
   186    -
   187      description: loadBalanced=true with multiple hosts causes an error
   188      uri: "mongodb://example1,example2/?loadBalanced=true"
   189      valid: false
   190      warning: false
   191      hosts: ~
   192      auth: ~
   193      options: {}
   194    -
   195      description: loadBalanced=true with directConnection=true causes an error
   196      uri: "mongodb://example.com/?loadBalanced=true&directConnection=true"
   197      valid: false
   198      warning: false
   199      hosts: ~
   200      auth: ~
   201      options: {}
   202    -
   203      description: loadBalanced=true with replicaSet causes an error
   204      uri: "mongodb://example.com/?loadBalanced=true&replicaSet=replset"
   205      valid: false
   206      warning: false
   207      hosts: ~
   208      auth: ~
   209      options: {}

View as plain text