Skip to content

Commit 9578fa8

Browse files
ready for PR i think
1 parent 9a7b6f1 commit 9578fa8

File tree

7 files changed

+1059
-3
lines changed

7 files changed

+1059
-3
lines changed

test/integration/server-discovery-and-monitoring/server_discovery_and_monitoring.spec.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import * as path from 'path';
33
import { loadSpecTests } from '../../spec';
44
import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner';
55

6-
describe.only('SDAM Unified Tests', function () {
6+
describe('SDAM Unified Tests', function () {
77
runUnifiedSuite(loadSpecTests(path.join('server-discovery-and-monitoring', 'unified')));
88
});

test/integration/server-selection/server_selection.spec.test.ts

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

6-
describe('Server Selection Tests - Unified', function () {
6+
describe('Server Selection Unified Tests (Spec)', function () {
77
const tests = loadSpecTests(path.join('server-selection', 'logging'));
88
runUnifiedSuite(tests, test => {
99
if (
@@ -14,6 +14,6 @@ describe('Server Selection Tests - Unified', function () {
1414
) {
1515
return 'not applicable: operationId not supported';
1616
}
17-
return false;
17+
return 'TODO: NODE-2471 (ping on connect) and NODE-5774 (duplicate server selection for bulkWrite and other wrapper operations)';
1818
});
1919
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { loadSpecTests } from '../../spec';
2+
import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner';
3+
4+
describe('Server Selection Unified Tests (Node Driver)', function () {
5+
/* TODO(NODE-2471) ping on connect
6+
* TODO(NODE-5774) duplicate server selection for bulkWrite and other wrapper operations
7+
* Remove once the actual unified tests (test/spec/server-selection/logging) are passing
8+
*/
9+
const clonedAndAlteredSpecTests = loadSpecTests(
10+
'../integration/server-selection/unified-server-selection-node-specs-logging'
11+
);
12+
runUnifiedSuite(clonedAndAlteredSpecTests);
13+
});
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"description": "server-selection-logging-node-driver",
3+
"schemaVersion": "1.13",
4+
"runOnRequirements": [
5+
{
6+
"topologies": [
7+
"load-balanced"
8+
]
9+
}
10+
],
11+
"createEntities": [
12+
{
13+
"client": {
14+
"id": "client",
15+
"uriOptions": {
16+
"heartbeatFrequencyMS": 500
17+
},
18+
"observeLogMessages": {
19+
"serverSelection": "debug"
20+
},
21+
"observeEvents": [
22+
"serverDescriptionChangedEvent"
23+
]
24+
}
25+
},
26+
{
27+
"database": {
28+
"id": "database",
29+
"client": "client",
30+
"databaseName": "logging-tests"
31+
}
32+
},
33+
{
34+
"collection": {
35+
"id": "collection",
36+
"database": "database",
37+
"collectionName": "server-selection"
38+
}
39+
}
40+
],
41+
"tests": [
42+
{
43+
"description": "A successful operation - load balanced cluster",
44+
"operations": [
45+
{
46+
"name": "waitForEvent",
47+
"object": "testRunner",
48+
"arguments": {
49+
"client": "client",
50+
"event": {
51+
"serverDescriptionChangedEvent": {
52+
"newDescription": {
53+
"type": "LoadBalancer"
54+
}
55+
}
56+
},
57+
"count": 1
58+
}
59+
},
60+
{
61+
"name": "insertOne",
62+
"object": "collection",
63+
"arguments": {
64+
"document": {
65+
"x": 1
66+
}
67+
}
68+
}
69+
],
70+
"expectLogMessages": [
71+
{
72+
"client": "client",
73+
"messages": [
74+
{
75+
"level": "debug",
76+
"component": "serverSelection",
77+
"data": {
78+
"message": "Server selection started",
79+
"selector": {
80+
"$$exists": true
81+
},
82+
"operation": "ping",
83+
"topologyDescription": {
84+
"$$exists": true
85+
}
86+
}
87+
},
88+
{
89+
"level": "debug",
90+
"component": "serverSelection",
91+
"data": {
92+
"message": "Server selection succeeded",
93+
"selector": {
94+
"$$exists": true
95+
},
96+
"operation": "ping",
97+
"topologyDescription": {
98+
"$$exists": true
99+
}
100+
}
101+
},
102+
{
103+
"level": "debug",
104+
"component": "serverSelection",
105+
"data": {
106+
"message": "Server selection started",
107+
"selector": {
108+
"$$exists": true
109+
},
110+
"operation": "insert",
111+
"topologyDescription": {
112+
"$$exists": true
113+
}
114+
}
115+
},
116+
{
117+
"level": "debug",
118+
"component": "serverSelection",
119+
"data": {
120+
"message": "Server selection succeeded",
121+
"selector": {
122+
"$$exists": true
123+
},
124+
"operation": "insert",
125+
"topologyDescription": {
126+
"$$exists": true
127+
}
128+
}
129+
}
130+
]
131+
}
132+
]
133+
}
134+
]
135+
}

0 commit comments

Comments
 (0)