-
Notifications
You must be signed in to change notification settings - Fork 393
Adds integration tests for tenant management APIs. #570
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
Conversation
These tests are skipped by default as multi-tenancy is a paid feature on Google Cloud Identity Platform. To run these tests, --testMultiTenancy flag has to be added. Adds d.ts references for multi-tenancy APIs. Adds default email provider config when backend Auth server returns undefined for emailSignInConfig.
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 curious, do these tests call backend production endpoints? How often do they run? And which test project does it use?
These tests are calling backend production endpoints. They are currently only run manually before a new binary release of the library is pushed. It is basically a sanity check for our new releases (they act more like e2e tests). They are not specific to one project. |
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.
This looks pretty good. Just a couple of suggestions.
test/integration/auth.spec.ts
Outdated
// Test listTenant pagination. | ||
return admin.auth().listTenants(1); | ||
}) | ||
.then((result) => { |
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.
Something we do in other SDKs to test list operations is to list everything, and see if the known results appear in the output. Something like:
const allTenantIds = listAndIterateThroughAllTenants();
// scan allTenantIds to see if createdTenants is a subset of 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.
Done
src/index.d.ts
Outdated
@@ -602,6 +602,10 @@ declare namespace admin.auth { | |||
* resets, password or email updates, etc). | |||
*/ | |||
tokensValidAfterTime?: string; | |||
|
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.
These require a review from @egilmorez or somebody from his team. How about we make these changes in a separate PR, so the rest of the code changes don't get blocked on documentation updates?
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 reverted the reference changes. Will have a follow up PR just for that.
Reverts index.d.ts reference changes. These will be added in a separate PR.
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. LGTM with a nit.
src/index.d.ts
Outdated
@@ -5191,4 +5190,4 @@ declare namespace admin.projectManagement { | |||
declare module 'firebase-admin' { | |||
} | |||
|
|||
export = admin; | |||
export = admin; |
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.
Please fix.
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.
Done
Adds integration tests for tenant management APIs.
These tests are skipped by default as multi-tenancy is a paid feature on Google Cloud Identity Platform.
To run these tests, --testMultiTenancy flag has to be added.
Adds d.ts references for multi-tenancy APIs.
Adds default email provider config when backend Auth server returns undefined for emailSignInConfig.