-
Notifications
You must be signed in to change notification settings - Fork 53
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
test: Add P2P tests for Schema Update adding field #1182
test: Add P2P tests for Schema Update adding field #1182
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1182 +/- ##
===========================================
+ Coverage 68.65% 68.76% +0.11%
===========================================
Files 180 180
Lines 17046 17046
===========================================
+ Hits 11703 11722 +19
+ Misses 4387 4372 -15
+ Partials 956 952 -4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a few suggestions related to "typos"
Indeed the email not syncing even when the schema is updated on both sides is an undesirable behaviour. It sounds like the block sent through the P2P network doesn't have the link to the email field. But it might be something else.
CollectionID: 0, | ||
}, | ||
testUtils.SchemaPatch{ | ||
// Patch the schema on the node that we will directly create a doc on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: update a doc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) Cheers
- fix comment
}, | ||
testUtils.UpdateDoc{ | ||
// Update the existing field on the first node only, and allow the value to sync | ||
// We need to make sure any errors caused by the first update to not break the sync |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: do not break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cheers
- fix comment
TargetNodeID: 1, | ||
}, | ||
testUtils.SchemaPatch{ | ||
// Patch the schema on the node that we will directly create a doc on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: update a doc on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cheers
- fix comment
CollectionID: 0, | ||
}, | ||
testUtils.SchemaPatch{ | ||
// Patch the schema on the node that we will directly create a doc on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: update a doc on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cheers
- fix comment
5d30037
to
6844134
Compare
Was only working accidentally with the existing tests, and does not work with tests soon to be added.
NodeID: immutable.Some(0), | ||
Doc: `{ | ||
"Name": "Shahzad", | ||
"Email": "[email protected]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol: "imnotyourbuddyguy" :,)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Fix wait mechanic for peer col subscription Was only working accidentally with the existing tests, and does not work with tests soon to be added. * Add peer create tests across schema versions * Add peer update tests across schema versions * Add replicator create tests across schema versions * Add replicator update tests across schema versions
* Fix wait mechanic for peer col subscription Was only working accidentally with the existing tests, and does not work with tests soon to be added. * Add peer create tests across schema versions * Add peer update tests across schema versions * Add replicator create tests across schema versions * Add replicator update tests across schema versions
Relevant issue(s)
Resolves #1181
Description
Adds P2P tests for a Schema Update adding a new field. Also fixes the wait mechanic for the P2P tests, that was previously working accidentally - bug was exposed by the new tests.
Includes two documentation tests for what may be undesirable behaviour, where P2P will not sync a new field value that has been added to both nodes. I do not know if this is a bug or a feature, if it is a bug let me know and I can open a ticket. Tests are
TestP2POneToOneReplicatorCreateWithNewFieldSyncsDocsToUpdatedSchemaVersion
andTestP2PPeerCreateWithNewFieldSyncsDocsToUpdatedSchemaVersion
.