Skip to content

Commit f3a56dd

Browse files
committed
test: remove <4.1 and 4.2 logic or tests
1 parent e9e1336 commit f3a56dd

24 files changed

+467
-857
lines changed

test/integration/change-streams/change_stream.test.ts

Lines changed: 246 additions & 438 deletions
Large diffs are not rendered by default.

test/integration/change-streams/change_streams.prose.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ describe('Change Stream prose tests', function () {
603603
// - MUST NOT include a resumeAfter option
604604
// when resuming a change stream.
605605
it('$changeStream without results must include startAfter and not resumeAfter', {
606-
metadata: { requires: { topology: 'replicaset', mongodb: '>=4.1.1' } },
606+
metadata: { requires: { topology: 'replicaset' } },
607607
test: async function () {
608608
const events = [];
609609
client.on('commandStarted', e => recordEvent(events, e));
@@ -643,7 +643,7 @@ describe('Change Stream prose tests', function () {
643643
// - MUST NOT include a startAfter option
644644
// when resuming a change stream.
645645
it('$changeStream with results must include resumeAfter and not startAfter', {
646-
metadata: { requires: { topology: 'replicaset', mongodb: '>=4.1.1' } },
646+
metadata: { requires: { topology: 'replicaset' } },
647647
test: function (done) {
648648
let events = [];
649649
client.on('commandStarted', e => recordEvent(events, e));

test/integration/client-side-encryption/client_side_encryption.prose.06.corpus.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { getEncryptExtraOptions } from '../../tools/utils';
1414
describe('Client Side Encryption Prose Corpus Test', function () {
1515
const metadata = {
1616
requires: {
17-
mongodb: '>=4.2.0',
1817
clientSideEncryption: true as const
1918
}
2019
};

test/integration/client-side-encryption/client_side_encryption.prose.10.kms_tls.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { ClientEncryption, type MongoClient } from '../../mongodb';
55

66
const metadata: MongoDBMetadataUI = {
77
requires: {
8-
clientSideEncryption: true,
9-
mongodb: '>=4.2.0'
8+
clientSideEncryption: true
109
}
1110
};
1211

test/integration/client-side-encryption/client_side_encryption.prose.12.deadlock.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ function deadlockTest(
104104
const metadata: MongoDBMetadataUI = {
105105
requires: {
106106
clientSideEncryption: true,
107-
mongodb: '>=4.2.0',
108107
topology: '!load-balanced'
109108
}
110109
};

test/integration/client-side-encryption/client_side_encryption.prose.14.decryption_events.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { getEncryptExtraOptions } from '../../tools/utils';
1515
const metadata: MongoDBMetadataUI = {
1616
requires: {
1717
clientSideEncryption: true,
18-
mongodb: '>=4.2.0',
1918
topology: '!load-balanced'
2019
}
2120
};

test/integration/client-side-encryption/client_side_encryption.prose.26.custom_aws_credential_providers.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { getEncryptExtraOptions } from '../../tools/utils';
88
const metadata: MongoDBMetadataUI = {
99
requires: {
1010
clientSideEncryption: true,
11-
mongodb: '>=4.2.0',
1211
topology: '!load-balanced'
1312
}
1413
} as const;

test/integration/client-side-encryption/client_side_encryption.prose.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ const noop = () => {};
4343
const metadata = {
4444
requires: {
4545
clientSideEncryption: true,
46-
mongodb: '>=4.2.0',
4746
topology: '!load-balanced'
4847
}
4948
};

test/integration/client-side-encryption/driver.test.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import { filterForCommands } from '../shared';
3333

3434
const metadata: MongoDBMetadataUI = {
3535
requires: {
36-
mongodb: '>=4.2.0',
3736
clientSideEncryption: true
3837
}
3938
};
@@ -699,7 +698,6 @@ describe('CSOT', function () {
699698

700699
const metadata: MongoDBMetadataUI = {
701700
requires: {
702-
mongodb: '>=4.2.0',
703701
clientSideEncryption: true
704702
}
705703
};
@@ -802,12 +800,6 @@ describe('CSOT', function () {
802800

803801
const timeoutMS = 1000;
804802

805-
const metadata: MongoDBMetadataUI = {
806-
requires: {
807-
mongodb: '>=4.2.0'
808-
}
809-
};
810-
811803
describe('#markCommand', function () {
812804
context(
813805
'when csot is enabled and markCommand() takes longer than the remaining timeoutMS',
@@ -837,7 +829,7 @@ describe('CSOT', function () {
837829
sinon.restore();
838830
});
839831

840-
it('the command should fail due to a timeout error', metadata, async function () {
832+
it('the command should fail due to a timeout error', async function () {
841833
const { duration, result: error } = await measureDuration(() =>
842834
stateMachine
843835
.markCommand(

test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts

Lines changed: 43 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -115,59 +115,55 @@ describe('CSOT spec prose tests', function () {
115115
});
116116
});
117117

118-
context(
119-
'2. maxTimeMS is not set for commands sent to mongocryptd',
120-
{ requires: { mongodb: '>=4.2' } },
121-
() => {
122-
/**
123-
* This test MUST only be run against enterprise server versions 4.2 and higher.
124-
*
125-
* 1. Launch a mongocryptd process on 23000.
126-
* 1. Create a MongoClient (referred to as `client`) using the URI `mongodb://localhost:23000/?timeoutMS=1000`.
127-
* 1. Using `client`, execute the `{ ping: 1 }` command against the `admin` database.
128-
* 1. Verify via command monitoring that the `ping` command sent did not contain a `maxTimeMS` field.
129-
*/
118+
context('2. maxTimeMS is not set for commands sent to mongocryptd', () => {
119+
/**
120+
* This test MUST only be run against enterprise server versions 4.2 and higher.
121+
*
122+
* 1. Launch a mongocryptd process on 23000.
123+
* 1. Create a MongoClient (referred to as `client`) using the URI `mongodb://localhost:23000/?timeoutMS=1000`.
124+
* 1. Using `client`, execute the `{ ping: 1 }` command against the `admin` database.
125+
* 1. Verify via command monitoring that the `ping` command sent did not contain a `maxTimeMS` field.
126+
*/
130127

131-
let client: MongoClient;
132-
const mongocryptdTestPort = '23000';
133-
let childProcess: ChildProcess;
128+
let client: MongoClient;
129+
const mongocryptdTestPort = '23000';
130+
let childProcess: ChildProcess;
134131

135-
beforeEach(async function () {
136-
const pidFile = path.join(os.tmpdir(), new ObjectId().toHexString());
137-
childProcess = spawn(
138-
'mongocryptd',
139-
['--port', mongocryptdTestPort, '--ipv6', '--pidfilepath', pidFile],
140-
{
141-
stdio: 'ignore',
142-
detached: true
143-
}
144-
);
132+
beforeEach(async function () {
133+
const pidFile = path.join(os.tmpdir(), new ObjectId().toHexString());
134+
childProcess = spawn(
135+
'mongocryptd',
136+
['--port', mongocryptdTestPort, '--ipv6', '--pidfilepath', pidFile],
137+
{
138+
stdio: 'ignore',
139+
detached: true
140+
}
141+
);
145142

146-
childProcess.on('error', error => console.warn(this.currentTest?.fullTitle(), error));
147-
client = new MongoClient(`mongodb://localhost:${mongocryptdTestPort}/?timeoutMS=1000`, {
148-
monitorCommands: true
149-
});
143+
childProcess.on('error', error => console.warn(this.currentTest?.fullTitle(), error));
144+
client = new MongoClient(`mongodb://localhost:${mongocryptdTestPort}/?timeoutMS=1000`, {
145+
monitorCommands: true
150146
});
147+
});
151148

152-
afterEach(async function () {
153-
await client.close();
154-
childProcess.kill('SIGKILL');
155-
sinon.restore();
156-
});
149+
afterEach(async function () {
150+
await client.close();
151+
childProcess.kill('SIGKILL');
152+
sinon.restore();
153+
});
157154

158-
it('maxTimeMS is not set', async function () {
159-
const commandStarted = [];
160-
client.on('commandStarted', ev => commandStarted.push(ev));
161-
await client.connect();
162-
await client
163-
.db('admin')
164-
.command({ ping: 1 })
165-
.catch(e => squashError(e));
166-
expect(commandStarted).to.have.lengthOf(1);
167-
expect(commandStarted[0].command).to.not.have.property('maxTimeMS');
168-
});
169-
}
170-
);
155+
it('maxTimeMS is not set', async function () {
156+
const commandStarted = [];
157+
client.on('commandStarted', ev => commandStarted.push(ev));
158+
await client.connect();
159+
await client
160+
.db('admin')
161+
.command({ ping: 1 })
162+
.catch(e => squashError(e));
163+
expect(commandStarted).to.have.lengthOf(1);
164+
expect(commandStarted[0].command).to.not.have.property('maxTimeMS');
165+
});
166+
});
171167

172168
context('3. ClientEncryption', () => {
173169
/**

0 commit comments

Comments
 (0)