-
Notifications
You must be signed in to change notification settings - Fork 1.8k
test(NODE-2556): add integration testing for listDatabases' authorizedDatabases flag #3101
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(NODE-2556): add integration testing for listDatabases' authorizedDatabases flag #3101
Conversation
642c9b0
to
cc7f92a
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.
Nice work!
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.
seems like there's a lint check issue and we need the skip back
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.
In addition to the comments regarding the test structure, please do not delete the .gitkeep files. The idea behind them is to make sure that the spec-related folders exist even if there are no files in them, so even if for the folders with files present we don't want to accidentally delete the folder by moving its contents elsewhere.
Offloading ticket now. PR could be paused since a few new TODO's needed, namely: (1) testing for no duplicates and (2) verifying listDatabases return type is an array (i.e. verifying an "Iterable of Document types" per the spec). Scope for this PR is to complete Test Case 1 here. |
48cb739
to
a367230
Compare
|
||
await client.db(DB_NAME).createCollection(DB_NAME); | ||
|
||
ENTIRE_DB_LIST = (await client.db('admin').command({ listDatabases: 1 })).databases.map( |
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.
non-blocking: we could use nameOnly
here so we don't have to map ({ name }) => name
later 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.
nameOnly: true
returns in the shape of:
{
databases: [ { name: 'admin' }, { name: 'config' }, { name: 'local' } ],
ok: 1
}
So nothing would change, it omits the metadata from each db description object reducing the BSON transmitted
I left one small comment but it's non-blocking. LGTM |
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 one small thing
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, tyvm :)
Description
added int tests for the
authorizedDatabases
option oflistDatabases
What is changing?
a new
enumerating-databases
int test folder with alist_databases
test file has been added with appropriate testsdrive-by deletion/cleanup of gitkeep files
Is there new documentation needed for these changes?
n/a
Double check the following
npm run check:lint
script<type>(NODE-xxxx)<!>: <description>