Skip to content

Commit 458cf6d

Browse files
test(NODE-5898): small fixes and unskips of test TODOs (#4055)
1 parent f842c20 commit 458cf6d

File tree

13 files changed

+99
-167
lines changed

13 files changed

+99
-167
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,6 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
11741174

11751175
expect(insertError).to.be.instanceOf(MongoServerSelectionError);
11761176

1177-
// TODO(NODE-5296): check error.message once AggregateErrors are handled correctly
11781177
expect(insertError, 'Error must contain ECONNREFUSED').to.satisfy(
11791178
error =>
11801179
/ECONNREFUSED/.test(error.message) ||
@@ -1260,7 +1259,6 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
12601259
client = new MongoClient('mongodb://localhost:27021/db?serverSelectionTimeoutMS=1000');
12611260
const error = await client.connect().catch(e => e);
12621261

1263-
// TODO(NODE-5296): check error.message once AggregateErrors are handled correctly
12641262
expect(error, 'Error MUST be a MongoServerSelectionError error').to.be.instanceOf(
12651263
MongoServerSelectionError
12661264
);

test/integration/client-side-encryption/client_side_encryption.spec.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ const skippedAuthTests = [
4747
'Insert a document with auto encryption using KMIP KMS provider'
4848
];
4949

50-
// TODO(NODE-4006): Investigate csfle test "operation fails with maxWireVersion < 8"
51-
// TODO(NODE-4324): Int32 and Long not allowed as batchSize option to cursor.
52-
const skippedNoAuthTests = ['getMore with encryption', 'operation fails with maxWireVersion < 8'];
50+
// TODO(NODE-6048): Int32 and Long not allowed as batchSize option to cursor.
51+
const skippedNoAuthTests = ['getMore with encryption'];
5352

5453
const SKIPPED_TESTS = new Set([
5554
...(isAuthEnabled ? skippedAuthTests.concat(skippedNoAuthTests) : skippedNoAuthTests),

test/integration/command-logging-and-monitoring/command_logging_and_monitoring.spec.test.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,23 @@ import * as path from 'path';
33
import { loadSpecTests } from '../../spec';
44
import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner';
55

6-
// This is skipped because our command monitoring happens at the connection
7-
// level and is using the server reply for the single insert that the bulk
8-
// performed since it was only one document in the test. The test expectation
9-
// is that we are using the bulk write result which was returned to the user
10-
// as the reply in the command succeeded event instead of our raw reply from
11-
// the server. There's nothing we can change here.
12-
const SKIP = ['A successful unordered bulk write with an unacknowledged write concern'];
13-
146
describe('Command Logging and Monitoring Spec', function () {
157
describe('Command Monitoring Spec (unified)', () => {
168
runUnifiedSuite(
179
loadSpecTests(path.join('command-logging-and-monitoring', 'monitoring')),
18-
({ description }) =>
19-
SKIP.includes(description)
20-
? `TODO(NODE-4261): support skip reasons in unified tests`
21-
: false
10+
({ description }) => {
11+
// This is skipped because our command monitoring happens at the connection
12+
// level and is using the server reply for the single insert that the bulk
13+
// performed since it was only one document in the test. The test expectation
14+
// is that we are using the bulk write result which was returned to the user
15+
// as the reply in the command succeeded event instead of our raw reply from
16+
// the server. There's nothing we can change here.
17+
return description.includes(
18+
'A successful unordered bulk write with an unacknowledged write concern'
19+
)
20+
? `Test not applicable to Node.`
21+
: false;
22+
}
2223
);
2324
});
2425

test/integration/command-logging-and-monitoring/command_monitoring.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ describe('Command Monitoring', function () {
9898
}
9999
});
100100

101-
// NODE-3308
102-
it.skip('should correctly receive the APM events for a listIndexes command', {
101+
it('should correctly receive the APM events for a listIndexes command', {
103102
metadata: { requires: { topology: ['replicaset'], mongodb: '>=3.0.0' } },
104103

105104
test: function () {

test/integration/crud/aggregation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ describe('Aggregation', function () {
332332
});
333333
});
334334
}
335-
).skipReason = 'TODO(NODE-5617): aggregate explain tests failing on latest servers';
335+
);
336336

337337
it('should correctly return a cursor with batchSize 1 and call next', function (done) {
338338
const client = this.configuration.newClient({ w: 1 }, { maxPoolSize: 1 }),

test/integration/crud/explain.test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { expect } from 'chai';
22
import { once } from 'events';
3-
import { gte } from 'semver';
43

54
import {
65
type Collection,
@@ -76,17 +75,6 @@ describe('CRUD API explain option', function () {
7675
collection = db.collection('test');
7776
await collection.insertOne({ a: 1 });
7877
commandStartedPromise = once(client, 'commandStarted');
79-
80-
const test = this.currentTest;
81-
if (
82-
test?.fullTitle().includes('aggregate') &&
83-
gte(this.configuration.version, '7.1.0') &&
84-
this.currentTest
85-
) {
86-
this.currentTest.skipReason =
87-
'TODO(NODE-5617): aggregate explain tests failing on latest servers';
88-
this.skip();
89-
}
9078
});
9179

9280
afterEach(async function () {

test/integration/load-balancers/load_balancers.spec.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const filter = ({ description }) => {
88
// Verified they use the same connection but the Node implementation executes
99
// a getMore before the killCursors even though the stream is immediately
1010
// closed.
11-
// TODO(NODE-3970): implement and reference a node specific integration test for this
1211
return 'TODO(NODE-3970): implement and reference a node specific integration test for this';
1312
}
1413

test/integration/node-specific/client_encryption.test.ts

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -264,63 +264,6 @@ describe('ClientEncryption integration tests', function () {
264264
expect(rewrapManyDataKeyResult.bulkWriteResult).to.equal(undefined);
265265
});
266266

267-
it.skip(
268-
'should explicitly encrypt and decrypt with a re-wrapped local key (explicit session/transaction)',
269-
metadata,
270-
function () {
271-
const encryption = new ClientEncryption(client, {
272-
keyVaultNamespace: 'client.encryption',
273-
kmsProviders: { local: { key: 'A'.repeat(128) } }
274-
});
275-
let encrypted;
276-
let rewrapManyDataKeyResult;
277-
278-
return encryption
279-
.createDataKey('local')
280-
.then(dataKey => {
281-
const encryptOptions = {
282-
keyId: dataKey,
283-
algorithm: 'Indexed',
284-
contentionFactor: 0
285-
};
286-
287-
return encryption.encrypt('hello', encryptOptions);
288-
})
289-
.then(_encrypted => {
290-
encrypted = _encrypted;
291-
})
292-
.then(() => {
293-
// withSession does not forward the callback's return value, hence
294-
// the slightly awkward 'rewrapManyDataKeyResult' passing here
295-
return client.withSession(session => {
296-
return session.withTransaction(() => {
297-
expect(session.transaction.isStarting).to.equal(true);
298-
expect(session.transaction.isActive).to.equal(true);
299-
rewrapManyDataKeyResult = encryption.rewrapManyDataKey(
300-
{},
301-
{ provider: 'local', session }
302-
);
303-
return rewrapManyDataKeyResult.then(() => {
304-
// Verify that the 'session' argument was actually used
305-
expect(session.transaction.isStarting).to.equal(false);
306-
expect(session.transaction.isActive).to.equal(true);
307-
});
308-
});
309-
});
310-
})
311-
.then(() => {
312-
return rewrapManyDataKeyResult;
313-
})
314-
.then(rewrapManyDataKeyResult => {
315-
expect(rewrapManyDataKeyResult.bulkWriteResult.result.nModified).to.equal(1);
316-
return encryption.decrypt(encrypted);
317-
})
318-
.then(decrypted => {
319-
expect(decrypted).to.equal('hello');
320-
});
321-
}
322-
).skipReason = 'TODO(DRIVERS-2389): add explicit session support to key management API';
323-
324267
// TODO(NODE-3371): resolve KMS JSON response does not include string 'Plaintext'. HTTP status=200 error
325268
it.skip(
326269
'should explicitly encrypt and decrypt with the "aws" KMS provider',

test/integration/node-specific/crypto_callbacks.test.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,11 @@ describe('cryptoCallbacks', function () {
5454
await client?.close();
5555
});
5656

57-
// TODO(NODE-3370): fix key formatting error "asn1_check_tlen:wrong tag"
58-
it.skip('should support support crypto callback for signing RSA-SHA256', function () {
57+
it('should support support crypto callback for signing RSA-SHA256', function () {
5958
const input = Buffer.from('data to sign');
6059
const pemFileData =
61-
'-----BEGIN PRIVATE KEY-----\n' +
62-
'MIIEvgIBADANBgkqhki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APYVXQAO0fIsHF/T0a\n';
61+
const key = Buffer.from(pemFileData, 'base64');
6562
const output = Buffer.alloc(256);
6663
const expectedOutput = Buffer.from(
6764
'VocBRhpMmQ2XCzVehWSqheQLnU889gf3dhU4AnVnQTJjsKx/CM23qKDPkZDd2A/BnQsp99SN7ksIX5Raj0TPwyN5OCN/YrNFNGoOFlTsGhgP/hyE8X3Duiq6sNO0SMvRYNPFFGlJFsp1Fw3Z94eYMg4/Wpw5s4+Jo5Zm/qY7aTJIqDKDQ3CNHLeJgcMUOc9sz01/GzoUYKDVODHSxrYEk5ireFJFz9vP8P7Ha+VDUZuQIQdXer9NBbGFtYmWprY3nn4D3Dw93Sn0V0dIqYeIo91oKyslvMebmUM95S2PyIJdEpPb2DJDxjvX/0LLwSWlSXRWy9gapWoBkb4ynqZBsg==',
@@ -75,7 +72,7 @@ describe('cryptoCallbacks', function () {
7572
}
7673

7774
expect(output).to.deep.equal(expectedOutput);
78-
}).skipReason = 'TODO(NODE-3370): fix key formatting error "asn1_check_tlen:wrong tag"';
75+
});
7976

8077
it('should invoke crypto callbacks when doing encryption', async function () {
8178
function assertCertainHooksCalled(expectedSet?) {

test/integration/unified-test-format/unified_test_format.spec.test.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner';
33
import { type TestFilter } from '../../tools/unified-spec-runner/schema';
44

55
const filter: TestFilter = ({ description }) => {
6-
if (description === 'unpin after transient error within a transaction and commit') {
7-
// OLD COMMENT: commitTransaction retry seems to be swallowed by mongos in this case
8-
// TODO(NODE-3943):
9-
return `TODO(NODE-3943): commitTransaction retry seems to be swallowed by mongos in this case`;
10-
}
11-
126
if (description === 'Client side error in command starting transaction') {
137
// TODO(NODE-2034): Will be implemented as part of NODE-2034
148
return 'TODO(NODE-2034): Specify effect of client-side errors on in-progress transactions';
@@ -19,10 +13,6 @@ const filter: TestFilter = ({ description }) => {
1913
return 'TODO(NODE-3951): investigate why this is failing while the legacy version is passing';
2014
}
2115

22-
if (description === 'A successful find event with a getmore and the server kills the cursor') {
23-
return 'TODO(NODE-3308): failures due unnecessary getMore and killCursors calls in 5.0';
24-
}
25-
2616
if (
2717
[
2818
'withTransaction and no transaction options set',
@@ -34,7 +24,7 @@ const filter: TestFilter = ({ description }) => {
3424
'remain pinned after non-transient Interrupted error on insertOne'
3525
].includes(description)
3626
) {
37-
return 'TODO(DRIVERS-2816): fix migration conflict in transaction tests';
27+
return 'TODO(NODE-5962): fix migration conflict in transaction tests';
3828
}
3929

4030
if (

0 commit comments

Comments
 (0)