From 16f2260e3d3cad93e7adf5426b884dc1952e05db Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:18:14 +0800 Subject: [PATCH 1/2] update docs --- documentation/Quickstart-on-how-to-write-tests.md | 10 ++++------ documentation/RLC-Swagger-quickstart.md | 8 ++------ documentation/RLC-quickstart.md | 8 ++------ 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/documentation/Quickstart-on-how-to-write-tests.md b/documentation/Quickstart-on-how-to-write-tests.md index 7d296a706fe3..55a005ee0afd 100644 --- a/documentation/Quickstart-on-how-to-write-tests.md +++ b/documentation/Quickstart-on-how-to-write-tests.md @@ -22,13 +22,10 @@ This page is to help you write and run tests quickly for Javascript Codegen SDK The Azure SDK test framework uses the [`test-recorder`](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/recorder/README.md) library, which in turn rests upon on a HTTP recording system ([testproxy](https://github.com/Azure/azure-sdk-tools/tree/main/tools/test-proxy)) that enables tests dependent on network interaction to be run offline. -At the moment, tests in our repo depend on one of the two different versions of the recorder tool (`@azure-tools/test-recorder`) - `1.a.b` and `2.x.y`. And this quickstart is based on 2.x.y version. +At the moment, notice that this quickstart is based on 3.x.y version of recorder tool (`@azure-tools/test-recorder`). # Prerequisites -- Docker - - [Docker](https://www.docker.com/get-started/) is required, as the [test proxy server](https://github.com/Azure/azure-sdk-tools/tree/main/tools/test-proxy) is running in a container during testing - - When running the tests, ensure the Docker daemon is running and you have permission to use it. - Rush 5.x - Install/update Rush globally via `npm install -g @microsoft/rush` - Any of [the LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) @@ -185,10 +182,11 @@ const envSetupForPlayback: Record = { AZURE_CLIENT_ID: "azure_client_id", AZURE_CLIENT_SECRET: "azure_client_secret", AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + AZURE_SUBSCRIPTION_ID: "azure_subscription_id" }; const recorderEnvSetup: RecorderStartOptions = { - envSetupForPlaayback, + envSetupForPlayback, }; //... @@ -280,7 +278,7 @@ const envSetupForPlayback: Record = { }; const recorderEnvSetup: RecorderStartOptions = { - envSetupForPlaayback, + envSetupForPlayback, }; /** diff --git a/documentation/RLC-Swagger-quickstart.md b/documentation/RLC-Swagger-quickstart.md index 713a9647763d..e5a1bbbf33b7 100644 --- a/documentation/RLC-Swagger-quickstart.md +++ b/documentation/RLC-Swagger-quickstart.md @@ -147,16 +147,12 @@ In order to release your RLC library, we need to add some tests for it to make s See the [JavaScript Codegen Quick Start for Test](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/Quickstart-on-how-to-write-tests.md) for information on how to write and run tests for the JavaScript SDK. -1. **Prerequisites** - - To record and playback the tests, [Docker](https://www.docker.com/) is required when we run the test, as the [test proxy server](https://github.com/Azure/azure-sdk-tools/tree/main/tools/test-proxy) is run in a container during testing. When running the tests, ensure the Docker daemon is running and you have permission to use it. - -2. **Write the test** +1. **Write the test** You could follow the [basic RLC test interaction and recording example](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/Quickstart-on-how-to-write-tests.md#example-1-basic-rlc-test-interaction-and-recording-for-azure-data-plane-service) to write your test step by step. Also you could refer [the test of MapsRouteClient](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/maps/maps-route-rest/test/public) for more cases. -3. **Run the test** +2. **Run the test** Now, you can run the test like this. If you are the first time to run test, you need to set the environment variable `TEST_MODE` to `record`. This will generate recordings for your test they could be used in `playback` mode. On Linux, you could use `export` to set env variable: ```shell diff --git a/documentation/RLC-quickstart.md b/documentation/RLC-quickstart.md index 557f99be2dea..7fc1fb1dfa91 100644 --- a/documentation/RLC-quickstart.md +++ b/documentation/RLC-quickstart.md @@ -117,15 +117,11 @@ In order to release it, we need to add some tests for it to make sure we are del See the [Javascript Codegen Quick Start for Test](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/Quickstart-on-how-to-write-tests.md) for information on how to write and run tests for the Javascript SDK. -1. **Prerequisites** - - To record and playback the tests, [Docker](https://www.docker.com/) is required when we run the test, as the [test proxy server](https://github.com/Azure/azure-sdk-tools/tree/main/tools/test-proxy) is ran in a container during testing. When running the tests, ensure the Docker daemon is running and you have permission to use it. - -2. **Write the test** +1. **Write the test** You could follow the [basic RLC test interaction and recording example](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/Quickstart-on-how-to-write-tests.md#example-1-basic-rlc-test-interaction-and-recording-for-azure-data-plane-service) to write your test step by step. Also you could refer [the test of MapsRouteClient](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/maps/maps-route-rest/test/public) for more cases. -3. **Run the test** +2. **Run the test** Now, you can run the test like this. If you are the first time to run test, you need to set the environment variable `TEST_MODE` to `record`. This will generate recordings for your test they could be used in `playback` mode. On Linux, you could use `export` to set env variable: ```shell From 268d9f31f6594ddd6f5b9d40b700379d58d430b5 Mon Sep 17 00:00:00 2001 From: Mary Gao Date: Wed, 26 Jul 2023 17:20:14 +0800 Subject: [PATCH 2/2] Update documentation/Quickstart-on-how-to-write-tests.md --- documentation/Quickstart-on-how-to-write-tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Quickstart-on-how-to-write-tests.md b/documentation/Quickstart-on-how-to-write-tests.md index 55a005ee0afd..2acc7e25cc89 100644 --- a/documentation/Quickstart-on-how-to-write-tests.md +++ b/documentation/Quickstart-on-how-to-write-tests.md @@ -22,7 +22,7 @@ This page is to help you write and run tests quickly for Javascript Codegen SDK The Azure SDK test framework uses the [`test-recorder`](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/recorder/README.md) library, which in turn rests upon on a HTTP recording system ([testproxy](https://github.com/Azure/azure-sdk-tools/tree/main/tools/test-proxy)) that enables tests dependent on network interaction to be run offline. -At the moment, notice that this quickstart is based on 3.x.y version of recorder tool (`@azure-tools/test-recorder`). +Please notice that this quickstart is based on 3.x.y version of recorder tool (`@azure-tools/test-recorder`). # Prerequisites