Skip to content

Commit 6632b76

Browse files
DRIVERS-2232: remove usages of currentOp and collStats from tests (#1402)
1 parent e182862 commit 6632b76

File tree

5 files changed

+42
-37
lines changed

5 files changed

+42
-37
lines changed

source/client-side-encryption/etc/test-templates/bypassedCommand.yml.template

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,18 @@ tests:
2626
command:
2727
ping: 1
2828
command_name: ping
29-
- description: "current op is not bypassed"
29+
- description: "kill op is not bypassed"
3030
clientOptions:
3131
autoEncryptOpts:
3232
kmsProviders:
3333
aws: {} # Credentials filled in from environment.
3434
operations:
3535
- name: runCommand
3636
object: database
37-
command_name: currentOp
37+
command_name: killOp
3838
arguments:
3939
command:
40-
currentOp: 1
40+
killOp: 1
41+
op: 1234
4142
result:
42-
errorContains: "command not supported for auto encryption: currentOp"
43+
errorContains: "command not supported for auto encryption: killOp"

source/client-side-encryption/tests/legacy/bypassedCommand.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
]
7979
},
8080
{
81-
"description": "current op is not bypassed",
81+
"description": "kill op is not bypassed",
8282
"clientOptions": {
8383
"autoEncryptOpts": {
8484
"kmsProviders": {
@@ -90,14 +90,15 @@
9090
{
9191
"name": "runCommand",
9292
"object": "database",
93-
"command_name": "currentOp",
93+
"command_name": "killOp",
9494
"arguments": {
9595
"command": {
96-
"currentOp": 1
96+
"killOp": 1,
97+
"op": 1234
9798
}
9899
},
99100
"result": {
100-
"errorContains": "command not supported for auto encryption: currentOp"
101+
"errorContains": "command not supported for auto encryption: killOp"
101102
}
102103
}
103104
]

source/client-side-encryption/tests/legacy/bypassedCommand.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,18 @@ tests:
2626
command:
2727
ping: 1
2828
command_name: ping
29-
- description: "current op is not bypassed"
29+
- description: "kill op is not bypassed"
3030
clientOptions:
3131
autoEncryptOpts:
3232
kmsProviders:
3333
aws: {} # Credentials filled in from environment.
3434
operations:
3535
- name: runCommand
3636
object: database
37-
command_name: currentOp
37+
command_name: killOp
3838
arguments:
3939
command:
40-
currentOp: 1
40+
killOp: 1
41+
op: 1234
4142
result:
42-
errorContains: "command not supported for auto encryption: currentOp"
43+
errorContains: "command not supported for auto encryption: killOp"

source/unified-test-format/tests/valid-pass/collectionData-createOptions.json

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,29 @@
4949
"description": "collection is created with the correct options",
5050
"operations": [
5151
{
52-
"name": "runCommand",
53-
"object": "database0",
52+
"object": "collection0",
53+
"name": "aggregate",
5454
"arguments": {
55-
"commandName": "collStats",
56-
"command": {
57-
"collStats": "coll0",
58-
"scale": 1
59-
}
55+
"pipeline": [
56+
{
57+
"$collStats": {
58+
"storageStats": {}
59+
}
60+
},
61+
{
62+
"$project": {
63+
"capped": "$storageStats.capped",
64+
"maxSize": "$storageStats.maxSize"
65+
}
66+
}
67+
]
6068
},
61-
"expectResult": {
62-
"capped": true,
63-
"maxSize": 4096
64-
}
69+
"expectResult": [
70+
{
71+
"capped": true,
72+
"maxSize": 4096
73+
}
74+
]
6575
}
6676
]
6777
}
Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
description: collectionData-createOptions
2-
32
schemaVersion: "1.9"
4-
53
runOnRequirements:
64
- minServerVersion: "3.6"
75
# Capped collections cannot be created on serverless instances.
86
serverless: forbid
9-
107
createEntities:
118
- client:
129
id: &client0 client0
@@ -18,7 +15,6 @@ createEntities:
1815
id: &collection0 collection0
1916
database: *database0
2017
collectionName: &collection0Name coll0
21-
2218
initialData:
2319
- collectionName: *collection0Name
2420
databaseName: *database0Name
@@ -28,18 +24,14 @@ initialData:
2824
size: &cappedSize 4096
2925
documents:
3026
- { _id: 1, x: 11 }
31-
3227
tests:
3328
- description: collection is created with the correct options
3429
operations:
35-
# Execute a collStats command to ensure the collection was created with the correct options.
36-
- name: runCommand
37-
object: *database0
30+
- object: *collection0
31+
name: aggregate
3832
arguments:
39-
commandName: collStats
40-
command:
41-
collStats: *collection0Name
42-
scale: 1
33+
pipeline:
34+
- $collStats: { storageStats: {} }
35+
- $project: { capped: '$storageStats.capped', maxSize: '$storageStats.maxSize'}
4336
expectResult:
44-
capped: true
45-
maxSize: *cappedSize
37+
- { capped: true, maxSize: *cappedSize }

0 commit comments

Comments
 (0)