Azure @azure-tools/test-recorder library for JavaScript
Note: This project is a test utility that assits with testing the packages maintained at the Azure SDK for JavaScript repository. This is not intended for the public utilization.
This tool helps to record and playback the tests in the JS repo by leveraging the unified out-of-process test proxy server.
Resources
- Migration guide to recorder v2 from v1
- Azure SDK Tools Test Proxy
- Using Test Proxy with docker container
Running the tests along with the test-proxy tool
dev-tool
commands
With the - The following commands run the tests with the default configs, and concurrently runs the proxy tool in record/playback modes if it is not already active. Additionally, more options can be passeed to override the default configs.
dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'
dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'
-
dev-tool run test:browser
Read more at dev-tool commands #usage
Follow the below two methods if you wish to run the proxy tool yourself without relying on the dev-tool
commands.
docker run
command
With the -
Run this command
docker run -v /workspaces/azure-sdk-for-js/:/srv/testproxy -p 5001:5001 -p 5000:5000 azsdkengsys.azurecr.io/engsys/testproxy-lin:latest
Map the root directory of the azure-sdk-for-js repo to
/srv/testproxy
inside the container for an accurate location while generating recordings.Add
--add-host host.docker.internal:host-gateway
for linux to access host's network(to accesslocalhost
) throughhost.docker.internal
. Docker for Windows and Mac supporthost.docker.internal
as a functioning alias for localhost.If the above command doesn't work directly, try Troubleshooting Access to Public Container Registry.
Reference: Using Test Proxy with docker container
dotnet tool
(OR) With the -
Install .Net 5.0
-
Install test-proxy
dotnet tool install azure.sdk.tools.testproxy --global --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --version 1.0.0-dev*
-
After successful installation, run the tool:
test-proxy --storage-location <root-of-the-repo>
[
root-of-the-repo example
-/workspaces/azure-sdk-for-js
if you're on codespaces]