-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: throw an error if
allowDiskUse
is used on MongoDB < 3.2
- Loading branch information
Showing
6 changed files
with
183 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"runOn": [ | ||
{ | ||
"maxServerVersion": "3.0.99" | ||
} | ||
], | ||
"collection_name": "test_find_allowdiskuse_clienterror", | ||
"tests": [ | ||
{ | ||
"description": "Find fails when allowDiskUse true is specified against pre 3.2 server", | ||
"operations": [ | ||
{ | ||
"object": "collection", | ||
"name": "find", | ||
"arguments": { | ||
"filter": {}, | ||
"allowDiskUse": true | ||
}, | ||
"error": true | ||
} | ||
], | ||
"expectations": [] | ||
}, | ||
{ | ||
"description": "Find fails when allowDiskUse false is specified against pre 3.2 server", | ||
"operations": [ | ||
{ | ||
"object": "collection", | ||
"name": "find", | ||
"arguments": { | ||
"filter": {}, | ||
"allowDiskUse": false | ||
}, | ||
"error": true | ||
} | ||
], | ||
"expectations": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
runOn: | ||
- { maxServerVersion: "3.0.99" } | ||
|
||
collection_name: &collection_name 'test_find_allowdiskuse_clienterror' | ||
|
||
tests: | ||
- | ||
description: "Find fails when allowDiskUse true is specified against pre 3.2 server" | ||
operations: | ||
- | ||
object: collection | ||
name: find | ||
arguments: | ||
filter: { } | ||
allowDiskUse: true | ||
error: true | ||
expectations: [] | ||
- | ||
description: "Find fails when allowDiskUse false is specified against pre 3.2 server" | ||
operations: | ||
- | ||
object: collection | ||
name: find | ||
arguments: | ||
filter: { } | ||
allowDiskUse: false | ||
error: true | ||
expectations: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"runOn": [ | ||
{ | ||
"minServerVersion": "3.2", | ||
"maxServerVersion": "4.3.0" | ||
} | ||
], | ||
"collection_name": "test_find_allowdiskuse_servererror", | ||
"tests": [ | ||
{ | ||
"description": "Find fails when allowDiskUse true is specified against pre 4.4 server (server-side error)", | ||
"operations": [ | ||
{ | ||
"object": "collection", | ||
"name": "find", | ||
"arguments": { | ||
"filter": {}, | ||
"allowDiskUse": true | ||
}, | ||
"error": true | ||
} | ||
], | ||
"expectations": [ | ||
{ | ||
"command_started_event": { | ||
"command": { | ||
"find": "test_find_allowdiskuse_servererror", | ||
"filter": {}, | ||
"allowDiskUse": true | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "Find fails when allowDiskUse false is specified against pre 4.4 server (server-side error)", | ||
"operations": [ | ||
{ | ||
"object": "collection", | ||
"name": "find", | ||
"arguments": { | ||
"filter": {}, | ||
"allowDiskUse": false | ||
}, | ||
"error": true | ||
} | ||
], | ||
"expectations": [ | ||
{ | ||
"command_started_event": { | ||
"command": { | ||
"find": "test_find_allowdiskuse_servererror", | ||
"filter": {}, | ||
"allowDiskUse": false | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
runOn: | ||
# These tests assert that the driver does not raise client-side errors and | ||
# instead relies on the server to raise an error. Server versions >= 3.2.0 | ||
# raise errors for unknown find options, and server versions >= 4.3.1 | ||
# support the allowDiskUse option in find. | ||
- { minServerVersion: "3.2", maxServerVersion: "4.3.0" } | ||
|
||
collection_name: &collection_name 'test_find_allowdiskuse_servererror' | ||
|
||
tests: | ||
- | ||
description: "Find fails when allowDiskUse true is specified against pre 4.4 server (server-side error)" | ||
operations: | ||
- | ||
object: collection | ||
name: find | ||
arguments: | ||
filter: &filter { } | ||
allowDiskUse: true | ||
error: true | ||
expectations: | ||
- | ||
command_started_event: | ||
command: | ||
find: *collection_name | ||
filter: *filter | ||
allowDiskUse: true | ||
- | ||
description: "Find fails when allowDiskUse false is specified against pre 4.4 server (server-side error)" | ||
operations: | ||
- | ||
object: collection | ||
name: find | ||
arguments: | ||
filter: *filter | ||
allowDiskUse: false | ||
error: true | ||
expectations: | ||
- | ||
command_started_event: | ||
command: | ||
find: *collection_name | ||
filter: *filter | ||
allowDiskUse: false |