Skip to content
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: Complete all matching operations #2712

Merged
merged 8 commits into from
Jan 27, 2021
Merged

Conversation

nbbeeken
Copy link
Contributor

Adds special operations support i.e. $$unsetOrMatches for testing
nested schema equality of results and events. Adds Recursive
equality test that tracks the path into the object it is testing
for ease of error tracing. Enable Change Stream tests with the
repurposed EventsCollector class to iterate change events. Adds
find, insertMany, iterateUntilDocumentOrError, and failPoint operations.

NODE-2287

Using the unfied spec test schema this scaffolding
outlines the structure of a unified runner. Most tests
are skipped by the runOn requirements or not implemented
errors thrown by empty operation functions.

NODE-2287
Adds special operations support i.e. $$unsetOrMatches for testing
nested schema equality of results and events. Adds Recursive
equality test that tracks the path into the object it is testing
for ease of error tracing. Enable Change Stream tests with the
repurposed EventsCollector class to iterate change events. Adds
find, insertMany, iterateUntilDocumentOrError, and failPoint operations.

NODE-2287
@nbbeeken nbbeeken force-pushed the NODE-2287/UnifiedTestFormat-2 branch from 5edf26a to a874e5c Compare January 21, 2021 23:45
@nbbeeken nbbeeken marked this pull request as ready for review January 22, 2021 17:31
@nbbeeken nbbeeken requested review from emadum and durran January 22, 2021 17:31
Adds a check that asserts when at a recursion depth greater than 1
that documents do not have extra keys
}

const TYPE_MAP = new Map();
function typeof_double(actual): actual is number | Double {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity is there a pattern of using snake case in typescript? I hadn't seen this before.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we perhaps have the functions inline in the Map.set calls? E.g.

TYPE_MAP.set('double', function (actual): actual is number | Double {
  return typeof actual === 'number' || actual._bsontype === 'Double';
});

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inlined them to arrow functions, I over prepared here for more complex logic than was actually needed 😅

Copy link
Contributor

@emadum emadum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice re-use of EventCollector 👍

Copy link
Member

@durran durran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nbbeeken nbbeeken merged commit c0d8a72 into 4.0 Jan 27, 2021
@nbbeeken nbbeeken deleted the NODE-2287/UnifiedTestFormat-2 branch January 27, 2021 16:56
ljhaywar pushed a commit that referenced this pull request Nov 9, 2021
Adds special operations support i.e. $$unsetOrMatches for testing
nested schema equality of results and events. Adds Recursive
equality test that tracks the path into the object it is testing
for ease of error tracing. Enable Change Stream tests with the
repurposed EventsCollector class to iterate change events. Adds
find, insertMany, iterateUntilDocumentOrError, and failPoint operations.

NODE-2287
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants