-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Unified Recorder] Allow passing undefined to sanitizers and other minor changes #19561
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
Merged
HarshaNalluru
merged 14 commits into
Azure:main
from
HarshaNalluru:harshan/pass-undefined-to-santiizers
Dec 28, 2021
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
76f0656
undefined sanitizer and delay
HarshaNalluru 596cae3
remove additional checks
HarshaNalluru 7aae2bb
tests
HarshaNalluru 17ec69e
changelog
HarshaNalluru 8ef19eb
Update sdk/test-utils/recorder-new/src/utils/delay.ts
HarshaNalluru 305cfc3
format
HarshaNalluru a272f86
Merge branch 'harshan/pass-undefined-to-santiizers' of https://github…
HarshaNalluru ab3af41
fix tests
HarshaNalluru e6798e1
FIX TEST
HarshaNalluru 7400079
skip test
HarshaNalluru 43918fb
foramtting
HarshaNalluru 82d2c1f
throw error as needed instead of blanks
HarshaNalluru b2ff65f
remnove return type
HarshaNalluru 2f88a54
format
HarshaNalluru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT license. | ||
|
|
||
| import { isPlaybackMode } from "./utils"; | ||
|
|
||
| /** | ||
| * Usage - `await delay(<milliseconds>)` | ||
| * This `delay` has no effect if the `TEST_MODE` is `"playback"`. | ||
| * If the `TEST_MODE` is not `"playback"`, `delay` is a wrapper for setTimeout that resolves a promise after t milliseconds. | ||
| * | ||
| * @param {number} milliseconds The number of milliseconds to be delayed. | ||
| */ | ||
| export function delay(milliseconds: number): Promise<void> | void { | ||
| if (isPlaybackMode()) { | ||
| return; | ||
| } | ||
| return new Promise((resolve) => setTimeout(resolve, milliseconds)); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is it optional because it is not used in playback mode? if
regexis optional, isvalueoptional too?Uh oh!
There was an error while loading. Please reload this page.
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 is only meant for convenience while writing the tests. If regex is undefined, the sanitizer won't be added.
For
value, typically it is hard-coded and is a non-null value.If it turned out to be undefined, it is most likely that the user is doing something wrong/unexpected, hence I didn't think of allowing that.