Skip to content

Commit 7ec1898

Browse files
All non-lb or TLS tests
1 parent c2cff31 commit 7ec1898

File tree

4 files changed

+11
-69
lines changed

4 files changed

+11
-69
lines changed

test/integration/causal-consistency/causal_consistency.prose.test.js

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,22 @@ const { LEGACY_HELLO_COMMAND } = require('../../mongodb');
44

55
const { setupDatabase } = require('../shared');
66
const { expect } = require('chai');
7-
const { skipBrokenAuthTestBeforeEachHook } = require('../../tools/runner/hooks/configuration');
87

98
const ignoredCommands = [LEGACY_HELLO_COMMAND, 'endSessions'];
109
const test = { commands: { started: [], succeeded: [] } };
1110

1211
// TODO(NODE-3882) - properly implement all prose tests and add missing cases 1, 8, 9, 11, 12
13-
describe('Causal Consistency - prose tests', function () {
12+
describe.only('Causal Consistency - prose tests', function () {
1413
before(function () {
1514
return setupDatabase(this.configuration);
1615
});
1716

18-
beforeEach(
19-
skipBrokenAuthTestBeforeEachHook({
20-
skippedTests: [
21-
'2. The first read in a causally consistent session must not send afterClusterTime to the server',
22-
'case: successful read with causal consistency',
23-
'case: second operation is findOne',
24-
'case: successful insert',
25-
'6. A read operation in a ClientSession that is not causally consistent should not include the afterClusterTime parameter in the command sent to the server'
26-
]
27-
})
28-
);
29-
3017
beforeEach(function () {
3118
test.commands = { started: [], succeeded: [] };
32-
test.client = this.configuration.newClient({ w: 1 }, { maxPoolSize: 1, monitorCommands: true });
19+
test.client = this.configuration.newClient(
20+
{ w: 1 },
21+
{ maxPoolSize: 1, monitorCommands: true, __skipPingOnConnect: true }
22+
);
3323
test.client.on('commandStarted', event => {
3424
if (ignoredCommands.indexOf(event.commandName) === -1) test.commands.started.push(event);
3525
});

test/integration/connection-monitoring-and-pooling/connection.test.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
Topology
2222
} from '../../mongodb';
2323
import * as mock from '../../tools/mongodb-mock/index';
24-
import { skipBrokenAuthTestBeforeEachHook } from '../../tools/runner/hooks/configuration';
2524
import { processTick, sleep } from '../../tools/utils';
2625
import { assert as test, setupDatabase } from '../shared';
2726

@@ -37,15 +36,6 @@ const commonConnectOptions = {
3736
};
3837

3938
describe('Connection', function () {
40-
beforeEach(
41-
skipBrokenAuthTestBeforeEachHook({
42-
skippedTests: [
43-
'should support calling back multiple times on exhaust commands',
44-
'should correctly connect to server using domain socket'
45-
]
46-
})
47-
);
48-
4939
before(function () {
5040
return setupDatabase(this.configuration);
5141
});
@@ -187,7 +177,10 @@ describe('Connection', function () {
187177
const configuration = this.configuration;
188178
client = configuration.newClient(
189179
`mongodb://${encodeURIComponent('/tmp/mongodb-27017.sock')}?w=1`,
190-
{ maxPoolSize: 1 }
180+
{
181+
maxPoolSize: 1,
182+
auth: { ...this.configuration.options.auth }
183+
}
191184
);
192185

193186
const db = client.db(configuration.db);

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

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { expect } from 'chai';
2-
import { format as f } from 'util';
32

43
import {
54
Code,
@@ -8,7 +7,6 @@ import {
87
ProfilingLevel,
98
ReturnDocument
109
} from '../../mongodb';
11-
import { skipBrokenAuthTestBeforeEachHook } from '../../tools/runner/hooks/configuration';
1210
import { sleep as delay } from '../../tools/utils';
1311
import { setupDatabase } from '../shared';
1412

@@ -27,16 +25,6 @@ describe('Operations', function () {
2725
return setupDatabase(this.configuration, ['integration_tests_2', 'hr', 'reporting']);
2826
});
2927

30-
beforeEach(
31-
skipBrokenAuthTestBeforeEachHook({
32-
skippedTests: [
33-
'Should correctly connect to a replicaset',
34-
'Should connect to mongos proxies using connectiong string With Promises',
35-
'Should correctly connect to a replicaset With Promises'
36-
]
37-
})
38-
);
39-
4028
/**************************************************************************
4129
*
4230
* COLLECTION TESTS
@@ -3244,14 +3232,7 @@ describe('Operations', function () {
32443232

32453233
test: function () {
32463234
const configuration = this.configuration;
3247-
const url = f(
3248-
'mongodb://%s,%s/%s?replicaSet=%s&readPreference=%s',
3249-
f('%s:%s', configuration.host, configuration.port),
3250-
f('%s:%s', configuration.host, configuration.port + 1),
3251-
'integration_test_',
3252-
configuration.replicasetName,
3253-
'primary'
3254-
);
3235+
const url = configuration.url();
32553236

32563237
const client = configuration.newClient(url);
32573238
return client.connect().then(function (client) {
@@ -3291,13 +3272,7 @@ describe('Operations', function () {
32913272

32923273
test: function () {
32933274
const configuration = this.configuration;
3294-
const url = f(
3295-
'mongodb://%s:%s,%s:%s/sharded_test_db?w=1',
3296-
configuration.host,
3297-
configuration.port,
3298-
configuration.host,
3299-
configuration.port + 1
3300-
);
3275+
const url = configuration.url();
33013276

33023277
const client = configuration.newClient(url);
33033278
return client.connect().then(function (client) {

test/tools/runner/hooks/configuration.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,6 @@ const testSkipBeforeEachHook = async function () {
107107
}
108108
};
109109

110-
/**
111-
* TODO: NODE-3891 - fix tests that are broken with auth enabled and remove this hook
112-
* @param skippedTests - define list of tests to skip
113-
* @returns
114-
*/
115-
export const skipBrokenAuthTestBeforeEachHook = function (
116-
{ skippedTests }: { skippedTests: string[] } = { skippedTests: [] }
117-
) {
118-
return function () {
119-
if (process.env.AUTH === 'auth' && skippedTests.includes(this.currentTest.title)) {
120-
this.currentTest.skipReason = 'TODO: NODE-3891 - fix tests broken when AUTH enabled';
121-
this.skip();
122-
}
123-
};
124-
};
125-
126110
const testConfigBeforeHook = async function () {
127111
if (process.env.DRIVERS_ATLAS_TESTING_URI) {
128112
this.configuration = new AstrolabeTestConfiguration(process.env.DRIVERS_ATLAS_TESTING_URI, {});

0 commit comments

Comments
 (0)