Skip to content

Commit e10849e

Browse files
committed
sync tests
1 parent 9b62815 commit e10849e

24 files changed

+3258
-329
lines changed

test/functional/crud_spec.test.js

+29
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const TestRunnerContext = require('./spec-runner').TestRunnerContext;
1010
const gatherTestSuites = require('./spec-runner').gatherTestSuites;
1111
const generateTopologyTests = require('./spec-runner').generateTopologyTests;
1212

13+
const { loadSpecTests } = require('../spec/index');
14+
const { runUnifiedTest } = require('./unified-spec-runner/runner');
15+
1316
function enforceServerVersionLimits(requires, scenario) {
1417
const versionLimits = [];
1518
if (scenario.minServerVersion) {
@@ -433,3 +436,29 @@ describe('CRUD v2', function () {
433436

434437
generateTopologyTests(testSuites, testContext);
435438
});
439+
440+
describe('CRUD unified', function () {
441+
for (const crudSpecTest of loadSpecTests('crud/unified')) {
442+
expect(crudSpecTest).to.exist;
443+
context(String(crudSpecTest.description), function () {
444+
for (const test of crudSpecTest.tests) {
445+
it(String(test.description), {
446+
metadata: { sessions: { skipLeakTests: true } },
447+
test: async function () {
448+
try {
449+
await runUnifiedTest(this, crudSpecTest, test);
450+
} catch (error) {
451+
if (error.message.includes('not implemented.')) {
452+
console.log(`${test.description}: was skipped due to missing functionality`);
453+
console.log(error.stack);
454+
this.skip();
455+
} else {
456+
throw error;
457+
}
458+
}
459+
}
460+
});
461+
}
462+
});
463+
}
464+
});

test/functional/cursor.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3600,7 +3600,7 @@ describe('Cursor', function () {
36003600
}
36013601
});
36023602

3603-
it('Correctly decorate the collection cursor count command with skip, limit, hint, readConcern', {
3603+
it.skip('Correctly decorate the collection count command with skip, limit, hint, readConcern', {
36043604
// Add a tag that our runner can trigger on
36053605
// in this case we are setting that node needs to be higher than 0.10.X to run
36063606
metadata: {

test/functional/retryable_reads.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('Retryable Reads', function () {
2424
spec.description.match(/listCollections/i) ||
2525
spec.description.match(/listCollectionNames/i) ||
2626
spec.description.match(/estimatedDocumentCount/i) ||
27-
spec.description.match(/count/i) ||
27+
// spec.description.match(/count/i) ||
2828
spec.description.match(/find/i)
2929
);
3030
});

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ReadPreference } from '../../../src/read_preference';
66
import { WriteConcern } from '../../../src/write_concern';
77
import { Document, InsertOneOptions } from '../../../src';
88
import { EventCollector } from '../../tools/utils';
9-
import { EntitiesMap, UnifiedMongoClient } from './entities';
9+
import { EntitiesMap } from './entities';
1010
import { expectErrorCheck, resultCheck } from './match';
1111
import type { OperationDescription } from './schema';
1212
import { CommandStartedEvent } from '../../../src/cmap/events';
@@ -384,7 +384,7 @@ operations.set('distinct', async ({ entities, operation }) => {
384384

385385
operations.set('estimatedDocumentCount', async ({ entities, operation }) => {
386386
const collection = entities.getEntity('collection', operation.object);
387-
return collection.estimatedDocumentCount();
387+
return collection.estimatedDocumentCount(operation.arguments);
388388
});
389389

390390
operations.set('findOneAndDelete', async ({ entities, operation }) => {

0 commit comments

Comments
 (0)