Skip to content

Commit

Permalink
DRIVERS-2232: remove usages of currentOp and collStats from tests (
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Apr 19, 2023
1 parent e182862 commit 6632b76
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 37 deletions.
Expand Up @@ -26,17 +26,18 @@ tests:
command:
ping: 1
command_name: ping
- description: "current op is not bypassed"
- description: "kill op is not bypassed"
clientOptions:
autoEncryptOpts:
kmsProviders:
aws: {} # Credentials filled in from environment.
operations:
- name: runCommand
object: database
command_name: currentOp
command_name: killOp
arguments:
command:
currentOp: 1
killOp: 1
op: 1234
result:
errorContains: "command not supported for auto encryption: currentOp"
errorContains: "command not supported for auto encryption: killOp"
Expand Up @@ -78,7 +78,7 @@
]
},
{
"description": "current op is not bypassed",
"description": "kill op is not bypassed",
"clientOptions": {
"autoEncryptOpts": {
"kmsProviders": {
Expand All @@ -90,14 +90,15 @@
{
"name": "runCommand",
"object": "database",
"command_name": "currentOp",
"command_name": "killOp",
"arguments": {
"command": {
"currentOp": 1
"killOp": 1,
"op": 1234
}
},
"result": {
"errorContains": "command not supported for auto encryption: currentOp"
"errorContains": "command not supported for auto encryption: killOp"
}
}
]
Expand Down
Expand Up @@ -26,17 +26,18 @@ tests:
command:
ping: 1
command_name: ping
- description: "current op is not bypassed"
- description: "kill op is not bypassed"
clientOptions:
autoEncryptOpts:
kmsProviders:
aws: {} # Credentials filled in from environment.
operations:
- name: runCommand
object: database
command_name: currentOp
command_name: killOp
arguments:
command:
currentOp: 1
killOp: 1
op: 1234
result:
errorContains: "command not supported for auto encryption: currentOp"
errorContains: "command not supported for auto encryption: killOp"
Expand Up @@ -49,19 +49,29 @@
"description": "collection is created with the correct options",
"operations": [
{
"name": "runCommand",
"object": "database0",
"object": "collection0",
"name": "aggregate",
"arguments": {
"commandName": "collStats",
"command": {
"collStats": "coll0",
"scale": 1
}
"pipeline": [
{
"$collStats": {
"storageStats": {}
}
},
{
"$project": {
"capped": "$storageStats.capped",
"maxSize": "$storageStats.maxSize"
}
}
]
},
"expectResult": {
"capped": true,
"maxSize": 4096
}
"expectResult": [
{
"capped": true,
"maxSize": 4096
}
]
}
]
}
Expand Down
@@ -1,12 +1,9 @@
description: collectionData-createOptions

schemaVersion: "1.9"

runOnRequirements:
- minServerVersion: "3.6"
# Capped collections cannot be created on serverless instances.
serverless: forbid

createEntities:
- client:
id: &client0 client0
Expand All @@ -18,7 +15,6 @@ createEntities:
id: &collection0 collection0
database: *database0
collectionName: &collection0Name coll0

initialData:
- collectionName: *collection0Name
databaseName: *database0Name
Expand All @@ -28,18 +24,14 @@ initialData:
size: &cappedSize 4096
documents:
- { _id: 1, x: 11 }

tests:
- description: collection is created with the correct options
operations:
# Execute a collStats command to ensure the collection was created with the correct options.
- name: runCommand
object: *database0
- object: *collection0
name: aggregate
arguments:
commandName: collStats
command:
collStats: *collection0Name
scale: 1
pipeline:
- $collStats: { storageStats: {} }
- $project: { capped: '$storageStats.capped', maxSize: '$storageStats.maxSize'}
expectResult:
capped: true
maxSize: *cappedSize
- { capped: true, maxSize: *cappedSize }

0 comments on commit 6632b76

Please sign in to comment.