-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Migration guide for Unified Recorder #19210
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
|
We should add a troubleshooting section that describes how to run the recorder manually and get logs. |
| - `node-ts-input` runs the tests using `ts-node`, without code coverage. | ||
| - `node-js-input` runs the tests using the built JavaScript output, and generates coverage reporting using `nyc`. |
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.
| - `node-ts-input` runs the tests using `ts-node`, without code coverage. | |
| - `node-js-input` runs the tests using the built JavaScript output, and generates coverage reporting using `nyc`. | |
| - `node-ts-input` runs the tests using `ts-node`(takes TS files as input), without code coverage. | |
| - `node-js-input` runs the tests using the test (JS) bundle built with rollup, and generates coverage reporting using `nyc`. |
| }); | ||
| ``` | ||
|
|
||
| To enable the recorder, you should then initialize your SDK client as normal and use the recorder's `configureClient` method. This method will attach the necessary policies to the client for recording to be enabled. |
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.
Let's also mention that the client should be exposing the "pipeline" object to get the policy added properly.
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 would be a compile error if pipeline isn't exposed, but I'll add a note
Co-authored-by: Harsha Nalluru <[email protected]>
Co-authored-by: Harsha Nalluru <[email protected]>
Co-authored-by: Harsha Nalluru <[email protected]>
|
|
||
| Once you have made the necessary code changes, it is time to re-record your tests using the Unified Recorder to complete the migration. To do this, first **delete** the directory containing the old recordings (the `recordings` folder). Then, run your tests with the `TEST_MODE` environment variable to `record`. | ||
|
|
||
| If everything succeeds, the new recordings will be made available in the `recordings` directory. Inspect them to make sure everything looks OK (no secrets present, etc.), and then run the tests in playback mode to ensure everything is passing. If you're running into issues, check out the [Troubleshooting section](#troubleshooting). |
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.
troubleshooting is empty?
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.
uh oh...
why do I remember writing it if it's not there...
| docker run -v <your azure-sdk-for-js repository root>:/srv/testproxy -p 5001:5001 -p 5000:5000 -e Logging__LogLevel__Microsoft=Debug azsdkengsys.azurecr.io/engsys/testproxy-lin:latest | ||
| ``` | ||
|
|
||
| Once you've done this, you can run your tests in a separate terminal. `dev-tool` will detect that a test proxy container is already running and will point requests to the Docker container you started. |
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.
perfect 🎉
Tips and tricks for migrating from the old recorder to the shiny new Unified Recorder.
Needs updates as result of API changes:
TestProxyHttpClients for better clarity and Renaming #19446