Skip to content

Commit 890e805

Browse files
committed
skip correct tests and update runner
1 parent 58349b6 commit 890e805

File tree

5 files changed

+14
-69
lines changed

5 files changed

+14
-69
lines changed

test/spec/server-discovery-and-monitoring/unified/replicaset-emit-topology-changed-before-close.json

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -57,44 +57,16 @@
5757
"topologyOpeningEvent": {}
5858
},
5959
{
60-
"topologyDescriptionChangedEvent": {
61-
"previousDescription": {
62-
"type": "Unknown"
63-
},
64-
"newDescription": {
65-
"type": "ReplicaSetNoPrimary"
66-
}
67-
}
60+
"topologyDescriptionChangedEvent": {}
6861
},
6962
{
70-
"topologyDescriptionChangedEvent": {
71-
"previousDescription": {
72-
"type": "ReplicaSetNoPrimary"
73-
},
74-
"newDescription": {
75-
"type": "ReplicaSetWithPrimary"
76-
}
77-
}
63+
"topologyDescriptionChangedEvent": {}
7864
},
7965
{
80-
"topologyDescriptionChangedEvent": {
81-
"previousDescription": {
82-
"type": "ReplicaSetWithPrimary"
83-
},
84-
"newDescription": {
85-
"type": "ReplicaSetWithPrimary"
86-
}
87-
}
66+
"topologyDescriptionChangedEvent": {}
8867
},
8968
{
90-
"topologyDescriptionChangedEvent": {
91-
"previousDescription": {
92-
"type": "ReplicaSetWithPrimary"
93-
},
94-
"newDescription": {
95-
"type": "ReplicaSetWithPrimary"
96-
}
97-
}
69+
"topologyDescriptionChangedEvent": {}
9870
},
9971
{
10072
"topologyDescriptionChangedEvent": {

test/spec/server-discovery-and-monitoring/unified/replicaset-emit-topology-changed-before-close.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,10 @@ tests:
3737
ignoreExtraEvents: false
3838
events:
3939
- topologyOpeningEvent: {}
40-
- topologyDescriptionChangedEvent: # unknown -> replset no primary
41-
previousDescription:
42-
type: "Unknown"
43-
newDescription:
44-
type: "ReplicaSetNoPrimary"
45-
- topologyDescriptionChangedEvent: # server connected
46-
previousDescription:
47-
type: "ReplicaSetNoPrimary"
48-
newDescription:
49-
type: "ReplicaSetWithPrimary"
50-
- topologyDescriptionChangedEvent: # server connected
51-
previousDescription:
52-
type: "ReplicaSetWithPrimary"
53-
newDescription:
54-
type: "ReplicaSetWithPrimary"
55-
- topologyDescriptionChangedEvent: # server connected
56-
previousDescription:
57-
type: "ReplicaSetWithPrimary"
58-
newDescription:
59-
type: "ReplicaSetWithPrimary"
40+
- topologyDescriptionChangedEvent: {} # unknown -> replset no primary
41+
- topologyDescriptionChangedEvent: {} # server connected
42+
- topologyDescriptionChangedEvent: {} # server connected
43+
- topologyDescriptionChangedEvent: {} # server connected
6044
- topologyDescriptionChangedEvent: # replicaset -> unknown
6145
previousDescription:
6246
type: "ReplicaSetWithPrimary"

test/spec/server-discovery-and-monitoring/unified/standalone-emit-topology-changed-before-close.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
"observeEvents": [
2525
"topologyDescriptionChangedEvent",
2626
"topologyOpeningEvent",
27-
"topologyClosedEvent",
28-
"serverOpeningEvent",
29-
"serverClosedEvent"
27+
"topologyClosedEvent"
3028
]
3129
}
3230
}
@@ -68,9 +66,6 @@
6866
}
6967
}
7068
},
71-
{
72-
"serverOpeningEvent": {}
73-
},
7469
{
7570
"topologyDescriptionChangedEvent": {
7671
"previousDescription": {
@@ -81,9 +76,6 @@
8176
}
8277
}
8378
},
84-
{
85-
"serverClosedEvent": {}
86-
},
8779
{
8880
"topologyDescriptionChangedEvent": {
8981
"previousDescription": {

test/spec/server-discovery-and-monitoring/unified/standalone-emit-topology-changed-before-close.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ tests:
2020
- topologyDescriptionChangedEvent
2121
- topologyOpeningEvent
2222
- topologyClosedEvent
23-
- serverOpeningEvent
24-
- serverClosedEvent
2523
# ensure the topology has been fully discovered before closing the client.
2624
# expected events are initial server discovery and server connect event.
2725
- name: waitForEvent
@@ -44,13 +42,11 @@ tests:
4442
type: "Unknown"
4543
newDescription:
4644
type: "Unknown"
47-
- serverOpeningEvent: {}
4845
- topologyDescriptionChangedEvent: # unknown w disconnected server -> standalone
4946
previousDescription:
5047
type: "Unknown"
5148
newDescription:
5249
type: "Single"
53-
- serverClosedEvent: {}
5450
- topologyDescriptionChangedEvent: # standalone -> unknown
5551
previousDescription:
5652
type: "Single"

test/tools/unified-spec-runner/match.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {
3838
} from '../../mongodb';
3939
import { ejson } from '../utils';
4040
import { type CmapEvent, type CommandEvent, type EntitiesMap, type SdamEvent } from './entities';
41+
import { trace } from './runner';
4142
import {
4243
type ExpectedCmapEvent,
4344
type ExpectedCommandEvent,
@@ -621,7 +622,7 @@ function compareEvents(
621622
);
622623
}
623624
} else {
624-
expect.fail(`Encountered unexpected event - ${inspect(actualEvent)}`);
625+
expect.fail(`Encountered unexpected event - ${inspect(actualEvent)} `);
625626
}
626627
}
627628
}
@@ -724,7 +725,7 @@ export function expectErrorCheck(
724725
expected: ExpectedError,
725726
entities: EntitiesMap
726727
): void {
727-
const expectMessage = `\n\nOriginal Error Stack:\n${error.stack}\n\n`;
728+
const expectMessage = `\n\nOriginal Error Stack: \n${error.stack} \n\n`;
728729

729730
if (!isMongoCryptError(error)) {
730731
expect(error, expectMessage).to.be.instanceOf(MongoError);
@@ -755,7 +756,7 @@ export function expectErrorCheck(
755756
for (const errorLabel of expected.errorLabelsContain) {
756757
expect(
757758
mongoError.hasErrorLabel(errorLabel),
758-
`Error was supposed to have label ${errorLabel}, has [${mongoError.errorLabels}] -- ${expectMessage}`
759+
`Error was supposed to have label ${errorLabel}, has[${mongoError.errorLabels}]--${expectMessage} `
759760
).to.be.true;
760761
}
761762
}
@@ -765,7 +766,7 @@ export function expectErrorCheck(
765766
for (const errorLabel of expected.errorLabelsOmit) {
766767
expect(
767768
mongoError.hasErrorLabel(errorLabel),
768-
`Error was not supposed to have label ${errorLabel}, has [${mongoError.errorLabels}] -- ${expectMessage}`
769+
`Error was not supposed to have label ${errorLabel}, has[${mongoError.errorLabels}]--${expectMessage} `
769770
).to.be.false;
770771
}
771772
}

0 commit comments

Comments
 (0)