PYTHON-2600 Resync spec tests for versioned api (#599)

Also resolves PYTHON-2599 and PYTHON-2641.
This commit is contained in:
Shane Harvey 2021-04-23 15:11:35 -07:00 committed by GitHub
parent fac0372ba0
commit cd823c8ed1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 141 additions and 10 deletions

View File

@ -1944,11 +1944,11 @@ axes:
REQUIRE_API_VERSION: "1"
# MONGODB_API_VERSION is the apiVersion to use in the test suite.
MONGODB_API_VERSION: "1"
# Test against a cluster with acceptAPIVersion2 but without
# Test against a cluster with acceptApiVersion2 but without
# requireApiVersion, and don't automatically add apiVersion to
# clients created in the test suite.
- id: "acceptAPIVersion2"
display_name: "acceptAPIVersion2"
- id: "acceptApiVersion2"
display_name: "acceptApiVersion2"
tags: [ "versionedApi_tag" ]
variables:
ORCHESTRATION_FILE: "versioned-api-testing.json"
@ -2434,7 +2434,7 @@ buildvariants:
- matrix_name: "versioned-api-tests"
matrix_spec:
platform: ubuntu-16.04
platform: ubuntu-18.04
python-version: ["3.6", "3.9"]
auth: "auth"
versionedApi: "*"

View File

@ -3,7 +3,7 @@
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.7",
"minServerVersion": "4.9",
"serverParameters": {
"requireApiVersion": false
}

View File

@ -3,10 +3,10 @@
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.7",
"minServerVersion": "4.9",
"serverParameters": {
"enableTestCommands": true,
"acceptAPIVersion2": true,
"acceptApiVersion2": true,
"requireApiVersion": false
}
}

View File

@ -3,7 +3,7 @@
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.7",
"minServerVersion": "4.9",
"serverParameters": {
"enableTestCommands": true
}

View File

@ -3,7 +3,7 @@
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.7",
"minServerVersion": "4.9",
"topologies": [
"replicaset",
"sharded-replicaset"
@ -382,7 +382,138 @@
]
}
]
},
{
"description": "abortTransaction does not include an API version",
"runOnRequirements": [
{
"topologies": [
"replicaset",
"sharded-replicaset"
]
}
],
"operations": [
{
"name": "startTransaction",
"object": "session"
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session",
"document": {
"_id": 6,
"x": 66
}
},
"expectResult": {
"$$unsetOrMatches": {
"insertedId": {
"$$unsetOrMatches": 6
}
}
}
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session",
"document": {
"_id": 7,
"x": 77
}
},
"expectResult": {
"$$unsetOrMatches": {
"insertedId": {
"$$unsetOrMatches": 7
}
}
}
},
{
"name": "abortTransaction",
"object": "session"
}
],
"expectEvents": [
{
"client": "client",
"events": [
{
"commandStartedEvent": {
"command": {
"insert": "test",
"documents": [
{
"_id": 6,
"x": 66
}
],
"lsid": {
"$$sessionLsid": "session"
},
"startTransaction": true,
"apiVersion": "1",
"apiStrict": {
"$$unsetOrMatches": false
},
"apiDeprecationErrors": {
"$$unsetOrMatches": false
}
}
}
},
{
"commandStartedEvent": {
"command": {
"insert": "test",
"documents": [
{
"_id": 7,
"x": 77
}
],
"lsid": {
"$$sessionLsid": "session"
},
"apiVersion": {
"$$exists": false
},
"apiStrict": {
"$$exists": false
},
"apiDeprecationErrors": {
"$$exists": false
}
}
}
},
{
"commandStartedEvent": {
"command": {
"abortTransaction": 1,
"lsid": {
"$$sessionLsid": "session"
},
"apiVersion": {
"$$exists": false
},
"apiStrict": {
"$$exists": false
},
"apiDeprecationErrors": {
"$$exists": false
}
}
}
}
]
}
]
}
]
}