Skip to content

Commit 0202106

Browse files
committed
Fix test failures due to wrong merge
1 parent 3d3473c commit 0202106

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

.evergreen/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ AUTH=${AUTH:-noauth}
1212
SSL=${SSL:-nossl}
1313
MONGODB_URI=${MONGODB_URI:-}
1414
TESTS=${TESTS:-}
15-
IS_MATRIX_TESTING=${IS_MATRIX_TESTING:-false}
15+
IS_MATRIX_TESTING=${IS_MATRIX_TESTING:-}
1616

1717
# For matrix testing, we have to determine the correct driver version
1818
if [ "$IS_MATRIX_TESTING" == "true" ]; then

tests/SpecTests/ClientSideEncryptionSpecTest.php

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,14 @@ public function testExternalKeyVault($withExternalKeyVault)
320320
$client = $this->getContext()->getClient();
321321
$client->selectCollection('db', 'coll')->drop();
322322

323-
$keyId = $client
324-
->selectCollection('keyvault', 'datakeys')
325-
->insertOne(
326-
$this->decodeJson(file_get_contents(__DIR__ . '/client-side-encryption/external/external-key.json')),
327-
['writeConcern' => new WriteConcern(WriteConcern::MAJORITY)]
328-
)
323+
$keyVaultCollection = $client->selectCollection(
324+
'keyvault',
325+
'datakeys',
326+
['writeConcern' => new WriteConcern(WriteConcern::MAJORITY)] + $this->getContext()->defaultWriteOptions
327+
);
328+
$keyVaultCollection->drop();
329+
$keyId = $keyVaultCollection
330+
->insertOne($this->decodeJson(file_get_contents(__DIR__ . '/client-side-encryption/external/external-key.json')))
329331
->getInsertedId();
330332

331333
$encryptionOpts = [
@@ -400,14 +402,15 @@ function () use ($collection) {
400402
]);
401403
},
402404
function ($command) use (&$commands) {
405+
if ($command['started']->getCommandName() !== 'insert') {
406+
return;
407+
}
408+
403409
$commands[] = $command;
404410
}
405411
);
406412

407413
$test->assertCount(2, $commands);
408-
foreach ($commands as $command) {
409-
$test->assertSame('insert', $command['started']->getCommandName());
410-
}
411414
},
412415
];
413416

@@ -428,14 +431,15 @@ function () use ($collection, $document) {
428431
]);
429432
},
430433
function ($command) use (&$commands) {
434+
if ($command['started']->getCommandName() !== 'insert') {
435+
return;
436+
}
437+
431438
$commands[] = $command;
432439
}
433440
);
434441

435442
$test->assertCount(2, $commands);
436-
foreach ($commands as $command) {
437-
$test->assertSame('insert', $command['started']->getCommandName());
438-
}
439443
},
440444
];
441445

0 commit comments

Comments
 (0)