-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(NODE-6052): support assertions on topologyDescriptionChanged in …
…expectEvents (#4089) Co-authored-by: Aditi Khare <106987683+aditi-khare-mongoDB@users.noreply.github.com>
- Loading branch information
1 parent
6abc074
commit ca2bfb0
Showing
5 changed files
with
148 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
...ified-test-format/valid-pass/expectedEventsForClient-topologyDescriptionChangedEvent.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"description": "expectedEventsForClient-topologyDescriptionChangedEvent", | ||
"schemaVersion": "1.20", | ||
"runOnRequirements": [ | ||
{ | ||
"topologies": [ | ||
"replicaset" | ||
], | ||
"minServerVersion": "4.4" | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "can assert on values of newDescription and previousDescription fields", | ||
"operations": [ | ||
{ | ||
"name": "createEntities", | ||
"object": "testRunner", | ||
"arguments": { | ||
"entities": [ | ||
{ | ||
"client": { | ||
"id": "client", | ||
"uriOptions": { | ||
"directConnection": true | ||
}, | ||
"observeEvents": [ | ||
"topologyDescriptionChangedEvent" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"object": "testRunner", | ||
"arguments": { | ||
"client": "client", | ||
"event": { | ||
"topologyDescriptionChangedEvent": {} | ||
}, | ||
"count": 1 | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client", | ||
"eventType": "sdam", | ||
"ignoreExtraEvents": true, | ||
"events": [ | ||
{ | ||
"topologyDescriptionChangedEvent": { | ||
"previousDescription": { | ||
"type": "Unknown" | ||
}, | ||
"newDescription": { | ||
"type": "Single" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
40 changes: 40 additions & 0 deletions
40
...nified-test-format/valid-pass/expectedEventsForClient-topologyDescriptionChangedEvent.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
description: "expectedEventsForClient-topologyDescriptionChangedEvent" | ||
|
||
schemaVersion: "1.20" | ||
|
||
runOnRequirements: | ||
- topologies: | ||
- replicaset | ||
minServerVersion: "4.4" # awaitable hello | ||
|
||
tests: | ||
- description: "can assert on values of newDescription and previousDescription fields" | ||
operations: | ||
- name: createEntities | ||
object: testRunner | ||
arguments: | ||
entities: | ||
- client: | ||
id: &client client | ||
uriOptions: | ||
directConnection: true | ||
observeEvents: | ||
- topologyDescriptionChangedEvent | ||
- name: waitForEvent | ||
object: testRunner | ||
arguments: | ||
client: *client | ||
event: | ||
topologyDescriptionChangedEvent: {} | ||
count: 1 | ||
expectEvents: | ||
- client: *client | ||
eventType: sdam | ||
ignoreExtraEvents: true | ||
events: | ||
- topologyDescriptionChangedEvent: | ||
previousDescription: | ||
type: "Unknown" | ||
newDescription: | ||
type: "Single" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters