-
Notifications
You must be signed in to change notification settings - Fork 2
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
ci(NODE-6712): fix broken tests against latest driver #66
Conversation
This reverts commit b2cb8dc.
32be8a5
to
08763f7
Compare
3b316e3
to
0ab3e05
Compare
@@ -21,6 +21,8 @@ updates: | |||
versions: [">=16.0.0"] | |||
# we ignore TS as a part of quarterly dependency updates. | |||
- dependency-name: "typescript" | |||
|
|||
- dependency-name: "mongodb" |
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 can revert but we don't update the driver quarterly, so I added it to the ignore list.
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.
no, please keep! ty!
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.
just the prettier thing, and a quick question
This originally was the quick fix but now seems like we tackled the full issue correct? so I put the ticket in the title
@@ -145,3 +145,844 @@ module.exports.classNames = new Set(api.map(({ className }) => className)) | |||
module.exports.classNameToMethodList = new Map(api.map((api, _, array) => | |||
[api.className, sorted(Array.from(new Set(Array.from(array.filter(v => v.className === api.className), method => method))), (a, b) => byStrings(a.method, b.method))] | |||
)); | |||
|
|||
/** | |||
* Generated from `api`, this is an exhaustive list of all methods we can unit test. |
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.
Generated how? would we need to regen it ever? (prob not but just wanna capture the history of how at least)
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.
It's non-trivial to re-generate. I generated it using the old test setup, which was problematic for the reasons listed in the ticket, but the functionLength specifically requires an instance of the function to calculate.
I think it's okay to leave this without a script to generate it, we'll likely never touch this again (this is the 4.x compatible methods to test, and 4.x will never change again). If we do modify it, it would just be to add or remove callback positions
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.
works for me, and I agree, low traffic here
test/tools/api.js
Outdated
module.exports.unitTestableAPI = [ | ||
{ | ||
"className": "Admin", | ||
"method": "buildInfo", |
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'm surprised this isn't getting reformatted, wanna run prettier to spare the next person a big reformat diff if they have to run it?
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 though we ran prettier through eslint. I guess not
@@ -21,6 +21,8 @@ updates: | |||
versions: [">=16.0.0"] | |||
# we ignore TS as a part of quarterly dependency updates. | |||
- dependency-name: "typescript" | |||
|
|||
- dependency-name: "mongodb" |
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.
no, please keep! ty!
Description
What is changing?
See https://jira.mongodb.org/browse/NODE-6712 for a full description of the issue.
This PR restructures the unit tests so that no actual driver instances are constructed until we are executing tests.
Is there new documentation needed for these changes?
What is the motivation for this change?
Release Highlight
Fill in title or leave empty for no highlight
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript