...

Text file src/go.mongodb.org/mongo-driver/testdata/sessions/driver-sessions-server-support.json

Documentation: go.mongodb.org/mongo-driver/testdata/sessions

     1{
     2  "description": "driver-sessions-server-support",
     3  "schemaVersion": "1.0",
     4  "runOnRequirements": [
     5    {
     6      "minServerVersion": "3.6"
     7    }
     8  ],
     9  "createEntities": [
    10    {
    11      "client": {
    12        "id": "client0",
    13        "useMultipleMongoses": false,
    14        "observeEvents": [
    15          "commandStartedEvent"
    16        ]
    17      }
    18    },
    19    {
    20      "database": {
    21        "id": "database0",
    22        "client": "client0",
    23        "databaseName": "session-tests"
    24      }
    25    },
    26    {
    27      "collection": {
    28        "id": "collection0",
    29        "database": "database0",
    30        "collectionName": "test"
    31      }
    32    },
    33    {
    34      "session": {
    35        "id": "session0",
    36        "client": "client0"
    37      }
    38    }
    39  ],
    40  "initialData": [
    41    {
    42      "collectionName": "test",
    43      "databaseName": "session-tests",
    44      "documents": [
    45        {
    46          "_id": 1
    47        }
    48      ]
    49    }
    50  ],
    51  "tests": [
    52    {
    53      "description": "Server supports explicit sessions",
    54      "operations": [
    55        {
    56          "name": "assertSessionNotDirty",
    57          "object": "testRunner",
    58          "arguments": {
    59            "session": "session0"
    60          }
    61        },
    62        {
    63          "name": "insertOne",
    64          "object": "collection0",
    65          "arguments": {
    66            "session": "session0",
    67            "document": {
    68              "_id": 2
    69            }
    70          },
    71          "expectResult": {
    72            "$$unsetOrMatches": {
    73              "insertedId": {
    74                "$$unsetOrMatches": 2
    75              }
    76            }
    77          }
    78        },
    79        {
    80          "name": "assertSessionNotDirty",
    81          "object": "testRunner",
    82          "arguments": {
    83            "session": "session0"
    84          }
    85        },
    86        {
    87          "name": "endSession",
    88          "object": "session0"
    89        },
    90        {
    91          "name": "find",
    92          "object": "collection0",
    93          "arguments": {
    94            "filter": {
    95              "_id": -1
    96            }
    97          },
    98          "expectResult": []
    99        },
   100        {
   101          "name": "assertSameLsidOnLastTwoCommands",
   102          "object": "testRunner",
   103          "arguments": {
   104            "client": "client0"
   105          }
   106        }
   107      ],
   108      "expectEvents": [
   109        {
   110          "client": "client0",
   111          "events": [
   112            {
   113              "commandStartedEvent": {
   114                "command": {
   115                  "insert": "test",
   116                  "documents": [
   117                    {
   118                      "_id": 2
   119                    }
   120                  ],
   121                  "ordered": true,
   122                  "lsid": {
   123                    "$$sessionLsid": "session0"
   124                  }
   125                },
   126                "commandName": "insert",
   127                "databaseName": "session-tests"
   128              }
   129            },
   130            {
   131              "commandStartedEvent": {
   132                "command": {
   133                  "find": "test",
   134                  "filter": {
   135                    "_id": -1
   136                  },
   137                  "lsid": {
   138                    "$$sessionLsid": "session0"
   139                  }
   140                },
   141                "commandName": "find",
   142                "databaseName": "session-tests"
   143              }
   144            }
   145          ]
   146        }
   147      ],
   148      "outcome": [
   149        {
   150          "collectionName": "test",
   151          "databaseName": "session-tests",
   152          "documents": [
   153            {
   154              "_id": 1
   155            },
   156            {
   157              "_id": 2
   158            }
   159          ]
   160        }
   161      ]
   162    },
   163    {
   164      "description": "Server supports implicit sessions",
   165      "operations": [
   166        {
   167          "name": "insertOne",
   168          "object": "collection0",
   169          "arguments": {
   170            "document": {
   171              "_id": 2
   172            }
   173          },
   174          "expectResult": {
   175            "$$unsetOrMatches": {
   176              "insertedId": {
   177                "$$unsetOrMatches": 2
   178              }
   179            }
   180          }
   181        },
   182        {
   183          "name": "find",
   184          "object": "collection0",
   185          "arguments": {
   186            "filter": {
   187              "_id": -1
   188            }
   189          },
   190          "expectResult": []
   191        },
   192        {
   193          "name": "assertSameLsidOnLastTwoCommands",
   194          "object": "testRunner",
   195          "arguments": {
   196            "client": "client0"
   197          }
   198        }
   199      ],
   200      "expectEvents": [
   201        {
   202          "client": "client0",
   203          "events": [
   204            {
   205              "commandStartedEvent": {
   206                "command": {
   207                  "insert": "test",
   208                  "documents": [
   209                    {
   210                      "_id": 2
   211                    }
   212                  ],
   213                  "ordered": true,
   214                  "lsid": {
   215                    "$$type": "object"
   216                  }
   217                },
   218                "commandName": "insert",
   219                "databaseName": "session-tests"
   220              }
   221            },
   222            {
   223              "commandStartedEvent": {
   224                "command": {
   225                  "find": "test",
   226                  "filter": {
   227                    "_id": -1
   228                  },
   229                  "lsid": {
   230                    "$$type": "object"
   231                  }
   232                },
   233                "commandName": "find",
   234                "databaseName": "session-tests"
   235              }
   236            }
   237          ]
   238        }
   239      ],
   240      "outcome": [
   241        {
   242          "collectionName": "test",
   243          "databaseName": "session-tests",
   244          "documents": [
   245            {
   246              "_id": 1
   247            },
   248            {
   249              "_id": 2
   250            }
   251          ]
   252        }
   253      ]
   254    }
   255  ]
   256}

View as plain text