-
Notifications
You must be signed in to change notification settings - Fork 1.8k
test(NODE-6052): support assertions on topologyDescriptionChanged in expectEvents #4089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4d443b3
Impleent spec test
W-A-James f293705
pull in tests
W-A-James 8c77374
Merge branch 'main' into NODE-6052
W-A-James e59b76b
fix runner bug
W-A-James 91559dd
Merge branch 'NODE-6052' of github.com:mongodb/node-mongodb-native in…
W-A-James 2a394fa
Merge branch 'main' into NODE-6052
W-A-James c6b46f9
skip tests
W-A-James 574dd9f
reference correct follow-up ticket
W-A-James 62c2a33
Merge branch 'main' into NODE-6052
W-A-James 01e3ccb
Update type names
W-A-James c2e5dab
Merge branch 'NODE-6052' of github.com:mongodb/node-mongodb-native in…
W-A-James c331eed
Update type name for clarity
W-A-James 718e7f0
Merge branch 'main' into NODE-6052
aditi-khare-mongoDB f71cc56
update skip reasons
W-A-James 5976402
Merge branch 'NODE-6052' of github.com:mongodb/node-mongodb-native in…
W-A-James de322bd
Merge branch 'main' into NODE-6052
aditi-khare-mongoDB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.