diff --git a/.evergreen/remove-unimplemented-tests.sh b/.evergreen/remove-unimplemented-tests.sh index 88ef137f86..9e049de318 100755 --- a/.evergreen/remove-unimplemented-tests.sh +++ b/.evergreen/remove-unimplemented-tests.sh @@ -41,7 +41,7 @@ rm $PYMONGO/test/index_management/index-rawdata.json rm $PYMONGO/test/collection_management/modifyCollection-*.json # PYTHON-5248 - Remove support for MongoDB 4.0 -find /$PYMONGO /test -type f -name 'pre-42-*.json' -delete +find /$PYMONGO/test -type f -name 'pre-42-*.json' -delete # PYTHON-3359 - Remove Database and Collection level timeout override rm $PYMONGO/test/csot/override-collection-timeoutMS.json diff --git a/.evergreen/spec-patch/PYTHON-5445.patch b/.evergreen/spec-patch/PYTHON-5445.patch new file mode 100644 index 0000000000..4ff67399b5 --- /dev/null +++ b/.evergreen/spec-patch/PYTHON-5445.patch @@ -0,0 +1,26 @@ +diff --git a/test/auth/legacy/connection-string.json b/test/auth/legacy/connection-string.json +index 3a099c813..8982b61d5 100644 +--- a/test/auth/legacy/connection-string.json ++++ b/test/auth/legacy/connection-string.json +@@ -440,6 +440,21 @@ + } + } + }, ++ { ++ "description": "should throw an exception if username provided (MONGODB-AWS)", ++ "uri": "mongodb://user@localhost.com/?authMechanism=MONGODB-AWS", ++ "valid": false ++ }, ++ { ++ "description": "should throw an exception if username and password provided (MONGODB-AWS)", ++ "uri": "mongodb://user:pass@localhost.com/?authMechanism=MONGODB-AWS", ++ "valid": false ++ }, ++ { ++ "description": "should throw an exception if AWS_SESSION_TOKEN provided (MONGODB-AWS)", ++ "uri": "mongodb://localhost/?authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:token", ++ "valid": false ++ }, + { + "description": "should recognise the mechanism with test environment (MONGODB-OIDC)", + "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:test", diff --git a/.evergreen/spec-patch/PYTHON-5559.patch b/.evergreen/spec-patch/PYTHON-5559.patch new file mode 100644 index 0000000000..29ad8d4829 --- /dev/null +++ b/.evergreen/spec-patch/PYTHON-5559.patch @@ -0,0 +1,815 @@ +diff --git a/test/sessions/snapshot-sessions.json b/test/sessions/snapshot-sessions.json +index 260f8b6f4..8f806ea75 100644 +--- a/test/sessions/snapshot-sessions.json ++++ b/test/sessions/snapshot-sessions.json +@@ -988,6 +988,810 @@ + } + } + ] ++ }, ++ { ++ "description": "Find operation with snapshot and snapshot time", ++ "operations": [ ++ { ++ "name": "find", ++ "object": "collection0", ++ "arguments": { ++ "session": "session0", ++ "filter": {} ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ }, ++ { ++ "_id": 2, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "getSnapshotTime", ++ "object": "session0", ++ "saveResultAsEntity": "savedSnapshotTime" ++ }, ++ { ++ "name": "insertOne", ++ "object": "collection0", ++ "arguments": { ++ "document": { ++ "_id": 3, ++ "x": 33 ++ } ++ } ++ }, ++ { ++ "name": "createEntities", ++ "object": "testRunner", ++ "arguments": { ++ "entities": [ ++ { ++ "session": { ++ "id": "session2", ++ "client": "client0", ++ "sessionOptions": { ++ "snapshot": true, ++ "snapshotTime": "savedSnapshotTime" ++ } ++ } ++ } ++ ] ++ } ++ }, ++ { ++ "name": "find", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "filter": {} ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ }, ++ { ++ "_id": 2, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "find", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "filter": {} ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ }, ++ { ++ "_id": 2, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "find", ++ "object": "collection0", ++ "arguments": { ++ "filter": {} ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ }, ++ { ++ "_id": 2, ++ "x": 11 ++ }, ++ { ++ "_id": 3, ++ "x": 33 ++ } ++ ] ++ } ++ ], ++ "expectEvents": [ ++ { ++ "client": "client0", ++ "events": [ ++ { ++ "commandStartedEvent": { ++ "command": { ++ "find": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$exists": false ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "find": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "find": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "find": "collection0", ++ "readConcern": { ++ "$$exists": false ++ } ++ }, ++ "databaseName": "database0" ++ } ++ } ++ ] ++ } ++ ] ++ }, ++ { ++ "description": "Distinct operation with snapshot and snapshot time", ++ "operations": [ ++ { ++ "name": "distinct", ++ "object": "collection0", ++ "arguments": { ++ "session": "session0", ++ "filter": {}, ++ "fieldName": "x" ++ }, ++ "expectResult": [ ++ 11 ++ ] ++ }, ++ { ++ "name": "getSnapshotTime", ++ "object": "session0", ++ "saveResultAsEntity": "savedSnapshotTime" ++ }, ++ { ++ "name": "insertOne", ++ "object": "collection0", ++ "arguments": { ++ "document": { ++ "_id": 3, ++ "x": 33 ++ } ++ } ++ }, ++ { ++ "name": "createEntities", ++ "object": "testRunner", ++ "arguments": { ++ "entities": [ ++ { ++ "session": { ++ "id": "session2", ++ "client": "client0", ++ "sessionOptions": { ++ "snapshot": true, ++ "snapshotTime": "savedSnapshotTime" ++ } ++ } ++ } ++ ] ++ } ++ }, ++ { ++ "name": "distinct", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "filter": {}, ++ "fieldName": "x" ++ }, ++ "expectResult": [ ++ 11 ++ ] ++ }, ++ { ++ "name": "distinct", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "filter": {}, ++ "fieldName": "x" ++ }, ++ "expectResult": [ ++ 11 ++ ] ++ }, ++ { ++ "name": "distinct", ++ "object": "collection0", ++ "arguments": { ++ "filter": {}, ++ "fieldName": "x" ++ }, ++ "expectResult": [ ++ 11, ++ 33 ++ ] ++ } ++ ], ++ "expectEvents": [ ++ { ++ "client": "client0", ++ "events": [ ++ { ++ "commandStartedEvent": { ++ "command": { ++ "distinct": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$exists": false ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "distinct": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "distinct": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "distinct": "collection0", ++ "readConcern": { ++ "$$exists": false ++ } ++ }, ++ "databaseName": "database0" ++ } ++ } ++ ] ++ } ++ ] ++ }, ++ { ++ "description": "Aggregate operation with snapshot and snapshot time", ++ "operations": [ ++ { ++ "name": "aggregate", ++ "object": "collection0", ++ "arguments": { ++ "session": "session0", ++ "pipeline": [ ++ { ++ "$match": { ++ "_id": 1 ++ } ++ } ++ ] ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "getSnapshotTime", ++ "object": "session0", ++ "saveResultAsEntity": "savedSnapshotTime" ++ }, ++ { ++ "name": "findOneAndUpdate", ++ "object": "collection0", ++ "arguments": { ++ "filter": { ++ "_id": 1 ++ }, ++ "update": { ++ "$inc": { ++ "x": 1 ++ } ++ }, ++ "returnDocument": "After" ++ }, ++ "expectResult": { ++ "_id": 1, ++ "x": 12 ++ } ++ }, ++ { ++ "name": "createEntities", ++ "object": "testRunner", ++ "arguments": { ++ "entities": [ ++ { ++ "session": { ++ "id": "session2", ++ "client": "client0", ++ "sessionOptions": { ++ "snapshot": true, ++ "snapshotTime": "savedSnapshotTime" ++ } ++ } ++ } ++ ] ++ } ++ }, ++ { ++ "name": "aggregate", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "pipeline": [ ++ { ++ "$match": { ++ "_id": 1 ++ } ++ } ++ ] ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "aggregate", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "pipeline": [ ++ { ++ "$match": { ++ "_id": 1 ++ } ++ } ++ ] ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "aggregate", ++ "object": "collection0", ++ "arguments": { ++ "pipeline": [ ++ { ++ "$match": { ++ "_id": 1 ++ } ++ } ++ ] ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 12 ++ } ++ ] ++ } ++ ], ++ "expectEvents": [ ++ { ++ "client": "client0", ++ "events": [ ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$exists": false ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "$$exists": false ++ } ++ }, ++ "databaseName": "database0" ++ } ++ } ++ ] ++ } ++ ] ++ }, ++ { ++ "description": "countDocuments operation with snapshot and snapshot time", ++ "operations": [ ++ { ++ "name": "countDocuments", ++ "object": "collection0", ++ "arguments": { ++ "session": "session0", ++ "filter": {} ++ }, ++ "expectResult": 2 ++ }, ++ { ++ "name": "getSnapshotTime", ++ "object": "session0", ++ "saveResultAsEntity": "savedSnapshotTime" ++ }, ++ { ++ "name": "insertOne", ++ "object": "collection0", ++ "arguments": { ++ "document": { ++ "_id": 3, ++ "x": 33 ++ } ++ } ++ }, ++ { ++ "name": "createEntities", ++ "object": "testRunner", ++ "arguments": { ++ "entities": [ ++ { ++ "session": { ++ "id": "session2", ++ "client": "client0", ++ "sessionOptions": { ++ "snapshot": true, ++ "snapshotTime": "savedSnapshotTime" ++ } ++ } ++ } ++ ] ++ } ++ }, ++ { ++ "name": "countDocuments", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "filter": {} ++ }, ++ "expectResult": 2 ++ }, ++ { ++ "name": "countDocuments", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "filter": {} ++ }, ++ "expectResult": 2 ++ }, ++ { ++ "name": "countDocuments", ++ "object": "collection0", ++ "arguments": { ++ "filter": {} ++ }, ++ "expectResult": 3 ++ } ++ ], ++ "expectEvents": [ ++ { ++ "client": "client0", ++ "events": [ ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$exists": false ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "$$exists": false ++ } ++ }, ++ "databaseName": "database0" ++ } ++ } ++ ] ++ } ++ ] ++ }, ++ { ++ "description": "Mixed operation with snapshot and snapshotTime", ++ "operations": [ ++ { ++ "name": "find", ++ "object": "collection0", ++ "arguments": { ++ "session": "session0", ++ "filter": { ++ "_id": 1 ++ } ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "getSnapshotTime", ++ "object": "session0", ++ "saveResultAsEntity": "savedSnapshotTime" ++ }, ++ { ++ "name": "findOneAndUpdate", ++ "object": "collection0", ++ "arguments": { ++ "filter": { ++ "_id": 1 ++ }, ++ "update": { ++ "$inc": { ++ "x": 1 ++ } ++ }, ++ "returnDocument": "After" ++ }, ++ "expectResult": { ++ "_id": 1, ++ "x": 12 ++ } ++ }, ++ { ++ "name": "createEntities", ++ "object": "testRunner", ++ "arguments": { ++ "entities": [ ++ { ++ "session": { ++ "id": "session2", ++ "client": "client0", ++ "sessionOptions": { ++ "snapshot": true, ++ "snapshotTime": "savedSnapshotTime" ++ } ++ } ++ } ++ ] ++ } ++ }, ++ { ++ "name": "find", ++ "object": "collection0", ++ "arguments": { ++ "filter": { ++ "_id": 1 ++ } ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 12 ++ } ++ ] ++ }, ++ { ++ "name": "aggregate", ++ "object": "collection0", ++ "arguments": { ++ "pipeline": [ ++ { ++ "$match": { ++ "_id": 1 ++ } ++ } ++ ], ++ "session": "session2" ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "distinct", ++ "object": "collection0", ++ "arguments": { ++ "fieldName": "x", ++ "filter": {}, ++ "session": "session2" ++ }, ++ "expectResult": [ ++ 11 ++ ] ++ } ++ ], ++ "expectEvents": [ ++ { ++ "client": "client0", ++ "events": [ ++ { ++ "commandStartedEvent": { ++ "command": { ++ "find": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$exists": false ++ } ++ } ++ } ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "find": "collection0", ++ "readConcern": { ++ "$$exists": false ++ } ++ } ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ } ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "distinct": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ } ++ } ++ } ++ ] ++ } ++ ] + } + ] + } diff --git a/test/client-side-encryption/etc/data/lookup/schema-non-csfle.json b/test/client-side-encryption/etc/data/lookup/schema-non-csfle.json new file mode 100644 index 0000000000..3edd12c8f4 --- /dev/null +++ b/test/client-side-encryption/etc/data/lookup/schema-non-csfle.json @@ -0,0 +1,3 @@ +{ + "bsonType": "object" +} diff --git a/test/client-side-encryption/spec/unified/fle2v2-CreateCollection.json b/test/client-side-encryption/spec/unified/fle2v2-CreateCollection.json index 3dfb76c461..81a4c61731 100644 --- a/test/client-side-encryption/spec/unified/fle2v2-CreateCollection.json +++ b/test/client-side-encryption/spec/unified/fle2v2-CreateCollection.json @@ -554,7 +554,7 @@ }, { "name": "assertIndexNotExists", - "object": "db", + "object": "testRunner", "arguments": { "databaseName": "default", "collectionName": "encryptedCollection", diff --git a/test/client-side-encryption/spec/unified/fle2v2-validatorAndPartialFieldExpression.json b/test/client-side-encryption/spec/unified/fle2v2-validatorAndPartialFieldExpression.json index 54cc60a3b1..8d69464400 100644 --- a/test/client-side-encryption/spec/unified/fle2v2-validatorAndPartialFieldExpression.json +++ b/test/client-side-encryption/spec/unified/fle2v2-validatorAndPartialFieldExpression.json @@ -108,7 +108,7 @@ }, { "name": "assertCollectionExists", - "object": "coll", + "object": "testRunner", "arguments": { "databaseName": "default", "collectionName": "encryptedCollection" @@ -248,7 +248,7 @@ }, { "name": "assertIndexExists", - "object": "coll", + "object": "testRunner", "arguments": { "databaseName": "default", "collectionName": "encryptedCollection",