From e96f112d84c0a62ae601d1c65835c7319ea91255 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 27 Jul 2022 18:28:23 -0500 Subject: [PATCH] PYTHON-3274 Add commandStartedEvent assertions to clustered index spec tests (#1022) --- .../clustered-indexes.json | 122 +++++++++++++++++- 1 file changed, 118 insertions(+), 4 deletions(-) diff --git a/test/collection_management/clustered-indexes.json b/test/collection_management/clustered-indexes.json index 739d0fd8b..9db5ff06d 100644 --- a/test/collection_management/clustered-indexes.json +++ b/test/collection_management/clustered-indexes.json @@ -10,14 +10,17 @@ "createEntities": [ { "client": { - "id": "client0" + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] } }, { "database": { "id": "database0", "client": "client0", - "databaseName": "ts-tests" + "databaseName": "ci-tests" } }, { @@ -31,7 +34,7 @@ "initialData": [ { "collectionName": "test", - "databaseName": "ts-tests", + "databaseName": "ci-tests", "documents": [] } ], @@ -64,10 +67,40 @@ "name": "assertCollectionExists", "object": "testRunner", "arguments": { - "databaseName": "ts-tests", + "databaseName": "ci-tests", "collectionName": "test" } } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "drop": "test" + }, + "databaseName": "ci-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "create": "test", + "clusteredIndex": { + "key": { + "_id": 1 + }, + "unique": true, + "name": "test index" + } + }, + "databaseName": "ci-tests" + } + } + ] + } ] }, { @@ -125,6 +158,49 @@ } ] } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "drop": "test" + }, + "databaseName": "ci-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "create": "test", + "clusteredIndex": { + "key": { + "_id": 1 + }, + "unique": true, + "name": "test index" + } + }, + "databaseName": "ci-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1, + "filter": { + "name": { + "$eq": "test" + } + } + }, + "databaseName": "ci-tests" + } + } + ] + } ] }, { @@ -171,6 +247,44 @@ } ] } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "drop": "test" + }, + "databaseName": "ci-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "create": "test", + "clusteredIndex": { + "key": { + "_id": 1 + }, + "unique": true, + "name": "test index" + } + }, + "databaseName": "ci-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "test" + }, + "databaseName": "ci-tests" + } + } + ] + } ] } ]