Skip to content

Commit 4f0bb3d

Browse files
retryable reads done
1 parent 4229dc4 commit 4f0bb3d

File tree

2 files changed

+8
-38
lines changed

2 files changed

+8
-38
lines changed

test/integration/retryable-reads/retryable_reads.spec.test.ts

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,21 @@
11
import * as path from 'path';
22

33
import { loadSpecTests } from '../../spec';
4-
import { generateTopologyTests, TestRunnerContext } from '../../tools/spec-runner';
54
import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner';
65

7-
describe('Retryable Reads (legacy)', function () {
8-
const testContext = new TestRunnerContext();
9-
const testSuites = loadSpecTests(path.join('retryable-reads', 'legacy'));
10-
11-
after(() => testContext.teardown());
12-
13-
before(function () {
14-
return testContext.setup(this.configuration);
15-
});
16-
17-
generateTopologyTests(testSuites, testContext, spec => {
18-
const shouldRun =
19-
spec.description.match(/distinct/i) ||
20-
spec.description.match(/aggregate/i) ||
21-
spec.description.match(/countDocuments/i) ||
22-
spec.description.match(/listIndexes/i) ||
23-
spec.description.match(/listDatabases/i) ||
24-
spec.description.match(/listDatabaseNames/i) ||
25-
spec.description.match(/listCollections/i) ||
26-
spec.description.match(/listCollectionNames/i) ||
27-
spec.description.match(/estimatedDocumentCount/i) ||
28-
spec.description.match(/count/i) ||
29-
spec.description.match(/find/i);
30-
31-
if (!shouldRun) {
32-
return 'Test skipped by generic filter.';
33-
}
34-
35-
return true;
36-
});
37-
});
38-
396
const UNIMPLEMENTED_APIS = [
40-
'collection.listIndexNames',
41-
'database.listCollectionNames',
42-
'client.listDatabaseNames'
7+
'listIndexNames',
8+
'listCollectionNames',
9+
'listDatabaseNames',
10+
'mapReduce',
11+
'listCollectionObjects',
12+
'listDatabaseObjects'
4313
];
4414

4515
describe('Retryable Reads (unified)', function () {
4616
runUnifiedSuite(loadSpecTests(path.join('retryable-reads', 'unified')), ({ description }) => {
4717
for (const apiName of UNIMPLEMENTED_APIS) {
48-
if (description.startsWith(apiName)) {
18+
if (description.toLowerCase().includes(apiName.toLowerCase())) {
4919
return `The Node.js Driver does not support ${apiName}`;
5020
}
5121
}

test/tools/unified-spec-runner/operations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ operations.set('iterateOnce', async ({ entities, operation }) => {
386386

387387
operations.set('listCollections', async ({ entities, operation }) => {
388388
const db = entities.getEntity('db', operation.object);
389-
const { filter, ...opts } = operation.arguments!;
389+
const { filter, ...opts } = operation.arguments ?? { filter: {} };
390390
return db.listCollections(filter, opts).toArray();
391391
});
392392

0 commit comments

Comments
 (0)