| 1 | { |
| 2 | "runOn": [ |
| 3 | { |
| 4 | "minServerVersion": "4.3.4", |
| 5 | "topology": [ |
| 6 | "replicaset", |
| 7 | "sharded" |
| 8 | ] |
| 9 | } |
| 10 | ], |
| 11 | "database_name": "transaction-tests", |
| 12 | "collection_name": "test", |
| 13 | "data": [], |
| 14 | "tests": [ |
| 15 | { |
| 16 | "description": "explicitly create collection using create command", |
| 17 | "operations": [ |
| 18 | { |
| 19 | "name": "dropCollection", |
| 20 | "object": "database", |
| 21 | "arguments": { |
| 22 | "collection": "test" |
| 23 | } |
| 24 | }, |
| 25 | { |
| 26 | "name": "startTransaction", |
| 27 | "object": "session0" |
| 28 | }, |
| 29 | { |
| 30 | "name": "createCollection", |
| 31 | "object": "database", |
| 32 | "arguments": { |
| 33 | "session": "session0", |
| 34 | "collection": "test" |
| 35 | } |
| 36 | }, |
| 37 | { |
| 38 | "name": "assertCollectionNotExists", |
| 39 | "object": "testRunner", |
| 40 | "arguments": { |
| 41 | "database": "transaction-tests", |
| 42 | "collection": "test" |
| 43 | } |
| 44 | }, |
| 45 | { |
| 46 | "name": "commitTransaction", |
| 47 | "object": "session0" |
| 48 | }, |
| 49 | { |
| 50 | "name": "assertCollectionExists", |
| 51 | "object": "testRunner", |
| 52 | "arguments": { |
| 53 | "database": "transaction-tests", |
| 54 | "collection": "test" |
| 55 | } |
| 56 | } |
| 57 | ], |
| 58 | "expectations": [ |
| 59 | { |
| 60 | "command_started_event": { |
| 61 | "command": { |
| 62 | "drop": "test", |
| 63 | "writeConcern": null |
| 64 | }, |
| 65 | "command_name": "drop", |
| 66 | "database_name": "transaction-tests" |
| 67 | } |
| 68 | }, |
| 69 | { |
| 70 | "command_started_event": { |
| 71 | "command": { |
| 72 | "create": "test", |
| 73 | "lsid": "session0", |
| 74 | "txnNumber": { |
| 75 | "$numberLong": "1" |
| 76 | }, |
| 77 | "startTransaction": true, |
| 78 | "autocommit": false, |
| 79 | "writeConcern": null |
| 80 | }, |
| 81 | "command_name": "create", |
| 82 | "database_name": "transaction-tests" |
| 83 | } |
| 84 | }, |
| 85 | { |
| 86 | "command_started_event": { |
| 87 | "command": { |
| 88 | "commitTransaction": 1, |
| 89 | "lsid": "session0", |
| 90 | "txnNumber": { |
| 91 | "$numberLong": "1" |
| 92 | }, |
| 93 | "startTransaction": null, |
| 94 | "autocommit": false, |
| 95 | "writeConcern": null |
| 96 | }, |
| 97 | "command_name": "commitTransaction", |
| 98 | "database_name": "admin" |
| 99 | } |
| 100 | } |
| 101 | ] |
| 102 | }, |
| 103 | { |
| 104 | "description": "implicitly create collection using insert", |
| 105 | "operations": [ |
| 106 | { |
| 107 | "name": "dropCollection", |
| 108 | "object": "database", |
| 109 | "arguments": { |
| 110 | "collection": "test" |
| 111 | } |
| 112 | }, |
| 113 | { |
| 114 | "name": "startTransaction", |
| 115 | "object": "session0" |
| 116 | }, |
| 117 | { |
| 118 | "name": "insertOne", |
| 119 | "object": "collection", |
| 120 | "arguments": { |
| 121 | "session": "session0", |
| 122 | "document": { |
| 123 | "_id": 1 |
| 124 | } |
| 125 | }, |
| 126 | "result": { |
| 127 | "insertedId": 1 |
| 128 | } |
| 129 | }, |
| 130 | { |
| 131 | "name": "assertCollectionNotExists", |
| 132 | "object": "testRunner", |
| 133 | "arguments": { |
| 134 | "database": "transaction-tests", |
| 135 | "collection": "test" |
| 136 | } |
| 137 | }, |
| 138 | { |
| 139 | "name": "commitTransaction", |
| 140 | "object": "session0" |
| 141 | }, |
| 142 | { |
| 143 | "name": "assertCollectionExists", |
| 144 | "object": "testRunner", |
| 145 | "arguments": { |
| 146 | "database": "transaction-tests", |
| 147 | "collection": "test" |
| 148 | } |
| 149 | } |
| 150 | ], |
| 151 | "expectations": [ |
| 152 | { |
| 153 | "command_started_event": { |
| 154 | "command": { |
| 155 | "drop": "test", |
| 156 | "writeConcern": null |
| 157 | }, |
| 158 | "command_name": "drop", |
| 159 | "database_name": "transaction-tests" |
| 160 | } |
| 161 | }, |
| 162 | { |
| 163 | "command_started_event": { |
| 164 | "command": { |
| 165 | "insert": "test", |
| 166 | "documents": [ |
| 167 | { |
| 168 | "_id": 1 |
| 169 | } |
| 170 | ], |
| 171 | "ordered": true, |
| 172 | "readConcern": null, |
| 173 | "lsid": "session0", |
| 174 | "txnNumber": { |
| 175 | "$numberLong": "1" |
| 176 | }, |
| 177 | "startTransaction": true, |
| 178 | "autocommit": false, |
| 179 | "writeConcern": null |
| 180 | }, |
| 181 | "command_name": "insert", |
| 182 | "database_name": "transaction-tests" |
| 183 | } |
| 184 | }, |
| 185 | { |
| 186 | "command_started_event": { |
| 187 | "command": { |
| 188 | "commitTransaction": 1, |
| 189 | "lsid": "session0", |
| 190 | "txnNumber": { |
| 191 | "$numberLong": "1" |
| 192 | }, |
| 193 | "startTransaction": null, |
| 194 | "autocommit": false, |
| 195 | "writeConcern": null |
| 196 | }, |
| 197 | "command_name": "commitTransaction", |
| 198 | "database_name": "admin" |
| 199 | } |
| 200 | } |
| 201 | ] |
| 202 | } |
| 203 | ] |
| 204 | } |