-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(NODE-3191): backport versioned api #2850
Conversation
0d7f8ac
to
2862914
Compare
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.
Despite the size, a majority of this is accepting hello and legacy hello in the tests, most of what I callout here is minor requests.
f2a987d
to
8fd0886
Compare
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
@@ -1,6 +1,6 @@ | |||
stepback: true | |||
command_type: system | |||
exec_timeout_secs: 1200 |
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.
Note: this change is unrelated to the versioned API, we've just been experiencing some premature timeouts on our longer running tasks; this gives them another 5 minutes to complete.
9cade0d
to
7e5b14a
Compare
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.
test/functional/view.test.js
Outdated
@@ -58,6 +58,7 @@ describe('Views', function() { | |||
) { | |||
expect(r).to.exist; | |||
expect(err).to.not.exist; | |||
delete commandResult.apiVersion; |
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.
why do we want to delete this key instead of checking for it? just for the sake of the deep equal comparison? it could be misleading in terms of the expected behavior
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.
I wasn't sure about the best approach to take here. Below we currently use a deep equal check on the commandResult, which may or may not contain apiVersion
depending on how the test is run, e.g. the presence of the MONGODB_API_VERSION environment variable.
We could use containsSubset
instead of doing a deep equal check, but that allows the presence of extraneous keys we don't actually want to be there. Deleting the apiVersion
key (which is otherwise irrelevant to this test) seemed like a reasonable compromise, but I'm open to better ideas! Or perhaps just adding a comment would suffice.
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.
so there's a couple of different approaches possible here:
- if it is possible to know what the expected apiVersion is based on the test context, then we can optionally assert on it by pulling the expected object out into its own
const expectedResult = { create, viewOn, pipeline }
and then assigning theapiVersion
with the expected value if we expect there to be one; - if it is possible to know whether or not the apiVersion is set at all, but not what it's set to, we could use the keys assertion (
expect(obj).to.have.all.keys([...])
) to check that all expected keys are present and then assert on the 3 that we know one at a time; - if it is not possible to know whether the apiVersion is even set, then just a comment to that end would be fine
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.
Went with option 1 👍
@@ -4117,59 +4119,6 @@ describe('Cursor', function() { | |||
} | |||
}); | |||
|
|||
it('Correctly decorate the collection cursor count command with skip, limit, hint, readConcern', { |
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.
why was this test deleted?
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.
Currently taking another look at this test actually, deleting it may have been a mistake.
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.
Yeah it was a bug that was causing this test to fail, fixed now.
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.
Thanks for all the test updates!
NODE-3191
Includes backports for the following
4.0
PRs: