-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[communication][phone-numbers] run tests in matrix #14868
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
beltr0n
left a comment
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.
code looks good, just a question about how timeout values are determined
| const { phoneNumber } = await client.getPurchasedPhoneNumber(purchasedPhoneNumber); | ||
|
|
||
| assert.strictEqual(purchasedPhoneNumber, phoneNumber); | ||
| }).timeout(7000); |
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.
How are these lengths determined btw?
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.
Default timeout is 2 seconds. If a test fails because of time out I increase to 5 seconds and rerun. If it still fails I increase by 5 seconds and rerun until I get no failures. I then reduce timeout to 1 second above the slowest run. So for this test case, slowest run was ~6 seconds.
For LROs, I run them without a time limit first, timeout(0), then set timeout based on how long they take.
|
/azp run js - communication-phone-numbers - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| * }); | ||
| * ``` | ||
| */ | ||
| export function matrix<T extends ReadonlyArray<readonly unknown[]>>( |
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.
@deyaaeldeen @willmtemple
We're stealing this nifty code for a couple of our services, is there a common place for the entire SDK where it could be shared?
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.
Perhaps it could live here? https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/test-utils/multi-version/ ?
Or we could make a new test-utils package
|
/azp run js - communication-phone-numbers - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
I had to remove |
|
/azp run js - communication-phone-numbers - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run js - communication-phone-numbers - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Webpubsub 2021-06-01-preview (Azure#14868) * init api version 2021-06-01-preview for from 2021-04-01-preview * update example * update readme * update swagger file Co-authored-by: Binjie Qian <[email protected]>
This PR refactors phone number tests and runs them in a matrix. This is the same approach used by ai-form-recognizer here
azure-sdk-for-js/sdk/formrecognizer/ai-form-recognizer/test/utils/matrix.ts
Line 33 in d0760de
Big up ai-form-recognizer 🕺🏾
@willmtemple @bterlson @xirzec this matrix method is a cool, and powerful, tool. Would be cool if it was more visibly accessible.