Skip to content

Commit 2281242

Browse files
RUST-1991 / RUST-2016 Fix non-CSFLE serverless tests (#1190)
1 parent 4477b9d commit 2281242

39 files changed

+371
-95
lines changed

.evergreen/config.yml

+3-21
Original file line numberDiff line numberDiff line change
@@ -269,29 +269,15 @@ buildvariants:
269269
tasks:
270270
- test-plain-auth
271271

272-
- name: serverless-passthrough
272+
- name: serverless
273273
patchable: false
274-
display_name: "Serverless (Passthrough)"
274+
display_name: "Serverless"
275275
run_on:
276276
- rhel80-small
277277
expansions:
278278
LIBMONGOCRYPT_OS: rhel-80-64-bit
279279
AUTH: auth
280280
SSL: ssl
281-
SERVERLESS_PROXY_TYPE: passthrough
282-
tasks:
283-
- serverless-task-group
284-
285-
- name: serverless-terminating
286-
patchable: false
287-
display_name: "Serverless (Terminating)"
288-
run_on:
289-
- rhel80-small
290-
expansions:
291-
LIBMONGOCRYPT_OS: rhel-80-64-bit
292-
AUTH: auth
293-
SSL: ssl
294-
SERVERLESS_PROXY_TYPE: terminating
295281
tasks:
296282
- serverless-task-group
297283

@@ -414,11 +400,7 @@ task_groups:
414400
shell: "bash"
415401
script: |
416402
${PREPARE_SHELL}
417-
if [ "terminating" = "${SERVERLESS_PROXY_TYPE}" ]; then
418-
bash ${DRIVERS_TOOLS}/.evergreen/serverless/setup-secrets.sh serverless_next
419-
else
420-
bash ${DRIVERS_TOOLS}/.evergreen/serverless/setup-secrets.sh
421-
fi
403+
bash ${DRIVERS_TOOLS}/.evergreen/serverless/setup-secrets.sh
422404
bash ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh
423405
- command: expansions.update
424406
params:

src/test/spec/json/command-logging-and-monitoring/logging/unacknowledged-write.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{
66
"client": {
77
"id": "client",
8+
"useMultipleMongoses": false,
89
"observeLogMessages": {
910
"command": "debug"
1011
}

src/test/spec/json/command-logging-and-monitoring/logging/unacknowledged-write.yml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ schemaVersion: "1.16"
55
createEntities:
66
- client:
77
id: &client client
8+
useMultipleMongoses: false
89
observeLogMessages:
910
command: debug
1011
- database:

src/test/spec/json/command-logging-and-monitoring/monitoring/unacknowledged-client-bulkWrite.json

+34-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
{
22
"description": "unacknowledged-client-bulkWrite",
3-
"schemaVersion": "1.1",
3+
"schemaVersion": "1.7",
4+
"runOnRequirements": [
5+
{
6+
"minServerVersion": "8.0",
7+
"serverless": "forbid"
8+
}
9+
],
410
"createEntities": [
511
{
612
"client": {
713
"id": "client",
14+
"useMultipleMongoses": false,
815
"observeEvents": [
916
"commandStartedEvent",
1017
"commandSucceededEvent",
@@ -112,11 +119,37 @@
112119
"$$unsetOrMatches": {}
113120
}
114121
}
122+
},
123+
{
124+
"object": "collection",
125+
"name": "find",
126+
"arguments": {
127+
"filter": {}
128+
},
129+
"expectResult": [
130+
{
131+
"_id": 1,
132+
"x": 11
133+
},
134+
{
135+
"_id": 2,
136+
"x": 22
137+
},
138+
{
139+
"_id": 3,
140+
"x": 333
141+
},
142+
{
143+
"_id": 4,
144+
"x": 44
145+
}
146+
]
115147
}
116148
],
117149
"expectEvents": [
118150
{
119151
"client": "client",
152+
"ignoreExtraEvents": true,
120153
"events": [
121154
{
122155
"commandStartedEvent": {

src/test/spec/json/command-logging-and-monitoring/monitoring/unacknowledged-client-bulkWrite.yml

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
description: "unacknowledged-client-bulkWrite"
22

3-
schemaVersion: "1.1"
3+
schemaVersion: "1.7"
4+
5+
runOnRequirements:
6+
- minServerVersion: "8.0"
7+
serverless: forbid
48

59
createEntities:
610
- client:
711
id: &client client
12+
useMultipleMongoses: false
813
observeEvents:
914
- commandStartedEvent
1015
- commandSucceededEvent
@@ -62,9 +67,21 @@ tests:
6267
$$unsetOrMatches: {}
6368
deleteResults:
6469
$$unsetOrMatches: {}
70+
# Force completion of the w:0 write by executing a find on the same connection
71+
- object: *collection
72+
name: find
73+
arguments:
74+
filter: {}
75+
expectResult:
76+
- { _id: 1, x: 11 }
77+
- { _id: 2, x: 22 }
78+
- { _id: 3, x: 333 }
79+
- { _id: 4, x: 44 }
80+
6581
expectEvents:
6682
-
6783
client: *client
84+
ignoreExtraEvents: true
6885
events:
6986
- commandStartedEvent:
7087
commandName: bulkWrite

src/test/spec/json/command-logging-and-monitoring/monitoring/unacknowledgedBulkWrite.json

+2-11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{
66
"client": {
77
"id": "client",
8+
"useMultipleMongoses": false,
89
"observeEvents": [
910
"commandStartedEvent",
1011
"commandSucceededEvent",
@@ -70,17 +71,7 @@
7071
"object": "collection",
7172
"arguments": {
7273
"filter": {}
73-
},
74-
"expectResult": [
75-
{
76-
"_id": 1,
77-
"x": 11
78-
},
79-
{
80-
"_id": "unorderedBulkWriteInsertW0",
81-
"x": 44
82-
}
83-
]
74+
}
8475
}
8576
],
8677
"expectEvents": [

src/test/spec/json/command-logging-and-monitoring/monitoring/unacknowledgedBulkWrite.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ schemaVersion: "1.7"
55
createEntities:
66
- client:
77
id: &client client
8+
useMultipleMongoses: false
89
observeEvents:
910
- commandStartedEvent
1011
- commandSucceededEvent
@@ -41,10 +42,6 @@ tests:
4142
object: *collection
4243
arguments:
4344
filter: { }
44-
expectResult: [
45-
{ _id: 1, x: 11 },
46-
{ _id: "unorderedBulkWriteInsertW0", x: 44 }
47-
]
4845
expectEvents:
4946
- client: *client
5047
ignoreExtraEvents: true

src/test/spec/json/crud/README.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ WriteError's `details` property.
7070
Test that `MongoClient.bulkWrite` properly handles `writeModels` inputs containing a number of writes greater than
7171
`maxWriteBatchSize`.
7272

73-
This test must only be run on 8.0+ servers.
73+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
7474

7575
Construct a `MongoClient` (referred to as `client`) with
7676
[command monitoring](../../command-logging-and-monitoring/command-logging-and-monitoring.rst) enabled to observe
@@ -98,7 +98,7 @@ command. Assert that the length of `firstEvent.command.ops` is `maxWriteBatchSiz
9898
Test that `MongoClient.bulkWrite` properly handles a `writeModels` input which constructs an `ops` array larger than
9999
`maxMessageSizeBytes`.
100100

101-
This test must only be run on 8.0+ servers.
101+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
102102

103103
Construct a `MongoClient` (referred to as `client`) with
104104
[command monitoring](../../command-logging-and-monitoring/command-logging-and-monitoring.rst) enabled to observe
@@ -137,7 +137,7 @@ driver exposes `operationId`s in its CommandStartedEvents, assert that `firstEve
137137

138138
Test that `MongoClient.bulkWrite` properly collects and reports `writeConcernError`s returned in separate batches.
139139

140-
This test must only be run on 8.0+ servers.
140+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
141141

142142
Construct a `MongoClient` (referred to as `client`) with `retryWrites: false` configured and
143143
[command monitoring](../../command-logging-and-monitoring/command-logging-and-monitoring.rst) enabled to observe
@@ -182,7 +182,7 @@ Assert that two CommandStartedEvents were observed for the `bulkWrite` command.
182182

183183
Test that `MongoClient.bulkWrite` handles individual write errors across batches for ordered and unordered bulk writes.
184184

185-
This test must only be run on 8.0+ servers.
185+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
186186

187187
Construct a `MongoClient` (referred to as `client`) with
188188
[command monitoring](../../command-logging-and-monitoring/command-logging-and-monitoring.rst) enabled to observe
@@ -237,7 +237,7 @@ Assert that one CommandStartedEvent was observed for the `bulkWrite` command.
237237

238238
Test that `MongoClient.bulkWrite` properly iterates the results cursor when `getMore` is required.
239239

240-
This test must only be run on 8.0+ servers.
240+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
241241

242242
Construct a `MongoClient` (referred to as `client`) with
243243
[command monitoring](../../command-logging-and-monitoring/command-logging-and-monitoring.rst) enabled to observe
@@ -276,7 +276,8 @@ Assert that a CommandStartedEvent was observed for the `getMore` command.
276276
Test that `MongoClient.bulkWrite` executed within a transaction properly iterates the results cursor when `getMore` is
277277
required.
278278

279-
This test must only be run on 8.0+ servers. This test must not be run against standalone servers.
279+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless. This test must not be run
280+
against standalone servers.
280281

281282
Construct a `MongoClient` (referred to as `client`) with
282283
[command monitoring](../../command-logging-and-monitoring/command-logging-and-monitoring.rst) enabled to observe
@@ -318,7 +319,7 @@ Assert that a CommandStartedEvent was observed for the `getMore` command.
318319

319320
Test that `MongoClient.bulkWrite` properly handles a failure that occurs when attempting a `getMore`.
320321

321-
This test must only be run on 8.0+ servers.
322+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
322323

323324
Construct a `MongoClient` (referred to as `client`) with
324325
[command monitoring](../../command-logging-and-monitoring/command-logging-and-monitoring.rst) enabled to observe
@@ -369,7 +370,7 @@ Assert that a CommandStartedEvent was observed for the `killCursors` command.
369370

370371
### 10. `MongoClient.bulkWrite` returns error for unacknowledged too-large insert
371372

372-
This test must only be run on 8.0+ servers.
373+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
373374

374375
Construct a `MongoClient` (referred to as `client`).
375376

@@ -423,7 +424,7 @@ Expect a client-side error due the size.
423424
Test that `MongoClient.bulkWrite` batch splits a bulk write when the addition of a new namespace to `nsInfo` causes the
424425
size of the message to exceed `maxMessageSizeBytes - 1000`.
425426

426-
This test must only be run on 8.0+ servers.
427+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
427428

428429
Repeat the following setup for each test case:
429430

@@ -603,8 +604,8 @@ remainingBulkWriteBytes = maxMessageSizeBytes - 1122
603604
Test that `MongoClient.bulkWrite` returns an error if an operation provided exceeds `maxMessageSizeBytes` such that an
604605
empty `ops` payload would be sent.
605606

606-
This test must only be run on 8.0+ servers. This test may be skipped by drivers that are not able to construct
607-
arbitrarily large documents.
607+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless. This test may be skipped by
608+
drivers that are not able to construct arbitrarily large documents.
608609

609610
Construct a `MongoClient` (referred to as `client`). Perform a `hello` command using `client` and record the
610611
`maxMessageSizeBytes` value contained in the response.
@@ -649,7 +650,7 @@ This test is expected to be removed when [DRIVERS-2888](https://jira.mongodb.org
649650

650651
Test that `MongoClient.bulkWrite` returns an error if the client has auto-encryption configured.
651652

652-
This test must only be run on 8.0+ servers.
653+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
653654

654655
Construct a `MongoClient` (referred to as `client`) configured with the following `AutoEncryptionOpts`:
655656

src/test/spec/json/crud/unified/client-bulkWrite-delete-options.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"description": "client bulkWrite delete options",
3-
"schemaVersion": "1.1",
3+
"schemaVersion": "1.4",
44
"runOnRequirements": [
55
{
6-
"minServerVersion": "8.0"
6+
"minServerVersion": "8.0",
7+
"serverless": "forbid"
78
}
89
],
910
"createEntities": [

src/test/spec/json/crud/unified/client-bulkWrite-delete-options.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
description: "client bulkWrite delete options"
2-
schemaVersion: "1.1"
2+
schemaVersion: "1.4" # To support `serverless: forbid`
33
runOnRequirements:
44
- minServerVersion: "8.0"
5+
serverless: forbid
56

67
createEntities:
78
- client:

src/test/spec/json/crud/unified/client-bulkWrite-errorResponse.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"schemaVersion": "1.12",
44
"runOnRequirements": [
55
{
6-
"minServerVersion": "8.0"
6+
"minServerVersion": "8.0",
7+
"serverless": "forbid"
78
}
89
],
910
"createEntities": [

src/test/spec/json/crud/unified/client-bulkWrite-errorResponse.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ description: "client bulkWrite errorResponse"
22
schemaVersion: "1.12"
33
runOnRequirements:
44
- minServerVersion: "8.0"
5+
serverless: forbid
56

67
createEntities:
78
- client:

src/test/spec/json/crud/unified/client-bulkWrite-errors.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"schemaVersion": "1.21",
44
"runOnRequirements": [
55
{
6-
"minServerVersion": "8.0"
6+
"minServerVersion": "8.0",
7+
"serverless": "forbid"
78
}
89
],
910
"createEntities": [

src/test/spec/json/crud/unified/client-bulkWrite-errors.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ description: "client bulkWrite errors"
22
schemaVersion: "1.21"
33
runOnRequirements:
44
- minServerVersion: "8.0"
5+
serverless: forbid
56

67
createEntities:
78
- client:

src/test/spec/json/crud/unified/client-bulkWrite-mixed-namespaces.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"description": "client bulkWrite with mixed namespaces",
3-
"schemaVersion": "1.1",
3+
"schemaVersion": "1.4",
44
"runOnRequirements": [
55
{
6-
"minServerVersion": "8.0"
6+
"minServerVersion": "8.0",
7+
"serverless": "forbid"
78
}
89
],
910
"createEntities": [

src/test/spec/json/crud/unified/client-bulkWrite-mixed-namespaces.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
description: "client bulkWrite with mixed namespaces"
2-
schemaVersion: "1.1"
2+
schemaVersion: "1.4" # To support `serverless: forbid`
33
runOnRequirements:
44
- minServerVersion: "8.0"
5+
serverless: forbid
56

67
createEntities:
78
- client:

src/test/spec/json/crud/unified/client-bulkWrite-options.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"description": "client bulkWrite top-level options",
3-
"schemaVersion": "1.1",
3+
"schemaVersion": "1.4",
44
"runOnRequirements": [
55
{
6-
"minServerVersion": "8.0"
6+
"minServerVersion": "8.0",
7+
"serverless": "forbid"
78
}
89
],
910
"createEntities": [

0 commit comments

Comments
 (0)