Sync eng/common directory with azure-sdk-tools for PR 2585 (#19958)

* updating to target test-proxy that only gets filename from body of /start request
* set TestProxy to true in core/ci.yml
* patch recorder.ts to include filename into body of /start request

Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
Co-authored-by: Harsha Nalluru <sanallur@microsoft.com>
This commit is contained in:
Azure SDK Bot 2022-01-21 12:55:34 -08:00 коммит произвёл GitHub
Родитель fe007541ba
Коммит 2144ad4eb7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -31,7 +31,7 @@ catch {
Write-Error "Please check your docker invocation and try running the script again." Write-Error "Please check your docker invocation and try running the script again."
} }
$SELECTED_IMAGE_TAG = "1294199" $SELECTED_IMAGE_TAG = "1314089"
$CONTAINER_NAME = "ambitious_azsdk_test_proxy" $CONTAINER_NAME = "ambitious_azsdk_test_proxy"
$LINUX_IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-lin:${SELECTED_IMAGE_TAG}" $LINUX_IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-lin:${SELECTED_IMAGE_TAG}"
$WINDOWS_IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-win:${SELECTED_IMAGE_TAG}" $WINDOWS_IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-win:${SELECTED_IMAGE_TAG}"

Просмотреть файл

@ -16,7 +16,7 @@ steps:
dotnet tool install azure.sdk.tools.testproxy ` dotnet tool install azure.sdk.tools.testproxy `
--tool-path $(Build.BinariesDirectory)/test-proxy ` --tool-path $(Build.BinariesDirectory)/test-proxy `
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json ` --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json `
--version 1.0.0-dev.20220113.1 --version 1.0.0-dev.20220119.2
displayName: "Install test-proxy" displayName: "Install test-proxy"
- pwsh: | - pwsh: |

Просмотреть файл

@ -35,6 +35,7 @@ extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters: parameters:
ServiceDirectory: core ServiceDirectory: core
TestProxy: true
Artifacts: Artifacts:
- name: azure-abort-controller - name: azure-abort-controller
safeName: azureabortcontroller safeName: azureabortcontroller

Просмотреть файл

@ -218,7 +218,7 @@ export class Recorder {
private _createRecordingRequest(url: string, method: HttpMethods = "POST") { private _createRecordingRequest(url: string, method: HttpMethods = "POST") {
const req = createPipelineRequest({ url, method }); const req = createPipelineRequest({ url, method });
if (ensureExistence(this.sessionFile, "sessionFile")) { if (ensureExistence(this.sessionFile, "sessionFile")) {
req.headers.set("x-recording-file", this.sessionFile); req.body = JSON.stringify({ "x-recording-file": this.sessionFile });
} }
if (this.recordingId !== undefined) { if (this.recordingId !== undefined) {
req.headers.set("x-recording-id", this.recordingId); req.headers.set("x-recording-id", this.recordingId);

Просмотреть файл

@ -281,7 +281,7 @@ describe("TestProxyClient functions", () => {
const returnedRequest = client["_createRecordingRequest"](initialRequest.url); const returnedRequest = client["_createRecordingRequest"](initialRequest.url);
expect(returnedRequest.url).to.equal(initialRequest.url); expect(returnedRequest.url).to.equal(initialRequest.url);
expect(returnedRequest.method).to.equal("POST"); expect(returnedRequest.method).to.equal("POST");
expect(returnedRequest.headers.get("x-recording-file")).not.to.be.undefined; expect(returnedRequest.body).not.to.be.undefined;
expect(returnedRequest.headers.get("x-recording-id")).to.equal(client.recordingId); expect(returnedRequest.headers.get("x-recording-id")).to.equal(client.recordingId);
expect(returnedRequest.url).to.equal(initialRequest.url); expect(returnedRequest.url).to.equal(initialRequest.url);
}); });