From 32ae3752dbbc7dc887ca8a0b11071c8468d8e859 Mon Sep 17 00:00:00 2001 From: "Hang Lu (MSFT)" <84374655+LuHang2021@users.noreply.github.com> Date: Tue, 6 Jul 2021 15:15:32 +0800 Subject: [PATCH 001/133] update eventhubs --- sdk/eventhub/event-hubs/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index 44877049e9a5..e6f4d58d3cd8 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -5,7 +5,8 @@ stages: parameters: PackageName: "@azure/event-hubs" ServiceDirectory: eventhub - Clouds: 'Public,Canary' + TimeoutInMinutes: 180 + Clouds: 'Public,UsGov,China,Canary' EnvVars: AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) From e0919469f5e5cd0b21b153a4b2fa2b2ce1532d34 Mon Sep 17 00:00:00 2001 From: "Hang Lu (MSFT)" <84374655+LuHang2021@users.noreply.github.com> Date: Thu, 8 Jul 2021 15:28:24 +0800 Subject: [PATCH 002/133] update capacity --- sdk/eventhub/test-resources.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventhub/test-resources.json b/sdk/eventhub/test-resources.json index 131060808c02..925aa24390ae 100644 --- a/sdk/eventhub/test-resources.json +++ b/sdk/eventhub/test-resources.json @@ -142,7 +142,7 @@ "sku": { "name": "S1", "tier": "Standard", - "capacity": 1 + "capacity": 5 }, "properties": { "ipFilterRules": [], From d59cb6cd5c7ddfe6cac13ddcb0c3a9636789d548 Mon Sep 17 00:00:00 2001 From: "Hang Lu (MSFT)" <84374655+LuHang2021@users.noreply.github.com> Date: Fri, 9 Jul 2021 17:24:35 +0800 Subject: [PATCH 003/133] update eventhub --- sdk/eventhub/test-resources.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/eventhub/test-resources.json b/sdk/eventhub/test-resources.json index 925aa24390ae..95bd8339839b 100644 --- a/sdk/eventhub/test-resources.json +++ b/sdk/eventhub/test-resources.json @@ -141,8 +141,7 @@ ], "sku": { "name": "S1", - "tier": "Standard", - "capacity": 5 + "tier": "Standard" }, "properties": { "ipFilterRules": [], From 674000c144181c58ec6232d6a2822705c16bd09c Mon Sep 17 00:00:00 2001 From: "Hang Lu (MSFT)" <84374655+LuHang2021@users.noreply.github.com> Date: Tue, 13 Jul 2021 14:23:01 +0800 Subject: [PATCH 004/133] update eventhub --- sdk/eventhub/test-resources.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/eventhub/test-resources.json b/sdk/eventhub/test-resources.json index 95bd8339839b..131060808c02 100644 --- a/sdk/eventhub/test-resources.json +++ b/sdk/eventhub/test-resources.json @@ -141,7 +141,8 @@ ], "sku": { "name": "S1", - "tier": "Standard" + "tier": "Standard", + "capacity": 1 }, "properties": { "ipFilterRules": [], From f65e1018d83ec3cbe312050511ffdeda0af5068d Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" <80496810+v-jiaodi@users.noreply.github.com> Date: Thu, 15 Jul 2021 09:47:29 +0800 Subject: [PATCH 005/133] update tests.yml --- sdk/search/search-documents/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/search/search-documents/tests.yml b/sdk/search/search-documents/tests.yml index 30e05bbf2df0..93e1346a387c 100644 --- a/sdk/search/search-documents/tests.yml +++ b/sdk/search/search-documents/tests.yml @@ -5,3 +5,5 @@ stages: parameters: PackageName: "@azure/search-documents" ServiceDirectory: search + TimeoutInMinutes: 180 + Clouds: 'Public,UsGov,China,Canary' From 0f22f578021f2a70f847bd02f018c0ec56a88ad7 Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" <80496810+v-jiaodi@users.noreply.github.com> Date: Fri, 16 Jul 2021 14:40:15 +0800 Subject: [PATCH 006/133] update test-resources.json --- sdk/search/test-resources.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/search/test-resources.json b/sdk/search/test-resources.json index a16e676a9489..4bf0f48bfb83 100644 --- a/sdk/search/test-resources.json +++ b/sdk/search/test-resources.json @@ -11,7 +11,7 @@ }, "searchSku": { "type": "string", - "defaultValue": "free", + "defaultValue": "standard", "metadata": { "description": "SKU for search resource. The default is 'free'" } From 76398a614eb22ba22bed6489b75a4a8e0cc18334 Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" <80496810+v-jiaodi@users.noreply.github.com> Date: Mon, 19 Jul 2021 10:20:57 +0800 Subject: [PATCH 007/133] update tests.yml --- sdk/search/search-documents/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/search/search-documents/tests.yml b/sdk/search/search-documents/tests.yml index 93e1346a387c..c98dd91970d6 100644 --- a/sdk/search/search-documents/tests.yml +++ b/sdk/search/search-documents/tests.yml @@ -5,5 +5,5 @@ stages: parameters: PackageName: "@azure/search-documents" ServiceDirectory: search - TimeoutInMinutes: 180 + TimeoutInMinutes: 300 Clouds: 'Public,UsGov,China,Canary' From 015df6b55245ed7ecf896a3a97cd2dc2d2fe043f Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Tue, 20 Jul 2021 11:22:37 +0800 Subject: [PATCH 008/133] update search --- sdk/search/test-resources.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sdk/search/test-resources.json b/sdk/search/test-resources.json index 4bf0f48bfb83..82ea24facf0c 100644 --- a/sdk/search/test-resources.json +++ b/sdk/search/test-resources.json @@ -15,6 +15,13 @@ "metadata": { "description": "SKU for search resource. The default is 'free'" } + }, + "endpointSuffix": { + "type": "string", + "defaultValue": ".search.windows.net", + "metadata": { + "description": "Endpoint suffix for sovereign clouds. The default uses the public Azure Cloud (.search.windows.net)" + } } }, "variables": {}, @@ -47,7 +54,7 @@ }, "ENDPOINT": { "type": "string", - "value": "[concat('https://', parameters('baseName'), '.search.windows.net')]" + "value": "[concat('https://', parameters('baseName'), parameters('endpointSuffix'))]" } } } From a8ed73ff37b4278eadfaa6bd216145c5093a9eee Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 21 Jul 2021 19:22:25 +0800 Subject: [PATCH 009/133] update search --- .../search-documents/test/public/utils/recordedClient.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sdk/search/search-documents/test/public/utils/recordedClient.ts b/sdk/search/search-documents/test/public/utils/recordedClient.ts index 35adb00ec7c5..10ba5799a802 100644 --- a/sdk/search/search-documents/test/public/utils/recordedClient.ts +++ b/sdk/search/search-documents/test/public/utils/recordedClient.ts @@ -53,6 +53,15 @@ export const environmentSetup: RecorderEnvironmentSetup = { }; export function createClients(indexName: string): Clients { + switch(testEnv.AZURE_AUTHORITY_HOST) + { + case "https://login.microsoftonline.us": + testEnv.ENDPOINT = testEnv.ENDPOINT.replace(".windows.net",".azure.us"); + break; + case "https://login.chinacloudapi.cn": + testEnv.ENDPOINT = testEnv.ENDPOINT.replace(".windows.net",".azure.cn"); + break; + } const credential = new AzureKeyCredential(testEnv.SEARCH_API_ADMIN_KEY); const searchClient = new SearchClient(testEnv.ENDPOINT, indexName, credential); const indexClient = new SearchIndexClient(testEnv.ENDPOINT, credential); From 316cd762ed10f4cb165d5851193779036d63f9ac Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 22 Jul 2021 10:13:57 +0800 Subject: [PATCH 010/133] update search --- .../test/public/utils/recordedClient.ts | 1 + sdk/search/test-resources.json | 11 ++--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/sdk/search/search-documents/test/public/utils/recordedClient.ts b/sdk/search/search-documents/test/public/utils/recordedClient.ts index 10ba5799a802..2b6137faeba2 100644 --- a/sdk/search/search-documents/test/public/utils/recordedClient.ts +++ b/sdk/search/search-documents/test/public/utils/recordedClient.ts @@ -53,6 +53,7 @@ export const environmentSetup: RecorderEnvironmentSetup = { }; export function createClients(indexName: string): Clients { + console.log("111111111111",testEnv.AZURE_AUTHORITY_HOST); switch(testEnv.AZURE_AUTHORITY_HOST) { case "https://login.microsoftonline.us": diff --git a/sdk/search/test-resources.json b/sdk/search/test-resources.json index 82ea24facf0c..7b94b9fbabb6 100644 --- a/sdk/search/test-resources.json +++ b/sdk/search/test-resources.json @@ -13,14 +13,7 @@ "type": "string", "defaultValue": "standard", "metadata": { - "description": "SKU for search resource. The default is 'free'" - } - }, - "endpointSuffix": { - "type": "string", - "defaultValue": ".search.windows.net", - "metadata": { - "description": "Endpoint suffix for sovereign clouds. The default uses the public Azure Cloud (.search.windows.net)" + "description": "SKU for search resource. The default is 'standard'" } } }, @@ -54,7 +47,7 @@ }, "ENDPOINT": { "type": "string", - "value": "[concat('https://', parameters('baseName'), parameters('endpointSuffix'))]" + "value": "[concat('https://', parameters('baseName'), '.search.windows.net')]" } } } From c248a767ba0d2f3da81ab9c616da70e149e3cf70 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 22 Jul 2021 11:08:07 +0800 Subject: [PATCH 011/133] update search --- .../test/public/utils/recordedClient.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/sdk/search/search-documents/test/public/utils/recordedClient.ts b/sdk/search/search-documents/test/public/utils/recordedClient.ts index 2b6137faeba2..182ec6bc37f8 100644 --- a/sdk/search/search-documents/test/public/utils/recordedClient.ts +++ b/sdk/search/search-documents/test/public/utils/recordedClient.ts @@ -2,6 +2,7 @@ // Licensed under the MIT license. import * as dotenv from "dotenv"; +import * as assert from "assert" import { env, RecorderEnvironmentSetup } from "@azure/test-utils-recorder"; import { isNode } from "@azure/core-http"; @@ -53,16 +54,23 @@ export const environmentSetup: RecorderEnvironmentSetup = { }; export function createClients(indexName: string): Clients { - console.log("111111111111",testEnv.AZURE_AUTHORITY_HOST); - switch(testEnv.AZURE_AUTHORITY_HOST) - { + console.log("111111111111", process.env.AZURE_AUTHORITY_HOST); + switch (testEnv.AZURE_AUTHORITY_HOST) { case "https://login.microsoftonline.us": - testEnv.ENDPOINT = testEnv.ENDPOINT.replace(".windows.net",".azure.us"); + console.log("22222222222222"); + testEnv.ENDPOINT = testEnv.ENDPOINT.replace(".windows.net", ".azure.us"); break; case "https://login.chinacloudapi.cn": - testEnv.ENDPOINT = testEnv.ENDPOINT.replace(".windows.net",".azure.cn"); + console.log("33333333333333"); + testEnv.ENDPOINT = testEnv.ENDPOINT.replace(".windows.net", ".azure.cn"); break; } + assert.ok(process.env.AZURE_AUTHORITY_HOST); + assert.ok(testEnv.AZURE_AUTHORITY_HOST); + assert.strictEqual(undefined, process.env.AZURE_AUTHORITY_HOST); + assert.strictEqual(undefined, testEnv.AZURE_AUTHORITY_HOST); + assert.strictEqual("https://login.microsoftonline.us", process.env.AZURE_AUTHORITY_HOST); + assert.strictEqual("https://login.microsoftonline.us", testEnv.AZURE_AUTHORITY_HOST); const credential = new AzureKeyCredential(testEnv.SEARCH_API_ADMIN_KEY); const searchClient = new SearchClient(testEnv.ENDPOINT, indexName, credential); const indexClient = new SearchIndexClient(testEnv.ENDPOINT, credential); From 94f3e8375283b649ba41341cbcc50af004ffa98f Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 22 Jul 2021 14:10:31 +0800 Subject: [PATCH 012/133] update search --- .../test/public/utils/recordedClient.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/sdk/search/search-documents/test/public/utils/recordedClient.ts b/sdk/search/search-documents/test/public/utils/recordedClient.ts index 182ec6bc37f8..eb58cdca3a46 100644 --- a/sdk/search/search-documents/test/public/utils/recordedClient.ts +++ b/sdk/search/search-documents/test/public/utils/recordedClient.ts @@ -2,7 +2,6 @@ // Licensed under the MIT license. import * as dotenv from "dotenv"; -import * as assert from "assert" import { env, RecorderEnvironmentSetup } from "@azure/test-utils-recorder"; import { isNode } from "@azure/core-http"; @@ -54,23 +53,17 @@ export const environmentSetup: RecorderEnvironmentSetup = { }; export function createClients(indexName: string): Clients { - console.log("111111111111", process.env.AZURE_AUTHORITY_HOST); switch (testEnv.AZURE_AUTHORITY_HOST) { case "https://login.microsoftonline.us": console.log("22222222222222"); - testEnv.ENDPOINT = testEnv.ENDPOINT.replace(".windows.net", ".azure.us"); + testEnv.ENDPOINT = testEnv.ENDPOINT.replace(/\.[a-zA-Z]{7}\.[a-zA-Z]{3}/, ".azure.us"); break; case "https://login.chinacloudapi.cn": console.log("33333333333333"); - testEnv.ENDPOINT = testEnv.ENDPOINT.replace(".windows.net", ".azure.cn"); + testEnv.ENDPOINT = testEnv.ENDPOINT.replace(/\.[a-zA-Z]{7}\.[a-zA-Z]{3}/, ".azure.cn"); break; } - assert.ok(process.env.AZURE_AUTHORITY_HOST); - assert.ok(testEnv.AZURE_AUTHORITY_HOST); - assert.strictEqual(undefined, process.env.AZURE_AUTHORITY_HOST); - assert.strictEqual(undefined, testEnv.AZURE_AUTHORITY_HOST); - assert.strictEqual("https://login.microsoftonline.us", process.env.AZURE_AUTHORITY_HOST); - assert.strictEqual("https://login.microsoftonline.us", testEnv.AZURE_AUTHORITY_HOST); + const credential = new AzureKeyCredential(testEnv.SEARCH_API_ADMIN_KEY); const searchClient = new SearchClient(testEnv.ENDPOINT, indexName, credential); const indexClient = new SearchIndexClient(testEnv.ENDPOINT, credential); From ca165401cd85fe28dfd662ce86a75403649f9637 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 22 Jul 2021 15:30:15 +0800 Subject: [PATCH 013/133] update search --- .../search-documents/test/public/utils/recordedClient.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sdk/search/search-documents/test/public/utils/recordedClient.ts b/sdk/search/search-documents/test/public/utils/recordedClient.ts index eb58cdca3a46..197ea4bd6b4a 100644 --- a/sdk/search/search-documents/test/public/utils/recordedClient.ts +++ b/sdk/search/search-documents/test/public/utils/recordedClient.ts @@ -55,12 +55,10 @@ export const environmentSetup: RecorderEnvironmentSetup = { export function createClients(indexName: string): Clients { switch (testEnv.AZURE_AUTHORITY_HOST) { case "https://login.microsoftonline.us": - console.log("22222222222222"); - testEnv.ENDPOINT = testEnv.ENDPOINT.replace(/\.[a-zA-Z]{7}\.[a-zA-Z]{3}/, ".azure.us"); + process.env.ENDPOINT = process.env.ENDPOINT!.toString().replace(/\.[a-zA-Z]{7}\.[a-zA-Z]{3}/, ".azure.us"); break; case "https://login.chinacloudapi.cn": - console.log("33333333333333"); - testEnv.ENDPOINT = testEnv.ENDPOINT.replace(/\.[a-zA-Z]{7}\.[a-zA-Z]{3}/, ".azure.cn"); + process.env.ENDPOINT = process.env.ENDPOINT!.toString().replace(/\.[a-zA-Z]{7}\.[a-zA-Z]{3}/, ".azure.cn"); break; } From 0b1c72fd34451fb067b70c0323df104822238595 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 22 Jul 2021 16:45:24 +0800 Subject: [PATCH 014/133] update search --- .../search-documents/test/public/utils/recordedClient.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/search/search-documents/test/public/utils/recordedClient.ts b/sdk/search/search-documents/test/public/utils/recordedClient.ts index 197ea4bd6b4a..fdff798c997c 100644 --- a/sdk/search/search-documents/test/public/utils/recordedClient.ts +++ b/sdk/search/search-documents/test/public/utils/recordedClient.ts @@ -55,10 +55,10 @@ export const environmentSetup: RecorderEnvironmentSetup = { export function createClients(indexName: string): Clients { switch (testEnv.AZURE_AUTHORITY_HOST) { case "https://login.microsoftonline.us": - process.env.ENDPOINT = process.env.ENDPOINT!.toString().replace(/\.[a-zA-Z]{7}\.[a-zA-Z]{3}/, ".azure.us"); + process.env.ENDPOINT = process.env.ENDPOINT!.toString().replace(".windows.net", ".azure.us"); break; case "https://login.chinacloudapi.cn": - process.env.ENDPOINT = process.env.ENDPOINT!.toString().replace(/\.[a-zA-Z]{7}\.[a-zA-Z]{3}/, ".azure.cn"); + process.env.ENDPOINT = process.env.ENDPOINT!.toString().replace(".windows.net", ".azure.cn"); break; } From 613ffbd99b8a8ad727ca2c68aa319f3e2f85faa5 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 22 Jul 2021 17:15:21 +0800 Subject: [PATCH 015/133] update appconfig --- sdk/appconfiguration/app-configuration/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/appconfiguration/app-configuration/tests.yml b/sdk/appconfiguration/app-configuration/tests.yml index 3aadd98bc2d0..4786b1fddff7 100644 --- a/sdk/appconfiguration/app-configuration/tests.yml +++ b/sdk/appconfiguration/app-configuration/tests.yml @@ -5,6 +5,8 @@ stages: parameters: PackageName: "@azure/app-configuration" ServiceDirectory: appconfiguration + TimeoutInMinutes: 200 + Clouds: 'Public,UsGov,China,Canary' EnvVars: AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) From eaedc9ad18ed2da7843206119e141f6ccad85661 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Tue, 27 Jul 2021 16:10:46 +0800 Subject: [PATCH 016/133] update appconfig test --- .../app-configuration/test/public/utils/testHelpers.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts b/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts index b6e8f0273873..ee42df903ba1 100644 --- a/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts +++ b/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts @@ -33,6 +33,15 @@ export interface CredsAndEndpoint { } export function startRecorder(that: Mocha.Context): Recorder { + switch (env["AZURE_AUTHORITY_HOST"]) { + case "https://login.microsoftonline.us": + env["AZ_CONFIG_ENDPOINT"] = env["AZ_CONFIG_ENDPOINT"].toString().replace(".azconfig.io", ".azconfig.azure.us"); + break; + case "https://login.chinacloudapi.cn": + env["AZ_CONFIG_ENDPOINT"] = env["AZ_CONFIG_ENDPOINT"].toString().replace(".azconfig.io", ".azconfig.azure.cn"); + break; + } + const recorderEnvSetup: RecorderEnvironmentSetup = { replaceableVariables: { APPCONFIG_CONNECTION_STRING: From 7c34c5992bca355ce933334de5538ef783c6348a Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 30 Jul 2021 10:01:16 +0800 Subject: [PATCH 017/133] update appConfigCredential.ts --- .../app-configuration/src/appConfigCredential.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/appconfiguration/app-configuration/src/appConfigCredential.ts b/sdk/appconfiguration/app-configuration/src/appConfigCredential.ts index 23efc2e74c25..3bbb4a6c7244 100644 --- a/sdk/appconfiguration/app-configuration/src/appConfigCredential.ts +++ b/sdk/appconfiguration/app-configuration/src/appConfigCredential.ts @@ -47,7 +47,7 @@ export class AppConfigCredential implements ServiceClientCredentials { webResource.headers.set("x-ms-content-sha256", contentHash); webResource.headers.set( "Authorization", - `HMAC-SHA256 Credential=${this.credential}, SignedHeaders=${signedHeaders}, Signature=${signature}` + `HMAC-SHA256 Credential=${this.credential}&SignedHeaders=${signedHeaders}&Signature=${signature}` ); return webResource; From 290cd776c4c85398f7863d8a600ef57fce6ad25f Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 4 Aug 2021 09:58:02 +0800 Subject: [PATCH 018/133] update appconfig --- .../app-configuration/test/public/auth.spec.ts | 9 +++++++++ .../app-configuration/test/public/utils/testHelpers.ts | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sdk/appconfiguration/app-configuration/test/public/auth.spec.ts b/sdk/appconfiguration/app-configuration/test/public/auth.spec.ts index fe2a491391a9..f3eabbbcc713 100644 --- a/sdk/appconfiguration/app-configuration/test/public/auth.spec.ts +++ b/sdk/appconfiguration/app-configuration/test/public/auth.spec.ts @@ -32,6 +32,15 @@ describe("Authentication", () => { }); it("token authentication works", async function() { + switch (process.env["AZURE_AUTHORITY_HOST"]) { + case "https://login.microsoftonline.us": + credsAndEndpoint.endpoint = credsAndEndpoint.endpoint.toString().replace(".azconfig.io", ".azconfig.azure.us"); + break; + case "https://login.chinacloudapi.cn": + credsAndEndpoint.endpoint = credsAndEndpoint.endpoint.toString().replace(".azconfig.io", ".azconfig.azure.cn"); + break; + } + const client = new AppConfigurationClient( credsAndEndpoint.endpoint, credsAndEndpoint.credential diff --git a/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts b/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts index ee42df903ba1..b6e8f0273873 100644 --- a/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts +++ b/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts @@ -33,15 +33,6 @@ export interface CredsAndEndpoint { } export function startRecorder(that: Mocha.Context): Recorder { - switch (env["AZURE_AUTHORITY_HOST"]) { - case "https://login.microsoftonline.us": - env["AZ_CONFIG_ENDPOINT"] = env["AZ_CONFIG_ENDPOINT"].toString().replace(".azconfig.io", ".azconfig.azure.us"); - break; - case "https://login.chinacloudapi.cn": - env["AZ_CONFIG_ENDPOINT"] = env["AZ_CONFIG_ENDPOINT"].toString().replace(".azconfig.io", ".azconfig.azure.cn"); - break; - } - const recorderEnvSetup: RecorderEnvironmentSetup = { replaceableVariables: { APPCONFIG_CONNECTION_STRING: From cdfd62af16ad4c9b95fcc2443345b28bb4779a24 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 5 Aug 2021 14:57:33 +0800 Subject: [PATCH 019/133] update yml file --- sdk/appconfiguration/app-configuration/tests.yml | 2 +- sdk/eventhub/event-hubs/tests.yml | 4 ++-- sdk/search/search-documents/tests.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/appconfiguration/app-configuration/tests.yml b/sdk/appconfiguration/app-configuration/tests.yml index 4786b1fddff7..ac1c7dd87af5 100644 --- a/sdk/appconfiguration/app-configuration/tests.yml +++ b/sdk/appconfiguration/app-configuration/tests.yml @@ -6,7 +6,7 @@ stages: PackageName: "@azure/app-configuration" ServiceDirectory: appconfiguration TimeoutInMinutes: 200 - Clouds: 'Public,UsGov,China,Canary' + SupportedClouds: 'Public,UsGov,China,Canary' EnvVars: AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index e6f4d58d3cd8..bba3d3e8a9d1 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -5,8 +5,8 @@ stages: parameters: PackageName: "@azure/event-hubs" ServiceDirectory: eventhub - TimeoutInMinutes: 180 - Clouds: 'Public,UsGov,China,Canary' + TimeoutInMinutes: 360 + SupportedClouds: 'Public,UsGov,China,Canary' EnvVars: AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) diff --git a/sdk/search/search-documents/tests.yml b/sdk/search/search-documents/tests.yml index c98dd91970d6..40ae6e826d97 100644 --- a/sdk/search/search-documents/tests.yml +++ b/sdk/search/search-documents/tests.yml @@ -6,4 +6,4 @@ stages: PackageName: "@azure/search-documents" ServiceDirectory: search TimeoutInMinutes: 300 - Clouds: 'Public,UsGov,China,Canary' + SupportedClouds: 'Public,UsGov,China,Canary' From 3211fe4f8fa10f2c2dbedfe5fc49298a8a8c46bf Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Tue, 10 Aug 2021 10:01:57 +0800 Subject: [PATCH 020/133] update yml files --- sdk/appconfiguration/app-configuration/tests.yml | 2 +- sdk/eventhub/event-hubs/tests.yml | 4 ++-- sdk/search/search-documents/tests.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/appconfiguration/app-configuration/tests.yml b/sdk/appconfiguration/app-configuration/tests.yml index ac1c7dd87af5..30e1ac918deb 100644 --- a/sdk/appconfiguration/app-configuration/tests.yml +++ b/sdk/appconfiguration/app-configuration/tests.yml @@ -6,7 +6,7 @@ stages: PackageName: "@azure/app-configuration" ServiceDirectory: appconfiguration TimeoutInMinutes: 200 - SupportedClouds: 'Public,UsGov,China,Canary' + SupportedClouds: 'Public,UsGov,China' EnvVars: AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index bba3d3e8a9d1..e70bd9f63f26 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -5,8 +5,8 @@ stages: parameters: PackageName: "@azure/event-hubs" ServiceDirectory: eventhub - TimeoutInMinutes: 360 - SupportedClouds: 'Public,UsGov,China,Canary' + TimeoutInMinutes: 240 + SupportedClouds: 'Public,UsGov,China' EnvVars: AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) diff --git a/sdk/search/search-documents/tests.yml b/sdk/search/search-documents/tests.yml index 40ae6e826d97..d91f846981ed 100644 --- a/sdk/search/search-documents/tests.yml +++ b/sdk/search/search-documents/tests.yml @@ -5,5 +5,5 @@ stages: parameters: PackageName: "@azure/search-documents" ServiceDirectory: search - TimeoutInMinutes: 300 - SupportedClouds: 'Public,UsGov,China,Canary' + TimeoutInMinutes: 240 + SupportedClouds: 'Public,UsGov,China' From abd02cf8e73b20040b84f7d33589e0505a01799a Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 11 Aug 2021 15:45:14 +0800 Subject: [PATCH 021/133] update eventhub --- sdk/eventhub/test-resources.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventhub/test-resources.json b/sdk/eventhub/test-resources.json index 131060808c02..668d29d1d5cb 100644 --- a/sdk/eventhub/test-resources.json +++ b/sdk/eventhub/test-resources.json @@ -135,7 +135,7 @@ "type": "Microsoft.Devices/IotHubs", "apiVersion": "[variables('ioTapiVersion')]", "name": "[variables('iotName')]", - "location": "[resourceGroup().location]", + "location": "USGov Arizona", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" ], From 4cbc2245ff9a14a828b31f6b3af399199c0d4667 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 11 Aug 2021 16:59:37 +0800 Subject: [PATCH 022/133] update eventhub --- sdk/eventhub/event-hubs/tests.yml | 3 +++ sdk/eventhub/test-resources.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index e70bd9f63f26..08faf7145df4 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -7,6 +7,9 @@ stages: ServiceDirectory: eventhub TimeoutInMinutes: 240 SupportedClouds: 'Public,UsGov,China' + CloudConfig: + UsGov: + Location: 'usgovarizona' EnvVars: AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) diff --git a/sdk/eventhub/test-resources.json b/sdk/eventhub/test-resources.json index 668d29d1d5cb..131060808c02 100644 --- a/sdk/eventhub/test-resources.json +++ b/sdk/eventhub/test-resources.json @@ -135,7 +135,7 @@ "type": "Microsoft.Devices/IotHubs", "apiVersion": "[variables('ioTapiVersion')]", "name": "[variables('iotName')]", - "location": "USGov Arizona", + "location": "[resourceGroup().location]", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" ], From 7a5d25f763ef31138956cd68363559c726cdd154 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Mon, 23 Aug 2021 09:52:03 +0800 Subject: [PATCH 023/133] update eventhub --- sdk/eventhub/event-hubs/tests.yml | 6 +++--- sdk/textanalytics/ai-text-analytics/tests.yml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index 08faf7145df4..d87bbfcf6a9a 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -11,7 +11,7 @@ stages: UsGov: Location: 'usgovarizona' EnvVars: - AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) - AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) - AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) + AZURE_CLIENT_ID: $(EVENTHUB_CLIENT_ID) + AZURE_CLIENT_SECRET: $(EVENTHUB_CLIENT_SECRET) + AZURE_TENANT_ID: $(EVENTHUB_TENANT_ID) AZURE_LOG_LEVEL: info diff --git a/sdk/textanalytics/ai-text-analytics/tests.yml b/sdk/textanalytics/ai-text-analytics/tests.yml index e2624130e546..ad875e6fa89c 100644 --- a/sdk/textanalytics/ai-text-analytics/tests.yml +++ b/sdk/textanalytics/ai-text-analytics/tests.yml @@ -5,6 +5,8 @@ stages: parameters: PackageName: "@azure/ai-text-analytics" ServiceDirectory: textanalytics + TimeoutInMinutes: 180 + SupportedClouds: 'Public,UsGov,China' EnvVars: AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) From 4fd15dcba0b7bd1ff4392df870d140ae3a45034c Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Tue, 24 Aug 2021 18:17:59 +0800 Subject: [PATCH 024/133] update eventhub --- .../event-hubs/test/public/eventHubConsumerClient.spec.ts | 2 +- sdk/eventhub/event-hubs/tests.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts index df503eeca73d..22a521ad2702 100644 --- a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts +++ b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts @@ -359,7 +359,7 @@ describe("EventHubConsumerClient", () => { }); await loopUntil({ - maxTimes: 10, + maxTimes: 20, name: "Wait for subscription2 to read from all partitions and subscription1 to invoke close handlers", timeBetweenRunsMs: 1000, diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index d87bbfcf6a9a..c03e0ab933de 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -8,8 +8,13 @@ stages: TimeoutInMinutes: 240 SupportedClouds: 'Public,UsGov,China' CloudConfig: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) UsGov: + SubscriptionConfiguration: $(sub-config-gov-test-resources) Location: 'usgovarizona' + China: + SubscriptionConfiguration: $(sub-config-cn-test-resources) EnvVars: AZURE_CLIENT_ID: $(EVENTHUB_CLIENT_ID) AZURE_CLIENT_SECRET: $(EVENTHUB_CLIENT_SECRET) From 78aea01dce265d5cd3a462c7b1f59b125ea44b20 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 26 Aug 2021 10:23:42 +0800 Subject: [PATCH 025/133] update eventhub --- sdk/eventhub/event-hubs/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index c03e0ab933de..fd627bdcf065 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -5,7 +5,7 @@ stages: parameters: PackageName: "@azure/event-hubs" ServiceDirectory: eventhub - TimeoutInMinutes: 240 + TimeoutInMinutes: 120 SupportedClouds: 'Public,UsGov,China' CloudConfig: Public: From 7ac5c4daed9adead8a8a4a58a201749c5421d72b Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 27 Aug 2021 17:26:08 +0800 Subject: [PATCH 026/133] update textanalytics --- .../ai-text-analytics/src/textAnalyticsClient.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts b/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts index 46df0eb0fae3..a0442ed82064 100644 --- a/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts +++ b/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts @@ -429,8 +429,20 @@ export class TextAnalyticsClient { this.client = new GeneratedClient(this.endpointUrl, internalPipelineOptions); + let scopes; + switch (process.env["AZURE_AUTHORITY_HOST"]) { + case "https://login.microsoftonline.us": + scopes = "https://cognitiveservices.azure.us/.default"; + break; + case "https://login.chinacloudapi.cn": + scopes = "https://cognitiveservices.azure.cn/.default"; + break; + default: + scopes = DEFAULT_COGNITIVE_SCOPE; + } + const authPolicy = isTokenCredential(credential) - ? bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_COGNITIVE_SCOPE }) + ? bearerTokenAuthenticationPolicy({ credential, scopes: scopes }) : textAnalyticsAzureKeyCredentialPolicy(credential); this.client.pipeline.addPolicy(authPolicy); From 17fdcd43a7e6f4eac04f9a25bc02b609bab64b1a Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Tue, 31 Aug 2021 13:45:15 +0800 Subject: [PATCH 027/133] update form recognizer --- sdk/formrecognizer/ai-form-recognizer/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/formrecognizer/ai-form-recognizer/tests.yml b/sdk/formrecognizer/ai-form-recognizer/tests.yml index 34647bc739e6..010f3bdd654f 100644 --- a/sdk/formrecognizer/ai-form-recognizer/tests.yml +++ b/sdk/formrecognizer/ai-form-recognizer/tests.yml @@ -16,6 +16,8 @@ stages: PackageName: "@azure/ai-form-recognizer" ServiceDirectory: formrecognizer Location: "${{ parameters.Location }}" + TimeoutInMinutes: 120 + SupportedClouds: 'Public,UsGov,China' EnvVars: AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) From 5d50785eb9bc396573df26b056d4969b28a1c52b Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Tue, 31 Aug 2021 16:39:18 +0800 Subject: [PATCH 028/133] update form recognizer --- sdk/formrecognizer/ai-form-recognizer/tests.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sdk/formrecognizer/ai-form-recognizer/tests.yml b/sdk/formrecognizer/ai-form-recognizer/tests.yml index 010f3bdd654f..f0f26990f973 100644 --- a/sdk/formrecognizer/ai-form-recognizer/tests.yml +++ b/sdk/formrecognizer/ai-form-recognizer/tests.yml @@ -2,11 +2,6 @@ # specifying a different Azure region to use when manually triggering the live # tests pipeline. This is useful for when we want to test in different # environments: Prod, Canary, etc. -parameters: -- name: Location - displayName: Location - type: string - default: canadacentral trigger: none @@ -15,7 +10,6 @@ stages: parameters: PackageName: "@azure/ai-form-recognizer" ServiceDirectory: formrecognizer - Location: "${{ parameters.Location }}" TimeoutInMinutes: 120 SupportedClouds: 'Public,UsGov,China' EnvVars: From bf2774a96b84274f881a14a5e7b1706cb64d38de Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 2 Sep 2021 09:42:15 +0800 Subject: [PATCH 029/133] update text analytics --- sdk/textanalytics/ai-text-analytics/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/textanalytics/ai-text-analytics/tests.yml b/sdk/textanalytics/ai-text-analytics/tests.yml index ad875e6fa89c..59dee7bb1aaf 100644 --- a/sdk/textanalytics/ai-text-analytics/tests.yml +++ b/sdk/textanalytics/ai-text-analytics/tests.yml @@ -8,6 +8,6 @@ stages: TimeoutInMinutes: 180 SupportedClouds: 'Public,UsGov,China' EnvVars: - AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) - AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) - AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_CLIENT_ID: $(TEXTANALYTICS_CLIENT_ID) + AZURE_TENANT_ID: $(TEXTANALYTICS_TENANT_ID) + AZURE_CLIENT_SECRET: $(TEXTANALYTICS_CLIENT_SECRET) From 8a28dbe3d04e240d3bf79f14bb7611fca5e3d438 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 2 Sep 2021 13:56:36 +0800 Subject: [PATCH 030/133] update search document --- sdk/search/search-documents/tests.yml | 1 - sdk/search/test-resources.json | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sdk/search/search-documents/tests.yml b/sdk/search/search-documents/tests.yml index d91f846981ed..82a6b3c683a7 100644 --- a/sdk/search/search-documents/tests.yml +++ b/sdk/search/search-documents/tests.yml @@ -5,5 +5,4 @@ stages: parameters: PackageName: "@azure/search-documents" ServiceDirectory: search - TimeoutInMinutes: 240 SupportedClouds: 'Public,UsGov,China' diff --git a/sdk/search/test-resources.json b/sdk/search/test-resources.json index 7b94b9fbabb6..a16e676a9489 100644 --- a/sdk/search/test-resources.json +++ b/sdk/search/test-resources.json @@ -11,9 +11,9 @@ }, "searchSku": { "type": "string", - "defaultValue": "standard", + "defaultValue": "free", "metadata": { - "description": "SKU for search resource. The default is 'standard'" + "description": "SKU for search resource. The default is 'free'" } } }, From 598c7bd6e2872ecbe4f26ca7d1590a1e9727be09 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 2 Sep 2021 15:37:56 +0800 Subject: [PATCH 031/133] update search --- sdk/search/test-resources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/search/test-resources.json b/sdk/search/test-resources.json index a16e676a9489..afc3cead0b9a 100644 --- a/sdk/search/test-resources.json +++ b/sdk/search/test-resources.json @@ -11,9 +11,9 @@ }, "searchSku": { "type": "string", - "defaultValue": "free", + "defaultValue": "basic", "metadata": { - "description": "SKU for search resource. The default is 'free'" + "description": "SKU for search resource. The default is 'basic'" } } }, From 4597d4607e0b0dd840c420d0ff9c626bc86f126d Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 3 Sep 2021 16:03:23 +0800 Subject: [PATCH 032/133] udpate formrecognizer --- sdk/formrecognizer/test-resources.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/formrecognizer/test-resources.json b/sdk/formrecognizer/test-resources.json index 00b0350466ca..ff0a36b2884f 100644 --- a/sdk/formrecognizer/test-resources.json +++ b/sdk/formrecognizer/test-resources.json @@ -36,7 +36,7 @@ }, "blobResourceId": { "type": "string", - "defaultValue": "[resourceId('2cd617ea-1866-46b1-90e3-fffb087ebf9b', 'TrainingData', 'Microsoft.Storage/storageAccounts', parameters('blobStorageAccount'))]" + "defaultValue": "[resourceId('TrainingData', 'Microsoft.Storage/storageAccounts', parameters('blobStorageAccount'))]" }, "trainingDataSasProperties": { "type": "object", From 1a532dbbdcce8fdd61b2f35bc2259a1e3161d841 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Tue, 7 Sep 2021 09:51:49 +0800 Subject: [PATCH 033/133] update textanalytics --- .../ai-text-analytics/src/textAnalyticsClient.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts b/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts index a0442ed82064..7c47c004c920 100644 --- a/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts +++ b/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts @@ -391,6 +391,14 @@ export class TextAnalyticsClient { */ private readonly client: GeneratedClient; + isBrowser(): boolean { + try { + return typeof self !== "undefined"; + } catch (e) { + return false; + } + } + /** * Creates an instance of TextAnalyticsClient. * @@ -430,7 +438,9 @@ export class TextAnalyticsClient { this.client = new GeneratedClient(this.endpointUrl, internalPipelineOptions); let scopes; - switch (process.env["AZURE_AUTHORITY_HOST"]) { + const env = this.isBrowser() ? (self as any).__env__ : process.env; + + switch (env["AZURE_AUTHORITY_HOST"]) { case "https://login.microsoftonline.us": scopes = "https://cognitiveservices.azure.us/.default"; break; From f8c1d51e66501eb3c7f6011fac9238247214ba7a Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 9 Sep 2021 09:38:29 +0800 Subject: [PATCH 034/133] update formrecognizer --- sdk/formrecognizer/test-resources.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk/formrecognizer/test-resources.json b/sdk/formrecognizer/test-resources.json index ff0a36b2884f..d45c37e59639 100644 --- a/sdk/formrecognizer/test-resources.json +++ b/sdk/formrecognizer/test-resources.json @@ -68,6 +68,10 @@ "signedPermission": "rl", "signedResource": "c" } + }, + "cognitiveServicesEndpointSuffix": { + "type": "string", + "defaultValue": ".cognitiveservices.azure.com" } }, "variables": { @@ -101,7 +105,7 @@ "outputs": { "FORM_RECOGNIZER_ENDPOINT": { "type": "string", - "value": "[concat('https://', parameters('baseName'), '.cognitiveservices.azure.com/')]" + "value": "[concat('https://', parameters('baseName'), parameters('cognitiveServicesEndpointSuffix'),'/')]" }, "FORM_RECOGNIZER_API_KEY": { "type": "string", From 5f84ac27b3e868fb63114a201af6806120ffe8d5 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 9 Sep 2021 15:32:32 +0800 Subject: [PATCH 035/133] update form recognizer --- .../test/public/node/formrecognizerclient.spec.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sdk/formrecognizer/ai-form-recognizer/test/public/node/formrecognizerclient.spec.ts b/sdk/formrecognizer/ai-form-recognizer/test/public/node/formrecognizerclient.spec.ts index a70b065ba390..eed80ec04d11 100644 --- a/sdk/formrecognizer/ai-form-recognizer/test/public/node/formrecognizerclient.spec.ts +++ b/sdk/formrecognizer/ai-form-recognizer/test/public/node/formrecognizerclient.spec.ts @@ -31,6 +31,17 @@ type MaybeTypedFormField = matrix([[true, false]] as const, async (useAad) => { describe(`[${useAad ? "AAD" : "API Key"}] FormRecognizerClient NodeJS only`, () => { + console.log("-----------------------------------"); + const aa = env.FORM_RECOGNIZER_ENDPOINT.toString(); + for (var i = 0; i < aa.length; i++) { + console.log(aa[i]); + } + console.log("-----------------------------------"); + const bb = process.env["AZURE_TENANT_ID"]!.toString(); + for (var i = 0; i < bb.length; i++) { + console.log(bb[i]); + } + console.log("-----------------------------------"); const ASSET_PATH = path.resolve(path.join(process.cwd(), "assets")); let client: FormRecognizerClient; let recorder: Recorder; From b47ce276e045703facbf1fd28d643075d38110ea Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 9 Sep 2021 16:39:25 +0800 Subject: [PATCH 036/133] update form recognizer --- sdk/formrecognizer/ai-form-recognizer/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/formrecognizer/ai-form-recognizer/tests.yml b/sdk/formrecognizer/ai-form-recognizer/tests.yml index f0f26990f973..e1b98c170b8b 100644 --- a/sdk/formrecognizer/ai-form-recognizer/tests.yml +++ b/sdk/formrecognizer/ai-form-recognizer/tests.yml @@ -13,6 +13,6 @@ stages: TimeoutInMinutes: 120 SupportedClouds: 'Public,UsGov,China' EnvVars: - AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) - AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) - AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_CLIENT_ID: $(FORMRECOGNIZER_CLIENT_ID) + AZURE_TENANT_ID: $(FORMRECOGNIZER_TENANT_ID) + AZURE_CLIENT_SECRET: $(FORMRECOGNIZER_CLIENT_SECRET) From a40bf9ada20ceb101a50881fe3ca039d61645a75 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 10 Sep 2021 09:52:04 +0800 Subject: [PATCH 037/133] update text analytics --- .../src/textAnalyticsClient.ts | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts b/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts index 7c47c004c920..8927ea0a2481 100644 --- a/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts +++ b/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts @@ -391,13 +391,13 @@ export class TextAnalyticsClient { */ private readonly client: GeneratedClient; - isBrowser(): boolean { - try { - return typeof self !== "undefined"; - } catch (e) { - return false; - } - } + // isBrowser(): boolean { + // try { + // return typeof self !== "undefined"; + // } catch (e) { + // return false; + // } + // } /** * Creates an instance of TextAnalyticsClient. @@ -437,22 +437,22 @@ export class TextAnalyticsClient { this.client = new GeneratedClient(this.endpointUrl, internalPipelineOptions); - let scopes; - const env = this.isBrowser() ? (self as any).__env__ : process.env; - - switch (env["AZURE_AUTHORITY_HOST"]) { - case "https://login.microsoftonline.us": - scopes = "https://cognitiveservices.azure.us/.default"; - break; - case "https://login.chinacloudapi.cn": - scopes = "https://cognitiveservices.azure.cn/.default"; - break; - default: - scopes = DEFAULT_COGNITIVE_SCOPE; - } + // let scopes; + // const env = this.isBrowser() ? (self as any).__env__ : process.env; + + // switch (env["AZURE_AUTHORITY_HOST"]) { + // case "https://login.microsoftonline.us": + // scopes = "https://cognitiveservices.azure.us/.default"; + // break; + // case "https://login.chinacloudapi.cn": + // scopes = "https://cognitiveservices.azure.cn/.default"; + // break; + // default: + // scopes = DEFAULT_COGNITIVE_SCOPE; + // } const authPolicy = isTokenCredential(credential) - ? bearerTokenAuthenticationPolicy({ credential, scopes: scopes }) + ? bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_COGNITIVE_SCOPE }) : textAnalyticsAzureKeyCredentialPolicy(credential); this.client.pipeline.addPolicy(authPolicy); From 662c68c3c3ead1650d8cba2480fdb8f3db9e60a9 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 10 Sep 2021 17:20:34 +0800 Subject: [PATCH 038/133] update form recognizer --- .../public/node/formrecognizerclient.spec.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/sdk/formrecognizer/ai-form-recognizer/test/public/node/formrecognizerclient.spec.ts b/sdk/formrecognizer/ai-form-recognizer/test/public/node/formrecognizerclient.spec.ts index eed80ec04d11..1a0f10b4fe68 100644 --- a/sdk/formrecognizer/ai-form-recognizer/test/public/node/formrecognizerclient.spec.ts +++ b/sdk/formrecognizer/ai-form-recognizer/test/public/node/formrecognizerclient.spec.ts @@ -31,17 +31,28 @@ type MaybeTypedFormField = matrix([[true, false]] as const, async (useAad) => { describe(`[${useAad ? "AAD" : "API Key"}] FormRecognizerClient NodeJS only`, () => { - console.log("-----------------------------------"); + console.log("-----------------------------------1"); const aa = env.FORM_RECOGNIZER_ENDPOINT.toString(); for (var i = 0; i < aa.length; i++) { console.log(aa[i]); } - console.log("-----------------------------------"); + console.log("-----------------------------------2"); const bb = process.env["AZURE_TENANT_ID"]!.toString(); for (var i = 0; i < bb.length; i++) { console.log(bb[i]); } - console.log("-----------------------------------"); + console.log("-----------------------------------3"); + const cc = process.env["TEST_MODE"]!.toString(); + for (var i = 0; i < cc.length; i++) { + console.log(cc[i]); + } + console.log("-----------------------------------4"); + const dd = process.env["FORM_RECOGNIZER_TARGET_RESOURCE_REGION"]!.toString(); + for (var i = 0; i < dd.length; i++) { + console.log(dd[i]); + } + console.log("-----------------------------------5"); + const ASSET_PATH = path.resolve(path.join(process.cwd(), "assets")); let client: FormRecognizerClient; let recorder: Recorder; From c55f195cf1c52051329e77e502c2c813772bf9b1 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Sat, 11 Sep 2021 14:09:21 +0800 Subject: [PATCH 039/133] update app configuration --- .../app-configuration/test/public/auth.spec.ts | 9 --------- sdk/appconfiguration/test-resources.json | 6 +++++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/sdk/appconfiguration/app-configuration/test/public/auth.spec.ts b/sdk/appconfiguration/app-configuration/test/public/auth.spec.ts index 41f71ca63a48..864a98e2cb7a 100644 --- a/sdk/appconfiguration/app-configuration/test/public/auth.spec.ts +++ b/sdk/appconfiguration/app-configuration/test/public/auth.spec.ts @@ -32,15 +32,6 @@ describe("Authentication", () => { }); it("token authentication works", async function() { - switch (process.env["AZURE_AUTHORITY_HOST"]) { - case "https://login.microsoftonline.us": - credsAndEndpoint.endpoint = credsAndEndpoint.endpoint.toString().replace(".azconfig.io", ".azconfig.azure.us"); - break; - case "https://login.chinacloudapi.cn": - credsAndEndpoint.endpoint = credsAndEndpoint.endpoint.toString().replace(".azconfig.io", ".azconfig.azure.cn"); - break; - } - const client = new AppConfigurationClient( credsAndEndpoint.endpoint, credsAndEndpoint.credential diff --git a/sdk/appconfiguration/test-resources.json b/sdk/appconfiguration/test-resources.json index e006c73adfb7..c1dccf607abb 100644 --- a/sdk/appconfiguration/test-resources.json +++ b/sdk/appconfiguration/test-resources.json @@ -12,12 +12,16 @@ "sku": { "defaultValue": "Standard", "type": "string" + }, + "azConfigEndpointSuffix": { + "defaultValue": ".azconfig.io", + "type": "string" } }, "variables": { "configurationApiVersion": "2019-10-01", "accountName": "[parameters('baseName')]", - "endpoint": "[concat('https://', parameters('baseName'), '.azconfig.io')]" + "endpoint": "[concat('https://', parameters('baseName'), parameters('azConfigEndpointSuffix'))]" }, "resources": [ { From 48e0e718b3449c45202cfca2950bad2a20f00ca4 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Sat, 11 Sep 2021 17:11:38 +0800 Subject: [PATCH 040/133] update service bus --- sdk/servicebus/service-bus/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/servicebus/service-bus/tests.yml b/sdk/servicebus/service-bus/tests.yml index d94331babded..6d0513e5cff0 100644 --- a/sdk/servicebus/service-bus/tests.yml +++ b/sdk/servicebus/service-bus/tests.yml @@ -6,9 +6,9 @@ stages: PackageName: "@azure/service-bus" ServiceDirectory: servicebus TimeoutInMinutes: 180 - Clouds: 'Public,Canary' + SupportedClouds: 'Public,UsGov,China' EnvVars: - AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) - AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) - AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_CLIENT_ID: $(SERVICEBUS_CLIENT_ID) + AZURE_TENANT_ID: $(SERVICEBUS_TENANT_ID) + AZURE_CLIENT_SECRET: $(SERVICEBUS_CLIENT_SECRET) AZURE_SUBSCRIPTION_ID: $(test-subscription-id) From 822ed95b7db156b3fda7a2b755a9081e9c4f3fe6 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 15 Sep 2021 14:15:22 +0800 Subject: [PATCH 041/133] update appconfiguration --- sdk/appconfiguration/app-configuration/tests.yml | 8 ++++---- sdk/appconfiguration/test-resources.json | 16 ++++++++++++++++ sdk/servicebus/service-bus/tests.yml | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/sdk/appconfiguration/app-configuration/tests.yml b/sdk/appconfiguration/app-configuration/tests.yml index 30e1ac918deb..72f15de8fc34 100644 --- a/sdk/appconfiguration/app-configuration/tests.yml +++ b/sdk/appconfiguration/app-configuration/tests.yml @@ -5,9 +5,9 @@ stages: parameters: PackageName: "@azure/app-configuration" ServiceDirectory: appconfiguration - TimeoutInMinutes: 200 + TimeoutInMinutes: 120 SupportedClouds: 'Public,UsGov,China' EnvVars: - AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) - AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) - AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_CLIENT_ID: $(APPCONFIGURATION_CLIENT_ID) + AZURE_TENANT_ID: $(APPCONFIGURATION_TENANT_ID) + AZURE_CLIENT_SECRET: $(APPCONFIGURATION_CLIENT_SECRET) diff --git a/sdk/appconfiguration/test-resources.json b/sdk/appconfiguration/test-resources.json index c1dccf607abb..14214ae2f6a6 100644 --- a/sdk/appconfiguration/test-resources.json +++ b/sdk/appconfiguration/test-resources.json @@ -16,10 +16,17 @@ "azConfigEndpointSuffix": { "defaultValue": ".azconfig.io", "type": "string" + }, + "testApplicationOid": { + "type": "string", + "metadata": { + "description": "The client OID to grant access to test resources." + } } }, "variables": { "configurationApiVersion": "2019-10-01", + "roleDefinitionId": "[format('/subscriptions/{0}/providers/Microsoft.Authorization/roleDefinitions/5ae67dd6-50cb-40e7-96ff-dc2bfa4b606b', subscription().subscriptionId)]", "accountName": "[parameters('baseName')]", "endpoint": "[concat('https://', parameters('baseName'), parameters('azConfigEndpointSuffix'))]" }, @@ -35,6 +42,15 @@ "properties": { "endpoint": "[variables('endpoint')]" } + }, + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2018-09-01-preview", + "name": "[guid(resourceGroup().id)]", + "properties": { + "roleDefinitionId": "[variables('roleDefinitionId')]", + "principalId": "[parameters('testApplicationOid')]" + } } ], "outputs": { diff --git a/sdk/servicebus/service-bus/tests.yml b/sdk/servicebus/service-bus/tests.yml index 6d0513e5cff0..b3558481d2f4 100644 --- a/sdk/servicebus/service-bus/tests.yml +++ b/sdk/servicebus/service-bus/tests.yml @@ -5,7 +5,7 @@ stages: parameters: PackageName: "@azure/service-bus" ServiceDirectory: servicebus - TimeoutInMinutes: 180 + TimeoutInMinutes: 120 SupportedClouds: 'Public,UsGov,China' EnvVars: AZURE_CLIENT_ID: $(SERVICEBUS_CLIENT_ID) From caf330e9c2514a8cf74ab673f60844e3080596ba Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 15 Sep 2021 15:27:33 +0800 Subject: [PATCH 042/133] update app configuration --- sdk/appconfiguration/test-resources.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/appconfiguration/test-resources.json b/sdk/appconfiguration/test-resources.json index 14214ae2f6a6..57c6551c9dd2 100644 --- a/sdk/appconfiguration/test-resources.json +++ b/sdk/appconfiguration/test-resources.json @@ -56,7 +56,7 @@ "outputs": { "APPCONFIG_CONNECTION_STRING": { "type": "string", - "value": "[listKeys(resourceId('Microsoft.AppConfiguration/configurationStores', variables('accountName')), variables('configurationApiVersion')).value[0].connectionString]" + "value": "[listKeys(resourceId('Microsoft.AppConfiguration/configurationStores', variables('accountName')), '2019-02-01-preview').value[0].connectionString]" }, "AZ_CONFIG_ENDPOINT": { "type": "string", From 79fc1e7fbdf90b8e231332ef1e775da74d04e392 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 15 Sep 2021 16:19:52 +0800 Subject: [PATCH 043/133] update app configuration --- .../src/appConfigCredential.ts | 2 +- .../app-configuration/tests.yml | 8 +++---- sdk/appconfiguration/test-resources.json | 24 ++----------------- 3 files changed, 6 insertions(+), 28 deletions(-) diff --git a/sdk/appconfiguration/app-configuration/src/appConfigCredential.ts b/sdk/appconfiguration/app-configuration/src/appConfigCredential.ts index 3bbb4a6c7244..23efc2e74c25 100644 --- a/sdk/appconfiguration/app-configuration/src/appConfigCredential.ts +++ b/sdk/appconfiguration/app-configuration/src/appConfigCredential.ts @@ -47,7 +47,7 @@ export class AppConfigCredential implements ServiceClientCredentials { webResource.headers.set("x-ms-content-sha256", contentHash); webResource.headers.set( "Authorization", - `HMAC-SHA256 Credential=${this.credential}&SignedHeaders=${signedHeaders}&Signature=${signature}` + `HMAC-SHA256 Credential=${this.credential}, SignedHeaders=${signedHeaders}, Signature=${signature}` ); return webResource; diff --git a/sdk/appconfiguration/app-configuration/tests.yml b/sdk/appconfiguration/app-configuration/tests.yml index 72f15de8fc34..3aadd98bc2d0 100644 --- a/sdk/appconfiguration/app-configuration/tests.yml +++ b/sdk/appconfiguration/app-configuration/tests.yml @@ -5,9 +5,7 @@ stages: parameters: PackageName: "@azure/app-configuration" ServiceDirectory: appconfiguration - TimeoutInMinutes: 120 - SupportedClouds: 'Public,UsGov,China' EnvVars: - AZURE_CLIENT_ID: $(APPCONFIGURATION_CLIENT_ID) - AZURE_TENANT_ID: $(APPCONFIGURATION_TENANT_ID) - AZURE_CLIENT_SECRET: $(APPCONFIGURATION_CLIENT_SECRET) + AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) + AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) + AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) diff --git a/sdk/appconfiguration/test-resources.json b/sdk/appconfiguration/test-resources.json index 57c6551c9dd2..e006c73adfb7 100644 --- a/sdk/appconfiguration/test-resources.json +++ b/sdk/appconfiguration/test-resources.json @@ -12,23 +12,12 @@ "sku": { "defaultValue": "Standard", "type": "string" - }, - "azConfigEndpointSuffix": { - "defaultValue": ".azconfig.io", - "type": "string" - }, - "testApplicationOid": { - "type": "string", - "metadata": { - "description": "The client OID to grant access to test resources." - } } }, "variables": { "configurationApiVersion": "2019-10-01", - "roleDefinitionId": "[format('/subscriptions/{0}/providers/Microsoft.Authorization/roleDefinitions/5ae67dd6-50cb-40e7-96ff-dc2bfa4b606b', subscription().subscriptionId)]", "accountName": "[parameters('baseName')]", - "endpoint": "[concat('https://', parameters('baseName'), parameters('azConfigEndpointSuffix'))]" + "endpoint": "[concat('https://', parameters('baseName'), '.azconfig.io')]" }, "resources": [ { @@ -42,21 +31,12 @@ "properties": { "endpoint": "[variables('endpoint')]" } - }, - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2018-09-01-preview", - "name": "[guid(resourceGroup().id)]", - "properties": { - "roleDefinitionId": "[variables('roleDefinitionId')]", - "principalId": "[parameters('testApplicationOid')]" - } } ], "outputs": { "APPCONFIG_CONNECTION_STRING": { "type": "string", - "value": "[listKeys(resourceId('Microsoft.AppConfiguration/configurationStores', variables('accountName')), '2019-02-01-preview').value[0].connectionString]" + "value": "[listKeys(resourceId('Microsoft.AppConfiguration/configurationStores', variables('accountName')), variables('configurationApiVersion')).value[0].connectionString]" }, "AZ_CONFIG_ENDPOINT": { "type": "string", From 984b5c72edcef4a139b20a6fcc6d373a744a8a5d Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Sat, 18 Sep 2021 15:25:20 +0800 Subject: [PATCH 044/133] update textanalytics --- .../src/textAnalyticsClient.ts | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts b/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts index 8927ea0a2481..46df0eb0fae3 100644 --- a/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts +++ b/sdk/textanalytics/ai-text-analytics/src/textAnalyticsClient.ts @@ -391,14 +391,6 @@ export class TextAnalyticsClient { */ private readonly client: GeneratedClient; - // isBrowser(): boolean { - // try { - // return typeof self !== "undefined"; - // } catch (e) { - // return false; - // } - // } - /** * Creates an instance of TextAnalyticsClient. * @@ -437,20 +429,6 @@ export class TextAnalyticsClient { this.client = new GeneratedClient(this.endpointUrl, internalPipelineOptions); - // let scopes; - // const env = this.isBrowser() ? (self as any).__env__ : process.env; - - // switch (env["AZURE_AUTHORITY_HOST"]) { - // case "https://login.microsoftonline.us": - // scopes = "https://cognitiveservices.azure.us/.default"; - // break; - // case "https://login.chinacloudapi.cn": - // scopes = "https://cognitiveservices.azure.cn/.default"; - // break; - // default: - // scopes = DEFAULT_COGNITIVE_SCOPE; - // } - const authPolicy = isTokenCredential(credential) ? bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_COGNITIVE_SCOPE }) : textAnalyticsAzureKeyCredentialPolicy(credential); From 56db02996d88a4ccfba67500c4b77e247375c9a2 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Sat, 18 Sep 2021 17:30:59 +0800 Subject: [PATCH 045/133] update event hub --- .../event-hubs/test/public/eventHubConsumerClient.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts index d037f84e70e6..8d79eae228b5 100644 --- a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts +++ b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts @@ -374,7 +374,7 @@ testWithServiceTypes((serviceVersion) => { }); await loopUntil({ - maxTimes: 10, + maxTimes: 20, name: "Wait for subscription2 to read from all partitions and subscription1 to invoke close handlers", timeBetweenRunsMs: 1000, From 99c637209e2d1b2d2c04fe74a3a148e278d1c538 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 23 Sep 2021 14:38:54 +0800 Subject: [PATCH 046/133] update service bus --- .../service-bus/test/internal/serviceBusClient.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts b/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts index 6bf5b22250fa..92138813d882 100644 --- a/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts +++ b/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts @@ -313,7 +313,7 @@ describe("ServiceBusClient live tests", () => { const env = getEnvVars(); const serviceBusEndpoint = (env.SERVICEBUS_CONNECTION_STRING.match( - "Endpoint=sb://((.*).servicebus.windows.net)" + "Endpoint=sb://((.*).servicebus.(windows.net|usgovcloudapi.net|chinacloudapi.cn))" ) || "")[1]; /** From 597ab49f029b83512597182c95a8b6dc5fd2c4f8 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 23 Sep 2021 15:35:03 +0800 Subject: [PATCH 047/133] update service bus --- sdk/servicebus/service-bus/test/public/atomManagement.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/servicebus/service-bus/test/public/atomManagement.spec.ts b/sdk/servicebus/service-bus/test/public/atomManagement.spec.ts index aceb779e5495..9d64faeac496 100644 --- a/sdk/servicebus/service-bus/test/public/atomManagement.spec.ts +++ b/sdk/servicebus/service-bus/test/public/atomManagement.spec.ts @@ -390,7 +390,7 @@ describe("Atom management - Authentication", function(): void { ); should.equal( (await serviceBusAdministrationClient.getNamespaceProperties()).name, - (host.match("(.*).servicebus.windows.net") || [])[1], + (host.match("(.*).servicebus.(windows.net|usgovcloudapi.net|chinacloudapi.cn)") || [])[1], "Unexpected namespace name in the getNamespaceProperties response" ); await serviceBusAdministrationClient.deleteQueue(managementQueue1); @@ -413,7 +413,7 @@ describe("Atom management - Authentication", function(): void { should.equal( (await serviceBusAdministrationClient.getNamespaceProperties()).name, - (host.match("(.*).servicebus.windows.net") || [])[1], + (host.match("(.*).servicebus.(windows.net|usgovcloudapi.net|chinacloudapi.cn)") || [])[1], "Unexpected namespace name in the getNamespaceProperties response" ); }); From 394f257e353ea7ebdae22c1c9f83ce257dcabcd1 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 24 Sep 2021 10:23:29 +0800 Subject: [PATCH 048/133] update key vault keys --- sdk/keyvault/keyvault-keys/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/keyvault/keyvault-keys/tests.yml b/sdk/keyvault/keyvault-keys/tests.yml index 46ac057d46a5..4beb8da2771c 100644 --- a/sdk/keyvault/keyvault-keys/tests.yml +++ b/sdk/keyvault/keyvault-keys/tests.yml @@ -6,17 +6,17 @@ stages: PackageName: "@azure/keyvault-keys" ServiceDirectory: keyvault TimeoutInMinutes: 90 + SupportedClouds: 'Public,UsGov,China' # KV HSM limitation prevents us from running live tests # against multiple platforms in parallel (we're limited to a single # instance per region per subscription) so we're only running # live tests against a single instance. - Location: eastus2 AdditionalMatrixConfigs: - Name: Keyvault_live_test_base Path: sdk/keyvault/keyvault-keys/platform-matrix.json Selection: sparse GenerateVMJobs: true EnvVars: - AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) - AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) - AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_CLIENT_ID: $(KEYVAULTKEYS_CLIENT_ID) + AZURE_TENANT_ID: $(KEYVAULTKEYS_TENANT_ID) + AZURE_CLIENT_SECRET: $(KEYVAULTKEYS_CLIENT_SECRET) From fd8d96c09c070d8a0e4f4f4fae4d884feec4b44c Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 24 Sep 2021 13:59:31 +0800 Subject: [PATCH 049/133] update service bus --- sdk/servicebus/service-bus/test/public/utils/testUtils.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sdk/servicebus/service-bus/test/public/utils/testUtils.ts b/sdk/servicebus/service-bus/test/public/utils/testUtils.ts index 72a1ea4880cd..cb128f23b1bc 100644 --- a/sdk/servicebus/service-bus/test/public/utils/testUtils.ts +++ b/sdk/servicebus/service-bus/test/public/utils/testUtils.ts @@ -155,8 +155,14 @@ export async function checkWithTimeout( maxWaitTimeInMilliseconds: number = 10000 ): Promise { const maxTime = Date.now() + maxWaitTimeInMilliseconds; + console.log("11111111111111", Date.now()); + console.log("22222222222222", maxTime); while (Date.now() < maxTime) { - if (await predicate()) return true; + console.log("3333333333333333"); + if (await predicate()) { + console.log("44444444444444"); + return true; + } await delay(delayBetweenRetriesInMilliseconds); } return false; From 1ceef9e5f7a60346e0303c87533b3711c98a9984 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 24 Sep 2021 15:03:51 +0800 Subject: [PATCH 050/133] update key vault keys --- .../keyvault-keys/test/public/recoverBackupRestore.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts index f15aaf5d7f2e..ead9578d582f 100644 --- a/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts @@ -19,6 +19,12 @@ describe("Keys client - restore keys and recover backups", () => { let recorder: Recorder; beforeEach(async function(this: Context) { + console.log("----------------------"); + var aa = process.env["AZURE_TENANT_ID"]!.toString(); + for (var i = 0; i < aa.length; i++) { + console.log(aa[i]); + } + console.log("----------------------"); const authentication = await authenticate(this, getServiceVersion()); keySuffix = authentication.keySuffix; client = authentication.client; From 207b754bdd7e656833f2ff51553f95a37bdc0660 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 29 Sep 2021 09:43:09 +0800 Subject: [PATCH 051/133] update key vault keys --- sdk/keyvault/keyvault-keys/tests.yml | 6 +++--- .../test/internal/serviceBusClient.spec.ts | 16 +++++++++++++++- .../service-bus/test/public/utils/testUtils.ts | 9 +++++++-- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/sdk/keyvault/keyvault-keys/tests.yml b/sdk/keyvault/keyvault-keys/tests.yml index 4beb8da2771c..b876dbf21d0b 100644 --- a/sdk/keyvault/keyvault-keys/tests.yml +++ b/sdk/keyvault/keyvault-keys/tests.yml @@ -17,6 +17,6 @@ stages: Selection: sparse GenerateVMJobs: true EnvVars: - AZURE_CLIENT_ID: $(KEYVAULTKEYS_CLIENT_ID) - AZURE_TENANT_ID: $(KEYVAULTKEYS_TENANT_ID) - AZURE_CLIENT_SECRET: $(KEYVAULTKEYS_CLIENT_SECRET) + AZURE_CLIENT_ID: $(KEYVAULT_CLIENT_ID) + AZURE_TENANT_ID: $(KEYVAULT_TENANT_ID) + AZURE_CLIENT_SECRET: $(KEYVAULT_CLIENT_SECRET) diff --git a/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts b/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts index 92138813d882..534f6c7353b6 100644 --- a/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts +++ b/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts @@ -195,17 +195,24 @@ describe("ServiceBusClient live tests", () => { }); const testError = (err: Error | ServiceBusError, entityPath: string): void => { + console.log("9191919191", err); if (!isServiceBusError(err)) { + console.log("939393939339"); should.equal(true, false, "Error expected to be instance of ServiceBusError"); } else { + const err1:ServiceBusError = err; + console.log("77777777777777", err1.code); should.equal(err.code, "MessagingEntityNotFound", "Error code is different than expected"); + console.log("88888888888888", err1.message); should.equal( - err.message.includes( + err1.message.includes( `The messaging entity 'sb://${sbClient.fullyQualifiedNamespace}/${entityPath}' could not be found.` ), true ); + console.log("9999999999999999"); errorWasThrown = true; + console.log("13131313131", errorWasThrown); } }; @@ -245,22 +252,29 @@ describe("ServiceBusClient live tests", () => { entityPath: args.entityPath, fullyQualifiedNamespace: args.fullyQualifiedNamespace }; + console.log("6666666666666", actual); + console.log("121212121", errorWasThrown); actual.should.deep.equal({ errorSource: "receive", entityPath: receiver.entityPath, fullyQualifiedNamespace: sbClient.fullyQualifiedNamespace } as Omit); + console.log("14141414"); testError(args.error, "some-name"); + console.log("1515151515"); } }); + console.log("55555555555", errorWasThrown); + should.equal( await checkWithTimeout(() => errorWasThrown === true, 10, 3000), true, "Error thrown flag must be true" ); + console.log("1616161616"); await receiver.close(); }); diff --git a/sdk/servicebus/service-bus/test/public/utils/testUtils.ts b/sdk/servicebus/service-bus/test/public/utils/testUtils.ts index cb128f23b1bc..d25be72f1fd1 100644 --- a/sdk/servicebus/service-bus/test/public/utils/testUtils.ts +++ b/sdk/servicebus/service-bus/test/public/utils/testUtils.ts @@ -158,13 +158,18 @@ export async function checkWithTimeout( console.log("11111111111111", Date.now()); console.log("22222222222222", maxTime); while (Date.now() < maxTime) { - console.log("3333333333333333"); - if (await predicate()) { + const aa = await predicate(); + console.log("3333333333333333", aa); + console.log("3434343434", Date.now()); + if (aa) { console.log("44444444444444"); return true; } + console.log("171717171717"); await delay(delayBetweenRetriesInMilliseconds); + console.log("181818181818"); } + console.log("191919191919"); return false; } From 01a6fbaa46ab3703279314c946269a80ceb9ee90 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 29 Sep 2021 10:48:54 +0800 Subject: [PATCH 052/133] update key vault keys --- .../keyvault-keys/test/public/recoverBackupRestore.spec.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts index ead9578d582f..f15aaf5d7f2e 100644 --- a/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts @@ -19,12 +19,6 @@ describe("Keys client - restore keys and recover backups", () => { let recorder: Recorder; beforeEach(async function(this: Context) { - console.log("----------------------"); - var aa = process.env["AZURE_TENANT_ID"]!.toString(); - for (var i = 0; i < aa.length; i++) { - console.log(aa[i]); - } - console.log("----------------------"); const authentication = await authenticate(this, getServiceVersion()); keySuffix = authentication.keySuffix; client = authentication.client; From 95edae7764a69d8fbf9ab32606df9c02d22a312b Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 30 Sep 2021 14:13:06 +0800 Subject: [PATCH 053/133] update key vault keys --- sdk/keyvault/keyvault-keys/tests.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sdk/keyvault/keyvault-keys/tests.yml b/sdk/keyvault/keyvault-keys/tests.yml index b876dbf21d0b..275dc9948d2a 100644 --- a/sdk/keyvault/keyvault-keys/tests.yml +++ b/sdk/keyvault/keyvault-keys/tests.yml @@ -16,6 +16,16 @@ stages: Path: sdk/keyvault/keyvault-keys/platform-matrix.json Selection: sparse GenerateVMJobs: true + CloudConfig: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + Location: 'eastus2' + UsGov: + SubscriptionConfiguration: $(sub-config-gov-test-resources) + Location: 'usgovarizona' + China: + SubscriptionConfiguration: $(sub-config-cn-test-resources) + Location: 'chinanorth' EnvVars: AZURE_CLIENT_ID: $(KEYVAULT_CLIENT_ID) AZURE_TENANT_ID: $(KEYVAULT_TENANT_ID) From d35cc657db702d17956e9279566073db0ae28530 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 30 Sep 2021 15:39:25 +0800 Subject: [PATCH 054/133] update key vault secrets --- sdk/keyvault/keyvault-secrets/tests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sdk/keyvault/keyvault-secrets/tests.yml b/sdk/keyvault/keyvault-secrets/tests.yml index b11c64823741..a0a19ff6a525 100644 --- a/sdk/keyvault/keyvault-secrets/tests.yml +++ b/sdk/keyvault/keyvault-secrets/tests.yml @@ -6,7 +6,8 @@ stages: PackageName: "@azure/keyvault-secrets" ServiceDirectory: keyvault TimeoutInMinutes: 59 + SupportedClouds: 'Public,UsGov,China' EnvVars: - AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) - AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) - AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_CLIENT_ID: $(KEYVAULT_CLIENT_ID) + AZURE_TENANT_ID: $(KEYVAULT_TENANT_ID) + AZURE_CLIENT_SECRET: $(KEYVAULT_CLIENT_SECRET) From 0aea99bb69650632b2652cf20cd6a3713a4c1457 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 30 Sep 2021 16:58:50 +0800 Subject: [PATCH 055/133] update key vault secret --- sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts index dbc3b9bdbc84..1fb5910aa770 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts @@ -85,6 +85,10 @@ describe("Secrets client - Long Running Operations - delete", () => { // On playback mode, the tests happen too fast for the timeout to work it("can attempt to delete a secret with requestOptions timeout", async function(this: Context) { + var aa = (self as any).__env__.AZURE_TENANT_ID.toString(); + for (var i = 0; i < aa.length; i++) { + console.log(aa[i]); + } recorder.skip(undefined, "Timeout tests don't work on playback mode."); const secretName = testClient.formatName( `${secretPrefix}-${this!.test!.title}-${secretSuffix}` From efd3738b724ff371a5ff6ae35f0f297da82f1f4a Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 8 Oct 2021 14:11:24 +0800 Subject: [PATCH 056/133] update key vault --- sdk/keyvault/test-resources.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/keyvault/test-resources.json b/sdk/keyvault/test-resources.json index 9cbf08fc25af..214aff835c2d 100644 --- a/sdk/keyvault/test-resources.json +++ b/sdk/keyvault/test-resources.json @@ -318,6 +318,10 @@ "type": "string", "condition": "[parameters('enableHsm')]", "value": "[concat('https://', reference(resourceId('Microsoft.Web/sites', variables('attestationAppName')), '2018-02-01').defaultHostName, '/')]" + }, + "OID": { + "type": "string", + "value": "[parameters('provisionerApplicationOid')]" } } } From 6a9a9c1854ef0dbf38612f3adc2fab27902728ec Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 8 Oct 2021 15:13:55 +0800 Subject: [PATCH 057/133] update key vault secrets --- sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts index 1fb5910aa770..dbc3b9bdbc84 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts @@ -85,10 +85,6 @@ describe("Secrets client - Long Running Operations - delete", () => { // On playback mode, the tests happen too fast for the timeout to work it("can attempt to delete a secret with requestOptions timeout", async function(this: Context) { - var aa = (self as any).__env__.AZURE_TENANT_ID.toString(); - for (var i = 0; i < aa.length; i++) { - console.log(aa[i]); - } recorder.skip(undefined, "Timeout tests don't work on playback mode."); const secretName = testClient.formatName( `${secretPrefix}-${this!.test!.title}-${secretSuffix}` From 6f18e8bcef2fda7a11fbdb3591d19eb0b373b594 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 8 Oct 2021 17:28:29 +0800 Subject: [PATCH 058/133] update key vault secrets --- sdk/keyvault/keyvault-secrets/test/public/list.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts index 16674c84f0a5..449b660c4f88 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts @@ -40,6 +40,12 @@ describe("Secret client - list secrets in various ways", () => { // The next tests will produce a more consistent output. // This test is only useful while developing locally. it("can purge all secrets", async function(this: Context): Promise { + console.log("------------------"); + var aa = process.env["OID"].toString(); + for (var i = 0; i < aa.length; i++) { + console.log(aa[i]); + } + console.log("-------------------"); // WARNING: When TEST_MODE equals "record", all of the secrets in the indicated KEYVAULT_URI will be deleted as part of this test. if (!isRecordMode()) { return this.skip(); From 08d7c710afc2bbd98b8bfed7e8c5e028a592f29e Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Sat, 9 Oct 2021 09:46:38 +0800 Subject: [PATCH 059/133] update key vault secrets --- sdk/keyvault/keyvault-secrets/test/public/list.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts index 449b660c4f88..ca26f7a6f391 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts @@ -41,7 +41,7 @@ describe("Secret client - list secrets in various ways", () => { // This test is only useful while developing locally. it("can purge all secrets", async function(this: Context): Promise { console.log("------------------"); - var aa = process.env["OID"].toString(); + var aa = process.env["OID"]!.toString(); for (var i = 0; i < aa.length; i++) { console.log(aa[i]); } From 12f3831602c502cebc86563962d909e17dd05658 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Mon, 11 Oct 2021 14:05:38 +0800 Subject: [PATCH 060/133] update key vault keys --- sdk/keyvault/keyvault-keys/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/keyvault/keyvault-keys/tests.yml b/sdk/keyvault/keyvault-keys/tests.yml index 275dc9948d2a..3b99fca6e051 100644 --- a/sdk/keyvault/keyvault-keys/tests.yml +++ b/sdk/keyvault/keyvault-keys/tests.yml @@ -22,7 +22,7 @@ stages: Location: 'eastus2' UsGov: SubscriptionConfiguration: $(sub-config-gov-test-resources) - Location: 'usgovarizona' + Location: 'usgovvirginia' China: SubscriptionConfiguration: $(sub-config-cn-test-resources) Location: 'chinanorth' From 6530ae26d51e395d319f7fc950838602c9519294 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Mon, 11 Oct 2021 17:52:17 +0800 Subject: [PATCH 061/133] update key vault keys --- sdk/keyvault/keyvault-keys/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/keyvault/keyvault-keys/tests.yml b/sdk/keyvault/keyvault-keys/tests.yml index 3b99fca6e051..471f4bb13a26 100644 --- a/sdk/keyvault/keyvault-keys/tests.yml +++ b/sdk/keyvault/keyvault-keys/tests.yml @@ -22,10 +22,10 @@ stages: Location: 'eastus2' UsGov: SubscriptionConfiguration: $(sub-config-gov-test-resources) - Location: 'usgovvirginia' + Location: 'usgovtexas' China: SubscriptionConfiguration: $(sub-config-cn-test-resources) - Location: 'chinanorth' + Location: 'chinaeast' EnvVars: AZURE_CLIENT_ID: $(KEYVAULT_CLIENT_ID) AZURE_TENANT_ID: $(KEYVAULT_TENANT_ID) From 01be10edb1d8d3603a73c9e2eef1b1be272058df Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Tue, 12 Oct 2021 17:24:43 +0800 Subject: [PATCH 062/133] update key vault secrets --- sdk/keyvault/keyvault-secrets/test/public/list.spec.ts | 9 +++++---- sdk/keyvault/test-resources.json | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts index ca26f7a6f391..27188c776a40 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts @@ -41,10 +41,11 @@ describe("Secret client - list secrets in various ways", () => { // This test is only useful while developing locally. it("can purge all secrets", async function(this: Context): Promise { console.log("------------------"); - var aa = process.env["OID"]!.toString(); - for (var i = 0; i < aa.length; i++) { - console.log(aa[i]); - } + var aa = process.env["ENABLEHSM"]; + console.log(aa); + // for (var i = 0; i < aa.length; i++) { + // console.log(aa[i]); + // } console.log("-------------------"); // WARNING: When TEST_MODE equals "record", all of the secrets in the indicated KEYVAULT_URI will be deleted as part of this test. if (!isRecordMode()) { diff --git a/sdk/keyvault/test-resources.json b/sdk/keyvault/test-resources.json index 287a250ae697..e345176ad838 100644 --- a/sdk/keyvault/test-resources.json +++ b/sdk/keyvault/test-resources.json @@ -319,9 +319,9 @@ "condition": "[parameters('enableHsm')]", "value": "[format('https://{0}/', reference(variables('attestationSite')).defaultHostName)]" }, - "OID": { - "type": "string", - "value": "[parameters('provisionerApplicationOid')]" + "ENABLEHSM": { + "type": "bool", + "value": "[parameters('enableHsm')]" } } } From 4b2752067c2ae669b692f7f786edc012940890e0 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 14 Oct 2021 10:11:03 +0800 Subject: [PATCH 063/133] update key vault keys --- sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts | 2 +- sdk/keyvault/keyvault-keys/tests.yml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts b/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts index d47c3851962f..76ba51097677 100644 --- a/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/keyClient.spec.ts @@ -400,7 +400,7 @@ describe("Keys client - create, read, update and delete operations", () => { ); }); - onVersions({ minVer: "7.3-preview" }).describe("key rotation", () => { + onVersions({ minVer: "7.3-preview" }).describe.skip("key rotation", () => { it("rotateKey supports rotating a key", async () => { const keyName = recorder.getUniqueName("keyrotate"); const key = await client.createKey(keyName, "RSA"); diff --git a/sdk/keyvault/keyvault-keys/tests.yml b/sdk/keyvault/keyvault-keys/tests.yml index 471f4bb13a26..505a51ee70c9 100644 --- a/sdk/keyvault/keyvault-keys/tests.yml +++ b/sdk/keyvault/keyvault-keys/tests.yml @@ -22,10 +22,8 @@ stages: Location: 'eastus2' UsGov: SubscriptionConfiguration: $(sub-config-gov-test-resources) - Location: 'usgovtexas' China: SubscriptionConfiguration: $(sub-config-cn-test-resources) - Location: 'chinaeast' EnvVars: AZURE_CLIENT_ID: $(KEYVAULT_CLIENT_ID) AZURE_TENANT_ID: $(KEYVAULT_TENANT_ID) From 787983a8c88a0edba33348948739e42f111193b6 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 14 Oct 2021 18:33:31 +0800 Subject: [PATCH 064/133] update key vault secrets --- .../test/public/recoverBackupRestore.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts index 2d6bd8cabd50..f1596e63a3a1 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts @@ -102,6 +102,12 @@ describe("Secret client - restore secrets and recover backups", () => { } it("can backup a secret", async function(this: Context) { + console.log("----------------------------------"); + var aa = env["AZURE_AUTHORITY_HOST"]!.toString(); + for (var i = 0; i < aa.length; i++) { + console.log(aa[i]); + } + console.log("----------------------------------"); const secretName = testClient.formatName( `${secretPrefix}-${this!.test!.title}-${secretSuffix}` ); From ad3022b43926eac205f3c7dcefd50304563736ec Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 15 Oct 2021 09:42:34 +0800 Subject: [PATCH 065/133] update key vault certificates --- sdk/keyvault/keyvault-certificates/tests.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sdk/keyvault/keyvault-certificates/tests.yml b/sdk/keyvault/keyvault-certificates/tests.yml index d6caa450f9b2..128dd64f9d06 100644 --- a/sdk/keyvault/keyvault-certificates/tests.yml +++ b/sdk/keyvault/keyvault-certificates/tests.yml @@ -5,8 +5,9 @@ stages: parameters: PackageName: "@azure/keyvault-certificates" ServiceDirectory: keyvault - TimeoutInMinutes: 90 + TimeoutInMinutes: 90, + SupportedClouds: 'Public,UsGov,China' EnvVars: - AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) - AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) - AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_CLIENT_ID: $(KEYVAULT_CLIENT_ID) + AZURE_TENANT_ID: $(KEYVAULT_TENANT_ID) + AZURE_CLIENT_SECRET: $(KEYVAULT_CLIENT_SECRET) From 4e4de6633b4dfe236a74e3204b6554a9f696995c Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 15 Oct 2021 10:33:30 +0800 Subject: [PATCH 066/133] update key vault secrets --- sdk/keyvault/keyvault-secrets/test/public/list.spec.ts | 7 ------- .../test/public/recoverBackupRestore.spec.ts | 6 ------ 2 files changed, 13 deletions(-) diff --git a/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts index 27188c776a40..16674c84f0a5 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts @@ -40,13 +40,6 @@ describe("Secret client - list secrets in various ways", () => { // The next tests will produce a more consistent output. // This test is only useful while developing locally. it("can purge all secrets", async function(this: Context): Promise { - console.log("------------------"); - var aa = process.env["ENABLEHSM"]; - console.log(aa); - // for (var i = 0; i < aa.length; i++) { - // console.log(aa[i]); - // } - console.log("-------------------"); // WARNING: When TEST_MODE equals "record", all of the secrets in the indicated KEYVAULT_URI will be deleted as part of this test. if (!isRecordMode()) { return this.skip(); diff --git a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts index f1596e63a3a1..2d6bd8cabd50 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts @@ -102,12 +102,6 @@ describe("Secret client - restore secrets and recover backups", () => { } it("can backup a secret", async function(this: Context) { - console.log("----------------------------------"); - var aa = env["AZURE_AUTHORITY_HOST"]!.toString(); - for (var i = 0; i < aa.length; i++) { - console.log(aa[i]); - } - console.log("----------------------------------"); const secretName = testClient.formatName( `${secretPrefix}-${this!.test!.title}-${secretSuffix}` ); From 0385b3f2de2b08c5821b6b05f218486c0354d3f0 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 15 Oct 2021 13:59:47 +0800 Subject: [PATCH 067/133] udpate key vault secrets --- .../keyvault-secrets/test/public/recoverBackupRestore.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts index 2d6bd8cabd50..2ef53e0b7bbf 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts @@ -102,6 +102,7 @@ describe("Secret client - restore secrets and recover backups", () => { } it("can backup a secret", async function(this: Context) { + env["AZURE_AUTHORITY_HOST"] = "https://login.microsoftonline.us"; const secretName = testClient.formatName( `${secretPrefix}-${this!.test!.title}-${secretSuffix}` ); From 1434632bbfdcc3d7bbdd5e014bf9a0b4e8fe67c7 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Mon, 18 Oct 2021 16:11:52 +0800 Subject: [PATCH 068/133] update key vault secrets --- sdk/keyvault/keyvault-secrets/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/keyvault/keyvault-secrets/tests.yml b/sdk/keyvault/keyvault-secrets/tests.yml index a0a19ff6a525..96581e32f36c 100644 --- a/sdk/keyvault/keyvault-secrets/tests.yml +++ b/sdk/keyvault/keyvault-secrets/tests.yml @@ -11,3 +11,4 @@ stages: AZURE_CLIENT_ID: $(KEYVAULT_CLIENT_ID) AZURE_TENANT_ID: $(KEYVAULT_TENANT_ID) AZURE_CLIENT_SECRET: $(KEYVAULT_CLIENT_SECRET) + AZURE_SUBSCRIPTION_ID: $(KEYVAULT_SUBSCRIPTION_ID) From 489ea001ca1960b1ff66c781d47e53e14078a436 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Mon, 18 Oct 2021 17:26:33 +0800 Subject: [PATCH 069/133] update key vault secrets --- .../test/public/recoverBackupRestore.spec.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts index 2ef53e0b7bbf..796dfeed2aa2 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts @@ -102,7 +102,6 @@ describe("Secret client - restore secrets and recover backups", () => { } it("can backup a secret", async function(this: Context) { - env["AZURE_AUTHORITY_HOST"] = "https://login.microsoftonline.us"; const secretName = testClient.formatName( `${secretPrefix}-${this!.test!.title}-${secretSuffix}` ); @@ -165,6 +164,12 @@ describe("Secret client - restore secrets and recover backups", () => { } it("can restore a secret (Malformed Backup Bytes)", async function() { + conosle.log("----------------------"); + var aa = env["AZURE_SUBSCRIPTION_ID"]!.toString(); + for (var i = 0; i < aa.length; i++) { + console.log(aa[i]); + } + conosle.log("----------------------"); const backup = new Uint8Array(4728); let error; try { From 14fcc5f557d32334d3c64d86df4562916326b2e7 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Mon, 18 Oct 2021 17:29:05 +0800 Subject: [PATCH 070/133] update key vault --- sdk/keyvault/keyvault-certificates/tests.yml | 1 + sdk/keyvault/keyvault-keys/tests.yml | 1 + .../test/public/recoverBackupRestore.spec.ts | 6 ------ 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sdk/keyvault/keyvault-certificates/tests.yml b/sdk/keyvault/keyvault-certificates/tests.yml index 128dd64f9d06..fa6b79baccfe 100644 --- a/sdk/keyvault/keyvault-certificates/tests.yml +++ b/sdk/keyvault/keyvault-certificates/tests.yml @@ -11,3 +11,4 @@ stages: AZURE_CLIENT_ID: $(KEYVAULT_CLIENT_ID) AZURE_TENANT_ID: $(KEYVAULT_TENANT_ID) AZURE_CLIENT_SECRET: $(KEYVAULT_CLIENT_SECRET) + AZURE_SUBSCRIPTION_ID: $(KEYVAULT_SUBSCRIPTION_ID) \ No newline at end of file diff --git a/sdk/keyvault/keyvault-keys/tests.yml b/sdk/keyvault/keyvault-keys/tests.yml index 505a51ee70c9..7a267c2ac1c3 100644 --- a/sdk/keyvault/keyvault-keys/tests.yml +++ b/sdk/keyvault/keyvault-keys/tests.yml @@ -28,3 +28,4 @@ stages: AZURE_CLIENT_ID: $(KEYVAULT_CLIENT_ID) AZURE_TENANT_ID: $(KEYVAULT_TENANT_ID) AZURE_CLIENT_SECRET: $(KEYVAULT_CLIENT_SECRET) + AZURE_SUBSCRIPTION_ID: $(KEYVAULT_SUBSCRIPTION_ID) \ No newline at end of file diff --git a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts index 796dfeed2aa2..2d6bd8cabd50 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts @@ -164,12 +164,6 @@ describe("Secret client - restore secrets and recover backups", () => { } it("can restore a secret (Malformed Backup Bytes)", async function() { - conosle.log("----------------------"); - var aa = env["AZURE_SUBSCRIPTION_ID"]!.toString(); - for (var i = 0; i < aa.length; i++) { - console.log(aa[i]); - } - conosle.log("----------------------"); const backup = new Uint8Array(4728); let error; try { From b0409095c68924ce3bb324232b1d46d07aceb6ae Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Tue, 19 Oct 2021 09:41:49 +0800 Subject: [PATCH 071/133] update key vault secrets --- .../test/public/recoverBackupRestore.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts index 2d6bd8cabd50..7e1f822dda47 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts @@ -102,6 +102,12 @@ describe("Secret client - restore secrets and recover backups", () => { } it("can backup a secret", async function(this: Context) { + console.log("---------------------"); + var aa = env["AZURE_TENANT_ID"]!.toString(); + for (var i = 0; i < aa.length; i++) { + console.log(aa[i]); + } + console.log("---------------------"); const secretName = testClient.formatName( `${secretPrefix}-${this!.test!.title}-${secretSuffix}` ); From ca57ed5baa18537e174c42f1d58f3a58f549aeef Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Tue, 19 Oct 2021 14:54:20 +0800 Subject: [PATCH 072/133] update key vault keys --- .../keyvault-keys/test/public/recoverBackupRestore.spec.ts | 6 ++++++ sdk/keyvault/test-resources.json | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts index f15aaf5d7f2e..b83b43304811 100644 --- a/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts @@ -143,6 +143,12 @@ describe("Keys client - restore keys and recover backups", () => { }); it("fails to restore a key with a malformed backup", async function() { + console.log("---------------------"); + var aa = env["KEYVAULTSKU"]!.toString(); + for (var i = 0; i < aa.length; i++) { + console.log(aa[i]); + } + console.log("---------------------"); const backup = new Uint8Array(8693); let error; try { diff --git a/sdk/keyvault/test-resources.json b/sdk/keyvault/test-resources.json index e345176ad838..2d203c177d14 100644 --- a/sdk/keyvault/test-resources.json +++ b/sdk/keyvault/test-resources.json @@ -319,9 +319,9 @@ "condition": "[parameters('enableHsm')]", "value": "[format('https://{0}/', reference(variables('attestationSite')).defaultHostName)]" }, - "ENABLEHSM": { - "type": "bool", - "value": "[parameters('enableHsm')]" + "KEYVAULTSKU": { + "type": "string", + "value": "[parameters('keyVaultSku')]" } } } From 3b199b1120ec89b15fee023cfefc8f5e613c141b Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 20 Oct 2021 17:56:33 +0800 Subject: [PATCH 073/133] update key vault --- .../keyvault-keys/test/public/recoverBackupRestore.spec.ts | 6 ------ .../test/public/recoverBackupRestore.spec.ts | 6 ------ sdk/keyvault/test-resources.json | 4 ---- 3 files changed, 16 deletions(-) diff --git a/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts index b83b43304811..f15aaf5d7f2e 100644 --- a/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts @@ -143,12 +143,6 @@ describe("Keys client - restore keys and recover backups", () => { }); it("fails to restore a key with a malformed backup", async function() { - console.log("---------------------"); - var aa = env["KEYVAULTSKU"]!.toString(); - for (var i = 0; i < aa.length; i++) { - console.log(aa[i]); - } - console.log("---------------------"); const backup = new Uint8Array(8693); let error; try { diff --git a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts index 7e1f822dda47..2d6bd8cabd50 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts @@ -102,12 +102,6 @@ describe("Secret client - restore secrets and recover backups", () => { } it("can backup a secret", async function(this: Context) { - console.log("---------------------"); - var aa = env["AZURE_TENANT_ID"]!.toString(); - for (var i = 0; i < aa.length; i++) { - console.log(aa[i]); - } - console.log("---------------------"); const secretName = testClient.formatName( `${secretPrefix}-${this!.test!.title}-${secretSuffix}` ); diff --git a/sdk/keyvault/test-resources.json b/sdk/keyvault/test-resources.json index 2d203c177d14..5bd8b80fd3c1 100644 --- a/sdk/keyvault/test-resources.json +++ b/sdk/keyvault/test-resources.json @@ -318,10 +318,6 @@ "type": "string", "condition": "[parameters('enableHsm')]", "value": "[format('https://{0}/', reference(variables('attestationSite')).defaultHostName)]" - }, - "KEYVAULTSKU": { - "type": "string", - "value": "[parameters('keyVaultSku')]" } } } From af5e1004c9efde8c63104d08c6c0ade3bf863a84 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Tue, 26 Oct 2021 14:12:26 +0800 Subject: [PATCH 074/133] update service bus --- .../test/internal/serviceBusClient.spec.ts | 16 +--------------- .../service-bus/test/public/utils/testUtils.ts | 13 +------------ 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts b/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts index 534f6c7353b6..92138813d882 100644 --- a/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts +++ b/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts @@ -195,24 +195,17 @@ describe("ServiceBusClient live tests", () => { }); const testError = (err: Error | ServiceBusError, entityPath: string): void => { - console.log("9191919191", err); if (!isServiceBusError(err)) { - console.log("939393939339"); should.equal(true, false, "Error expected to be instance of ServiceBusError"); } else { - const err1:ServiceBusError = err; - console.log("77777777777777", err1.code); should.equal(err.code, "MessagingEntityNotFound", "Error code is different than expected"); - console.log("88888888888888", err1.message); should.equal( - err1.message.includes( + err.message.includes( `The messaging entity 'sb://${sbClient.fullyQualifiedNamespace}/${entityPath}' could not be found.` ), true ); - console.log("9999999999999999"); errorWasThrown = true; - console.log("13131313131", errorWasThrown); } }; @@ -252,29 +245,22 @@ describe("ServiceBusClient live tests", () => { entityPath: args.entityPath, fullyQualifiedNamespace: args.fullyQualifiedNamespace }; - console.log("6666666666666", actual); - console.log("121212121", errorWasThrown); actual.should.deep.equal({ errorSource: "receive", entityPath: receiver.entityPath, fullyQualifiedNamespace: sbClient.fullyQualifiedNamespace } as Omit); - console.log("14141414"); testError(args.error, "some-name"); - console.log("1515151515"); } }); - console.log("55555555555", errorWasThrown); - should.equal( await checkWithTimeout(() => errorWasThrown === true, 10, 3000), true, "Error thrown flag must be true" ); - console.log("1616161616"); await receiver.close(); }); diff --git a/sdk/servicebus/service-bus/test/public/utils/testUtils.ts b/sdk/servicebus/service-bus/test/public/utils/testUtils.ts index d25be72f1fd1..72a1ea4880cd 100644 --- a/sdk/servicebus/service-bus/test/public/utils/testUtils.ts +++ b/sdk/servicebus/service-bus/test/public/utils/testUtils.ts @@ -155,21 +155,10 @@ export async function checkWithTimeout( maxWaitTimeInMilliseconds: number = 10000 ): Promise { const maxTime = Date.now() + maxWaitTimeInMilliseconds; - console.log("11111111111111", Date.now()); - console.log("22222222222222", maxTime); while (Date.now() < maxTime) { - const aa = await predicate(); - console.log("3333333333333333", aa); - console.log("3434343434", Date.now()); - if (aa) { - console.log("44444444444444"); - return true; - } - console.log("171717171717"); + if (await predicate()) return true; await delay(delayBetweenRetriesInMilliseconds); - console.log("181818181818"); } - console.log("191919191919"); return false; } From cc0b5d42a9c439f206a32421aec98003b08b77a5 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 27 Oct 2021 16:44:15 +0800 Subject: [PATCH 075/133] update event hub --- sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts index 9cface634c82..fda7fbc1665d 100644 --- a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts +++ b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts @@ -282,6 +282,7 @@ testWithServiceTypes((serviceVersion) => { }); it("non-useful errors are filtered out", async () => { + console.log("11111111111111"); // the user's error handler will throw an error - won't escape from this function await eventProcessor["_handleSubscriptionError"](new AbortError("test error")); @@ -293,6 +294,7 @@ testWithServiceTypes((serviceVersion) => { }); it("if we fail to claim partitions we don't start up new processors", async () => { + console.log("222222222222222"); const checkpointStore = { claimOwnershipCalled: false, From 13068926ea0fd0a1f88085be8ce96b7ed08dea65 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 28 Oct 2021 16:30:29 +0800 Subject: [PATCH 076/133] update event hub --- .../event-hubs/test/internal/eventProcessor.spec.ts | 2 -- sdk/eventhub/event-hubs/tests.yml | 10 +--------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts index fda7fbc1665d..9cface634c82 100644 --- a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts +++ b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts @@ -282,7 +282,6 @@ testWithServiceTypes((serviceVersion) => { }); it("non-useful errors are filtered out", async () => { - console.log("11111111111111"); // the user's error handler will throw an error - won't escape from this function await eventProcessor["_handleSubscriptionError"](new AbortError("test error")); @@ -294,7 +293,6 @@ testWithServiceTypes((serviceVersion) => { }); it("if we fail to claim partitions we don't start up new processors", async () => { - console.log("222222222222222"); const checkpointStore = { claimOwnershipCalled: false, diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index fd627bdcf065..80288bd7690b 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -5,16 +5,8 @@ stages: parameters: PackageName: "@azure/event-hubs" ServiceDirectory: eventhub - TimeoutInMinutes: 120 + TimeoutInMinutes: 180 SupportedClouds: 'Public,UsGov,China' - CloudConfig: - Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - UsGov: - SubscriptionConfiguration: $(sub-config-gov-test-resources) - Location: 'usgovarizona' - China: - SubscriptionConfiguration: $(sub-config-cn-test-resources) EnvVars: AZURE_CLIENT_ID: $(EVENTHUB_CLIENT_ID) AZURE_CLIENT_SECRET: $(EVENTHUB_CLIENT_SECRET) From 3fb6c5ae08efa9a8442abad59983a2669db7017b Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 29 Oct 2021 09:48:32 +0800 Subject: [PATCH 077/133] update key vault keys --- sdk/keyvault/keyvault-keys/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/keyvault/keyvault-keys/tests.yml b/sdk/keyvault/keyvault-keys/tests.yml index 7a267c2ac1c3..ede450dc1f56 100644 --- a/sdk/keyvault/keyvault-keys/tests.yml +++ b/sdk/keyvault/keyvault-keys/tests.yml @@ -22,8 +22,12 @@ stages: Location: 'eastus2' UsGov: SubscriptionConfiguration: $(sub-config-gov-test-resources) + MatrixFilters: + - ArmTemplateParameters=^(?!.*enableHsm.*true) China: SubscriptionConfiguration: $(sub-config-cn-test-resources) + MatrixFilters: + - ArmTemplateParameters=^(?!.*enableHsm.*true) EnvVars: AZURE_CLIENT_ID: $(KEYVAULT_CLIENT_ID) AZURE_TENANT_ID: $(KEYVAULT_TENANT_ID) From aa4b5e8a92c1eb6b82702ea8bf0a74fc37d8e6fd Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 29 Oct 2021 10:17:53 +0800 Subject: [PATCH 078/133] update event hub --- sdk/eventhub/event-hubs/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index 80288bd7690b..2994e3702b4d 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -5,7 +5,7 @@ stages: parameters: PackageName: "@azure/event-hubs" ServiceDirectory: eventhub - TimeoutInMinutes: 180 + TimeoutInMinutes: 90 SupportedClouds: 'Public,UsGov,China' EnvVars: AZURE_CLIENT_ID: $(EVENTHUB_CLIENT_ID) From a73477783e8e9cdb56e7248756719c2eca04e264 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 29 Oct 2021 15:17:32 +0800 Subject: [PATCH 079/133] update event hub --- sdk/eventhub/event-hubs/tests.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index 2994e3702b4d..88cee4b8aa72 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -7,6 +7,14 @@ stages: ServiceDirectory: eventhub TimeoutInMinutes: 90 SupportedClouds: 'Public,UsGov,China' + CloudConfig: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + UsGov: + SubscriptionConfiguration: $(sub-config-gov-test-resources) + Location: 'usgovarizona' + China: + SubscriptionConfiguration: $(sub-config-cn-test-resources) EnvVars: AZURE_CLIENT_ID: $(EVENTHUB_CLIENT_ID) AZURE_CLIENT_SECRET: $(EVENTHUB_CLIENT_SECRET) From 3ec70f1f23bb1e361a91b6a778d65d9d8812c8a9 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Tue, 2 Nov 2021 16:20:51 +0800 Subject: [PATCH 080/133] update event hub --- sdk/eventhub/event-hubs/rollup.base.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/rollup.base.config.js b/sdk/eventhub/event-hubs/rollup.base.config.js index 335dd2887d77..b2c9bcd48730 100644 --- a/sdk/eventhub/event-hubs/rollup.base.config.js +++ b/sdk/eventhub/event-hubs/rollup.base.config.js @@ -125,7 +125,7 @@ export function browserConfig(test = false) { namedExports: { ...openTelemetryCommonJs(), chai: ["should", "assert"], - assert: ["equal", "deepEqual", "notEqual"] + assert: ["equal", "deepEqual", "notEqual", "deepStrictEqual"] } }), From 7390811aaba52fb6d93cc0e839ac3b2ee2ff1347 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 4 Nov 2021 16:06:31 +0800 Subject: [PATCH 081/133] update event hub --- .../test/public/amqpAnnotatedMessage.spec.ts | 11 +++++++++++ sdk/servicebus/service-bus/tests.yml | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts b/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts index 79e4aac5b5fe..acced6b0bcb7 100644 --- a/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts +++ b/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts @@ -182,6 +182,7 @@ testWithServiceTypes((serviceVersion) => { it(`values (useBatch: ${useBatch})`, async () => { const valueTypes = [[1, 2, 3], 1, 1.5, "hello", { hello: "world" }]; for (const valueType of valueTypes) { + console.log("1111111111111", valueType); const startingPositions = await getStartingPositionsForTests(consumerClient); await sendEvents( [ @@ -199,6 +200,8 @@ testWithServiceTypes((serviceVersion) => { "value", `Should be identified as a value: ${valueType.toString()}` ); + console.log("2222222222222", valueType); + console.log("3333333333333", event.body); assert.deepEqual( event.body, @@ -247,6 +250,7 @@ testWithServiceTypes((serviceVersion) => { const dataTypes = [1, 1.5, "hello", { hello: "world" }, buff, [1, 2, 3]]; for (const dataType of dataTypes) { + console.log("4444444444444", dataTypes); const startingPositions = await getStartingPositionsForTests(consumerClient); await sendEvents( [ @@ -265,6 +269,8 @@ testWithServiceTypes((serviceVersion) => { "data", `Should be identified as data: ${dataType.toString()}` ); + console.log("55555555555555", dataTypes); + console.log("6666666666666", event.body); assert.deepEqual( event.body, dataType, @@ -279,6 +285,7 @@ testWithServiceTypes((serviceVersion) => { ["data", "hello"] ] as [BodyTypes, any][]).forEach(([expectedBodyType, expectedBody]) => { it(`receive ${expectedBodyType} EventData and resend (useBatch: ${useBatch})`, async () => { + console.log("7777777777777777", expectedBodyType); let startingPositions = await getStartingPositionsForTests(consumerClient); // if we receive an event that was encoded to a non-data section // and then re-send it (again, as an EventData) we should @@ -295,6 +302,8 @@ testWithServiceTypes((serviceVersion) => { const event = await receiveEvent(startingPositions); + console.log("8888888888888", expectedBodyType); + console.log("99999999999999", event.getRawAmqpMessage().bodyType); assert.equal(event.getRawAmqpMessage().bodyType, expectedBodyType); startingPositions = await getStartingPositionsForTests(consumerClient); @@ -303,6 +312,8 @@ testWithServiceTypes((serviceVersion) => { const reencodedEvent = await receiveEvent(startingPositions); + console.log("12121221212", expectedBodyType); + console.log("13131313131313", reencodedEvent.getRawAmqpMessage().bodyType); assert.equal(reencodedEvent.getRawAmqpMessage().bodyType, expectedBodyType); assert.deepEqual(reencodedEvent.body, expectedBody); }); diff --git a/sdk/servicebus/service-bus/tests.yml b/sdk/servicebus/service-bus/tests.yml index b3558481d2f4..4c58d9feef69 100644 --- a/sdk/servicebus/service-bus/tests.yml +++ b/sdk/servicebus/service-bus/tests.yml @@ -11,4 +11,5 @@ stages: AZURE_CLIENT_ID: $(SERVICEBUS_CLIENT_ID) AZURE_TENANT_ID: $(SERVICEBUS_TENANT_ID) AZURE_CLIENT_SECRET: $(SERVICEBUS_CLIENT_SECRET) - AZURE_SUBSCRIPTION_ID: $(test-subscription-id) + AZURE_SUBSCRIPTION_ID: $(SERVICEBUS_SUBSCRIPTION_ID) + From 8c8d04ea7533ade000d45fc064cba03147ec8c41 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 4 Nov 2021 18:06:10 +0800 Subject: [PATCH 082/133] update event hub --- .../event-hubs/test/public/amqpAnnotatedMessage.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts b/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts index acced6b0bcb7..459b1c630127 100644 --- a/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts +++ b/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts @@ -250,7 +250,7 @@ testWithServiceTypes((serviceVersion) => { const dataTypes = [1, 1.5, "hello", { hello: "world" }, buff, [1, 2, 3]]; for (const dataType of dataTypes) { - console.log("4444444444444", dataTypes); + console.log("4444444444444", dataType); const startingPositions = await getStartingPositionsForTests(consumerClient); await sendEvents( [ @@ -269,7 +269,7 @@ testWithServiceTypes((serviceVersion) => { "data", `Should be identified as data: ${dataType.toString()}` ); - console.log("55555555555555", dataTypes); + console.log("55555555555555", dataType); console.log("6666666666666", event.body); assert.deepEqual( event.body, From fdd6823db9bbceca4a47bd10aa6ae75f020f42d5 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 5 Nov 2021 11:28:27 +0800 Subject: [PATCH 083/133] update event hub --- .../event-hubs/test/public/amqpAnnotatedMessage.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts b/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts index 459b1c630127..8d229948d867 100644 --- a/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts +++ b/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts @@ -184,6 +184,7 @@ testWithServiceTypes((serviceVersion) => { for (const valueType of valueTypes) { console.log("1111111111111", valueType); const startingPositions = await getStartingPositionsForTests(consumerClient); + console.log("1414141414", startingPositions); await sendEvents( [ { @@ -219,6 +220,8 @@ testWithServiceTypes((serviceVersion) => { for (const sequenceType of sequenceTypes) { const startingPositions = await getStartingPositionsForTests(consumerClient); + console.log("1515151515", startingPositions); + console.log("1616161616", sequenceType); await sendEvents( [ { @@ -235,6 +238,8 @@ testWithServiceTypes((serviceVersion) => { "sequence", `Should be identified as a value: ${sequenceType.toString()}` ); + console.log("1717171717", event.body); + console.log("1818181818", sequenceType); assert.deepEqual( event.body, @@ -252,6 +257,7 @@ testWithServiceTypes((serviceVersion) => { for (const dataType of dataTypes) { console.log("4444444444444", dataType); const startingPositions = await getStartingPositionsForTests(consumerClient); + console.log("191919191919", startingPositions); await sendEvents( [ { @@ -287,6 +293,7 @@ testWithServiceTypes((serviceVersion) => { it(`receive ${expectedBodyType} EventData and resend (useBatch: ${useBatch})`, async () => { console.log("7777777777777777", expectedBodyType); let startingPositions = await getStartingPositionsForTests(consumerClient); + console.log("101010101010", startingPositions); // if we receive an event that was encoded to a non-data section // and then re-send it (again, as an EventData) we should // respect it. From 0b84bed7277eb8d35e7774d73ccd993c36a9ad85 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 10 Nov 2021 17:49:17 +0800 Subject: [PATCH 084/133] update key vault admin --- sdk/keyvault/keyvault-admin/tests.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sdk/keyvault/keyvault-admin/tests.yml b/sdk/keyvault/keyvault-admin/tests.yml index 98295e691c62..c28f67494071 100644 --- a/sdk/keyvault/keyvault-admin/tests.yml +++ b/sdk/keyvault/keyvault-admin/tests.yml @@ -5,17 +5,25 @@ stages: parameters: PackageName: "@azure/keyvault-admin" ServiceDirectory: keyvault + SupportedClouds: 'Public,UsGov,China' + CloudConfig: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + Location: 'eastus2' + UsGov: + SubscriptionConfiguration: $(sub-config-gov-test-resources) + China: + SubscriptionConfiguration: $(sub-config-cn-test-resources) # KV HSM limitation prevents us from running live tests # against multiple platforms in parallel (we're limited to a single # instance per region per subscription) so we're only running # live tests against a single instance. - Location: eastus2 MatrixConfigs: - Name: Keyvault_live_test_base Path: sdk/keyvault/keyvault-admin/platform-matrix.json Selection: sparse GenerateVMJobs: true EnvVars: - AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) - AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) - AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_CLIENT_ID: $(KEYVAULT_CLIENT_ID) + AZURE_TENANT_ID: $(KEYVAULT_TENANT_ID) + AZURE_CLIENT_SECRET: $(KEYVAULT_CLIENT_SECRET) From 86a7900f6a8b4c683aa7f0d4ebca953aae630217 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Tue, 16 Nov 2021 10:30:55 +0800 Subject: [PATCH 085/133] update key vault certificates --- sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts index 9de8a4829ff0..fa1535134d21 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts @@ -355,6 +355,7 @@ describe("Certificates client - create, read, update and delete", () => { testPollerProperties ); const poller = await client.beginDeleteCertificate(certificateName, testPollerProperties); + await poller.pollUntilDone(); const result = poller.getResult()!; assert.equal(typeof result.recoveryId, "string"); From 052649bbbce4886f0a5ef303e5341d340e5bac50 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Tue, 16 Nov 2021 14:04:18 +0800 Subject: [PATCH 086/133] update key vault admin --- sdk/keyvault/keyvault-admin/tests.yml | 4 ++++ sdk/keyvault/keyvault-keys/tests.yml | 12 ------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/sdk/keyvault/keyvault-admin/tests.yml b/sdk/keyvault/keyvault-admin/tests.yml index c28f67494071..963f392eec12 100644 --- a/sdk/keyvault/keyvault-admin/tests.yml +++ b/sdk/keyvault/keyvault-admin/tests.yml @@ -12,8 +12,12 @@ stages: Location: 'eastus2' UsGov: SubscriptionConfiguration: $(sub-config-gov-test-resources) + MatrixFilters: + - ArmTemplateParameters=^(?!.*enableHsm.*true) China: SubscriptionConfiguration: $(sub-config-cn-test-resources) + MatrixFilters: + - ArmTemplateParameters=^(?!.*enableHsm.*true) # KV HSM limitation prevents us from running live tests # against multiple platforms in parallel (we're limited to a single # instance per region per subscription) so we're only running diff --git a/sdk/keyvault/keyvault-keys/tests.yml b/sdk/keyvault/keyvault-keys/tests.yml index e1f95ec57727..2989a1e0a494 100644 --- a/sdk/keyvault/keyvault-keys/tests.yml +++ b/sdk/keyvault/keyvault-keys/tests.yml @@ -28,18 +28,6 @@ stages: Path: sdk/keyvault/keyvault-keys/platform-matrix.json Selection: sparse GenerateVMJobs: true - CloudConfig: - Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - Location: 'eastus2' - UsGov: - SubscriptionConfiguration: $(sub-config-gov-test-resources) - MatrixFilters: - - ArmTemplateParameters=^(?!.*enableHsm.*true) - China: - SubscriptionConfiguration: $(sub-config-cn-test-resources) - MatrixFilters: - - ArmTemplateParameters=^(?!.*enableHsm.*true) EnvVars: AZURE_CLIENT_ID: $(KEYVAULT_CLIENT_ID) AZURE_TENANT_ID: $(KEYVAULT_TENANT_ID) From 0858c03a8dc18f45b3061842360a9224fb1e9f5e Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 17 Nov 2021 17:31:09 +0800 Subject: [PATCH 087/133] update event hub --- .../test/public/amqpAnnotatedMessage.spec.ts | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts b/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts index 8d229948d867..79e4aac5b5fe 100644 --- a/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts +++ b/sdk/eventhub/event-hubs/test/public/amqpAnnotatedMessage.spec.ts @@ -182,9 +182,7 @@ testWithServiceTypes((serviceVersion) => { it(`values (useBatch: ${useBatch})`, async () => { const valueTypes = [[1, 2, 3], 1, 1.5, "hello", { hello: "world" }]; for (const valueType of valueTypes) { - console.log("1111111111111", valueType); const startingPositions = await getStartingPositionsForTests(consumerClient); - console.log("1414141414", startingPositions); await sendEvents( [ { @@ -201,8 +199,6 @@ testWithServiceTypes((serviceVersion) => { "value", `Should be identified as a value: ${valueType.toString()}` ); - console.log("2222222222222", valueType); - console.log("3333333333333", event.body); assert.deepEqual( event.body, @@ -220,8 +216,6 @@ testWithServiceTypes((serviceVersion) => { for (const sequenceType of sequenceTypes) { const startingPositions = await getStartingPositionsForTests(consumerClient); - console.log("1515151515", startingPositions); - console.log("1616161616", sequenceType); await sendEvents( [ { @@ -238,8 +232,6 @@ testWithServiceTypes((serviceVersion) => { "sequence", `Should be identified as a value: ${sequenceType.toString()}` ); - console.log("1717171717", event.body); - console.log("1818181818", sequenceType); assert.deepEqual( event.body, @@ -255,9 +247,7 @@ testWithServiceTypes((serviceVersion) => { const dataTypes = [1, 1.5, "hello", { hello: "world" }, buff, [1, 2, 3]]; for (const dataType of dataTypes) { - console.log("4444444444444", dataType); const startingPositions = await getStartingPositionsForTests(consumerClient); - console.log("191919191919", startingPositions); await sendEvents( [ { @@ -275,8 +265,6 @@ testWithServiceTypes((serviceVersion) => { "data", `Should be identified as data: ${dataType.toString()}` ); - console.log("55555555555555", dataType); - console.log("6666666666666", event.body); assert.deepEqual( event.body, dataType, @@ -291,9 +279,7 @@ testWithServiceTypes((serviceVersion) => { ["data", "hello"] ] as [BodyTypes, any][]).forEach(([expectedBodyType, expectedBody]) => { it(`receive ${expectedBodyType} EventData and resend (useBatch: ${useBatch})`, async () => { - console.log("7777777777777777", expectedBodyType); let startingPositions = await getStartingPositionsForTests(consumerClient); - console.log("101010101010", startingPositions); // if we receive an event that was encoded to a non-data section // and then re-send it (again, as an EventData) we should // respect it. @@ -309,8 +295,6 @@ testWithServiceTypes((serviceVersion) => { const event = await receiveEvent(startingPositions); - console.log("8888888888888", expectedBodyType); - console.log("99999999999999", event.getRawAmqpMessage().bodyType); assert.equal(event.getRawAmqpMessage().bodyType, expectedBodyType); startingPositions = await getStartingPositionsForTests(consumerClient); @@ -319,8 +303,6 @@ testWithServiceTypes((serviceVersion) => { const reencodedEvent = await receiveEvent(startingPositions); - console.log("12121221212", expectedBodyType); - console.log("13131313131313", reencodedEvent.getRawAmqpMessage().bodyType); assert.equal(reencodedEvent.getRawAmqpMessage().bodyType, expectedBodyType); assert.deepEqual(reencodedEvent.body, expectedBody); }); From 8c9d6e8167463deefad201baae43076ae5fe0ba7 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 18 Nov 2021 14:40:28 +0800 Subject: [PATCH 088/133] update event hub --- sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts index 9cface634c82..34f8db1a9e9d 100644 --- a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts +++ b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts @@ -731,6 +731,7 @@ testWithServiceTypes((serviceVersion) => { }); it("should not throw if stop is called without start", async function(): Promise { + console.log("111111111111111"); let didPartitionProcessorStart = false; const processor = new EventProcessor( @@ -761,6 +762,7 @@ testWithServiceTypes((serviceVersion) => { }); it("should support start after stopping", async function(): Promise { + console.log("222222222222222"); const partitionIds = await producerClient.getPartitionIds(); // ensure we have at least 2 partitions From ccd9cb96204b12e8c432847ce46452ba7c40f5b2 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 19 Nov 2021 15:27:58 +0800 Subject: [PATCH 089/133] update event hub --- .../test/internal/eventProcessor.spec.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts index 34f8db1a9e9d..11c884bf3e51 100644 --- a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts +++ b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts @@ -731,7 +731,6 @@ testWithServiceTypes((serviceVersion) => { }); it("should not throw if stop is called without start", async function(): Promise { - console.log("111111111111111"); let didPartitionProcessorStart = false; const processor = new EventProcessor( @@ -762,16 +761,19 @@ testWithServiceTypes((serviceVersion) => { }); it("should support start after stopping", async function(): Promise { - console.log("222222222222222"); + console.log("111111111111111"); const partitionIds = await producerClient.getPartitionIds(); + console.log("22222222222222222"); // ensure we have at least 2 partitions partitionIds.length.should.gte(2); + console.log("3333333333333333"); const { subscriptionEventHandler, startPosition } = await SubscriptionHandlerForTests.startingFromHere(producerClient); + console.log("4444444444444"); const processor = new EventProcessor( EventHubConsumerClient.defaultConsumerGroupName, @@ -783,36 +785,47 @@ testWithServiceTypes((serviceVersion) => { startPosition: startPosition } ); + console.log("555555555555555"); loggerForTest(`Starting processor for the first time`); processor.start(); + console.log("6666666666666666666"); const expectedMessages = await sendOneMessagePerPartition(partitionIds, producerClient); + console.log("77777777777777777777"); const receivedEvents = await subscriptionEventHandler.waitForEvents(partitionIds); + console.log("888888888888888888"); loggerForTest(`Stopping processor for the first time`); await processor.stop(); + console.log("999999999999999"); receivedEvents.should.deep.equal(expectedMessages); subscriptionEventHandler.hasErrors(partitionIds).should.equal(false); subscriptionEventHandler.allShutdown(partitionIds).should.equal(true); + console.log("000000000000000000"); // validate correct events captured for each partition // start it again loggerForTest(`Starting processor again`); subscriptionEventHandler.clear(); + console.log("111111111111111111112"); processor.start(); + console.log("1111111111111111111111113"); await subscriptionEventHandler.waitUntilInitialized(partitionIds); + console.log("11111111111111111111111114"); loggerForTest(`Stopping processor again`); await processor.stop(); + console.log("11111111111111111111115"); subscriptionEventHandler.hasErrors(partitionIds).should.equal(false); subscriptionEventHandler.allShutdown(partitionIds).should.equal(true); + console.log("111111111111111111111116"); }); describe("Partition processor", function(): void { From 71b9b843a5dc9f6a6095cc0c1233d9ff53d694dc Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 1 Dec 2021 17:15:06 +0800 Subject: [PATCH 090/133] update text analytics --- .../ai-text-analytics/test/public/textAnalyticsClient.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/textanalytics/ai-text-analytics/test/public/textAnalyticsClient.spec.ts b/sdk/textanalytics/ai-text-analytics/test/public/textAnalyticsClient.spec.ts index d1004ada9996..a9b93c2b1134 100644 --- a/sdk/textanalytics/ai-text-analytics/test/public/textAnalyticsClient.spec.ts +++ b/sdk/textanalytics/ai-text-analytics/test/public/textAnalyticsClient.spec.ts @@ -936,6 +936,8 @@ matrix([["APIKey", "AAD"]] as const, async (authMethod: AuthMethod) => { "A recent report by the Government Accountability Office (GAO) found that the dramatic increase in oil and natural gas development on federal lands over the past six years has stretched the staff of the BLM to a point that it has been unable to meet its environmental protection responsibilities." } ]; + console.log("11111111111111", env.TEXT_ANALYTICS_RECOGNIZE_CUSTOM_ENTITIES_PROJECT_NAME.toString()); + console.log("22222222222222", env.TEXT_ANALYTICS_RECOGNIZE_CUSTOM_ENTITIES_DEPLOYMENT_NAME.toString()); const poller = await client.beginAnalyzeActions( docs, From 2eb81c0ba0152831fe4e0409ecd7cf0fa7ba60c7 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 3 Dec 2021 15:03:14 +0800 Subject: [PATCH 091/133] update key vault certificate --- sdk/formrecognizer/ai-form-recognizer/sample.env | 8 -------- .../keyvault-certificates/test/public/CRUD.spec.ts | 6 ++++++ 2 files changed, 6 insertions(+), 8 deletions(-) delete mode 100644 sdk/formrecognizer/ai-form-recognizer/sample.env diff --git a/sdk/formrecognizer/ai-form-recognizer/sample.env b/sdk/formrecognizer/ai-form-recognizer/sample.env deleted file mode 100644 index 2b8926a32384..000000000000 --- a/sdk/formrecognizer/ai-form-recognizer/sample.env +++ /dev/null @@ -1,8 +0,0 @@ -# Used in most samples. Retrieve these values from a Cognitive Services instance -# in the Azure Portal. -FORM_RECOGNIZER_ENDPOINT="https://.cognitiveservies.azure.com/" -FORM_RECOGNIZER_API_KEY="
" - -# Our tests assume that TEST_MODE is "playback" by default. You can -# change it to "record" to generate new recordings, or "live" to bypass the recorder entirely. -# TEST_MODE=playback \ No newline at end of file diff --git a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts index fa1535134d21..08efc1189513 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts @@ -410,23 +410,29 @@ describe("Certificates client - create, read, update and delete", () => { describe("can get a deleted certificate", () => { it("using beginDeleteCertificate's poller", async function(this: Context) { + console.log("111111111111111111111"); const certificateName = testClient.formatName(`${prefix}-${this!.test!.title}-${suffix}`); + console.log("222222222222222222222"); await client.beginCreateCertificate( certificateName, basicCertificatePolicy, testPollerProperties ); + console.log("3333333333333333333"); const deletePoller = await client.beginDeleteCertificate( certificateName, testPollerProperties ); + console.log("4444444444444444"); const deletedCertificate = await deletePoller.pollUntilDone(); + console.log("555555555555555555"); assert.equal( deletedCertificate.name, certificateName, "Unexpected certificate name in result from pollUntilDone()." ); + console.log("66666666666666666"); }); it("using getDeletedCertificate", async function(this: Context) { From 1fa8d2f608c2c1afa20ff5ac6ab521f5270be4af Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Thu, 16 Dec 2021 10:42:00 +0800 Subject: [PATCH 092/133] update key vault certificate --- .../test/internal/eventProcessor.spec.ts | 15 --------------- sdk/formrecognizer/ai-form-recognizer/sample.env | 8 ++++++++ .../test/public/CRUD.spec.ts | 6 ------ 3 files changed, 8 insertions(+), 21 deletions(-) create mode 100644 sdk/formrecognizer/ai-form-recognizer/sample.env diff --git a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts index 82511b0b7d10..b0864877962a 100644 --- a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts +++ b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts @@ -762,19 +762,15 @@ testWithServiceTypes((serviceVersion) => { }); it("should support start after stopping", async function(): Promise { - console.log("111111111111111"); const partitionIds = await producerClient.getPartitionIds(); - console.log("22222222222222222"); // ensure we have at least 2 partitions partitionIds.length.should.gte(2); - console.log("3333333333333333"); const { subscriptionEventHandler, startPosition } = await SubscriptionHandlerForTests.startingFromHere(producerClient); - console.log("4444444444444"); const processor = new EventProcessor( EventHubConsumerClient.defaultConsumerGroupName, @@ -786,47 +782,36 @@ testWithServiceTypes((serviceVersion) => { startPosition: startPosition } ); - console.log("555555555555555"); loggerForTest(`Starting processor for the first time`); processor.start(); - console.log("6666666666666666666"); const expectedMessages = await sendOneMessagePerPartition(partitionIds, producerClient); - console.log("77777777777777777777"); const receivedEvents = await subscriptionEventHandler.waitForEvents(partitionIds); - console.log("888888888888888888"); loggerForTest(`Stopping processor for the first time`); await processor.stop(); - console.log("999999999999999"); receivedEvents.should.deep.equal(expectedMessages); subscriptionEventHandler.hasErrors(partitionIds).should.equal(false); subscriptionEventHandler.allShutdown(partitionIds).should.equal(true); - console.log("000000000000000000"); // validate correct events captured for each partition // start it again loggerForTest(`Starting processor again`); subscriptionEventHandler.clear(); - console.log("111111111111111111112"); processor.start(); - console.log("1111111111111111111111113"); await subscriptionEventHandler.waitUntilInitialized(partitionIds); - console.log("11111111111111111111111114"); loggerForTest(`Stopping processor again`); await processor.stop(); - console.log("11111111111111111111115"); subscriptionEventHandler.hasErrors(partitionIds).should.equal(false); subscriptionEventHandler.allShutdown(partitionIds).should.equal(true); - console.log("111111111111111111111116"); }); describe("Partition processor", function(): void { diff --git a/sdk/formrecognizer/ai-form-recognizer/sample.env b/sdk/formrecognizer/ai-form-recognizer/sample.env new file mode 100644 index 000000000000..2b8926a32384 --- /dev/null +++ b/sdk/formrecognizer/ai-form-recognizer/sample.env @@ -0,0 +1,8 @@ +# Used in most samples. Retrieve these values from a Cognitive Services instance +# in the Azure Portal. +FORM_RECOGNIZER_ENDPOINT="https://.cognitiveservies.azure.com/" +FORM_RECOGNIZER_API_KEY="" + +# Our tests assume that TEST_MODE is "playback" by default. You can +# change it to "record" to generate new recordings, or "live" to bypass the recorder entirely. +# TEST_MODE=playback \ No newline at end of file diff --git a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts index 08efc1189513..fa1535134d21 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts @@ -410,29 +410,23 @@ describe("Certificates client - create, read, update and delete", () => { describe("can get a deleted certificate", () => { it("using beginDeleteCertificate's poller", async function(this: Context) { - console.log("111111111111111111111"); const certificateName = testClient.formatName(`${prefix}-${this!.test!.title}-${suffix}`); - console.log("222222222222222222222"); await client.beginCreateCertificate( certificateName, basicCertificatePolicy, testPollerProperties ); - console.log("3333333333333333333"); const deletePoller = await client.beginDeleteCertificate( certificateName, testPollerProperties ); - console.log("4444444444444444"); const deletedCertificate = await deletePoller.pollUntilDone(); - console.log("555555555555555555"); assert.equal( deletedCertificate.name, certificateName, "Unexpected certificate name in result from pollUntilDone()." ); - console.log("66666666666666666"); }); it("using getDeletedCertificate", async function(this: Context) { From 1ea74615909ad9ae6d5115d40faab189172936a1 Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 22 Dec 2021 10:08:33 +0800 Subject: [PATCH 093/133] update key vault certificate --- sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts index fa1535134d21..1efe76069291 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts @@ -410,6 +410,7 @@ describe("Certificates client - create, read, update and delete", () => { describe("can get a deleted certificate", () => { it("using beginDeleteCertificate's poller", async function(this: Context) { + this.enableTimeouts(false); const certificateName = testClient.formatName(`${prefix}-${this!.test!.title}-${suffix}`); await client.beginCreateCertificate( certificateName, From c13892a1debe4599788af0bbbd5bae738707c6bb Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Fri, 24 Dec 2021 14:53:46 +0800 Subject: [PATCH 094/133] update service bus --- .../service-bus/test/internal/serviceBusClient.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts b/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts index 659ff64da0e3..de7c04f90eaa 100644 --- a/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts +++ b/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts @@ -852,9 +852,9 @@ function reduceRetries(receiver: ServiceBusReceiver): void { // There are other tests that ensure that the retry cycle does work properly. (receiver as ServiceBusReceiverImpl)["_retryOptions"] = { ...(receiver as ServiceBusReceiverImpl)["_retryOptions"], - maxRetries: 0, - timeoutInMs: 0, + maxRetries: 3, + timeoutInMs: 100000, maxRetryDelayInMs: 0, - retryDelayInMs: 0 + retryDelayInMs: 30000 }; } From 1cc80fc3053692329eeac4de5d8ee332f144df0c Mon Sep 17 00:00:00 2001 From: zzhxiaofeng Date: Wed, 29 Dec 2021 14:59:44 +0800 Subject: [PATCH 095/133] update form recognizer --- .../ai-form-recognizer/test/public/training.spec.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk/formrecognizer/ai-form-recognizer/test/public/training.spec.ts b/sdk/formrecognizer/ai-form-recognizer/test/public/training.spec.ts index a9ce8e8a6895..d5d5226ea4ab 100644 --- a/sdk/formrecognizer/ai-form-recognizer/test/public/training.spec.ts +++ b/sdk/formrecognizer/ai-form-recognizer/test/public/training.spec.ts @@ -253,7 +253,12 @@ matrix([[true, false]] as const, async (useAad) => { it("copy model", async function () { // Since this test is isolated, we'll create a fresh set of resources for it - + console.log("----------------------------------------------"); + var aa = env["forM_RECOGNIZER_TRAINING_CONTAINER_SAS_URL"]; + for (var i = 0; i < aa.length; i++) { + console.log(aa[i]); + } + console.log("----------------------------------------------"); const trainingClient = new DocumentModelAdministrationClient( endpoint(), makeCredential(useAad) From 4f6bc7d507b37bacc72444071f416a51f90fc617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenjie=20Yu=EF=BC=88MSFT=EF=BC=89?= <81678720+zedy-wj@users.noreply.github.com> Date: Sun, 30 Jan 2022 09:56:45 +0800 Subject: [PATCH 096/133] Update tests.yml Remove invalid changes --- sdk/servicebus/service-bus/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/servicebus/service-bus/tests.yml b/sdk/servicebus/service-bus/tests.yml index 4c58d9feef69..3554549e226d 100644 --- a/sdk/servicebus/service-bus/tests.yml +++ b/sdk/servicebus/service-bus/tests.yml @@ -5,7 +5,7 @@ stages: parameters: PackageName: "@azure/service-bus" ServiceDirectory: servicebus - TimeoutInMinutes: 120 + TimeoutInMinutes: 180 SupportedClouds: 'Public,UsGov,China' EnvVars: AZURE_CLIENT_ID: $(SERVICEBUS_CLIENT_ID) From 711241f76fbf38c5bd8dd0731ebde92cccb34829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenjie=20Yu=EF=BC=88MSFT=EF=BC=89?= <81678720+zedy-wj@users.noreply.github.com> Date: Sun, 30 Jan 2022 09:58:16 +0800 Subject: [PATCH 097/133] Update serviceBusClient.spec.ts Remove invalid changes --- .../service-bus/test/internal/serviceBusClient.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts b/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts index e708f93a742c..aeef76afd6ea 100644 --- a/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts +++ b/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts @@ -843,8 +843,8 @@ function reduceRetries(receiver: ServiceBusReceiver): void { // There are other tests that ensure that the retry cycle does work properly. (receiver as ServiceBusReceiverImpl)["_retryOptions"] = { ...(receiver as ServiceBusReceiverImpl)["_retryOptions"], - maxRetries: 3, - timeoutInMs: 100000, + maxRetries: 0, + timeoutInMs: 0, maxRetryDelayInMs: 0, retryDelayInMs: 0, }; From 929b45884b3d48e440bf39c40bf7bf7693d98d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenjie=20Yu=EF=BC=88MSFT=EF=BC=89?= <81678720+zedy-wj@users.noreply.github.com> Date: Sun, 30 Jan 2022 10:14:20 +0800 Subject: [PATCH 098/133] Update textAnalyticsClient.spec.ts Remove invalid changes --- .../ai-text-analytics/test/public/textAnalyticsClient.spec.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/sdk/textanalytics/ai-text-analytics/test/public/textAnalyticsClient.spec.ts b/sdk/textanalytics/ai-text-analytics/test/public/textAnalyticsClient.spec.ts index f4124bd48e21..352e187dd9b7 100644 --- a/sdk/textanalytics/ai-text-analytics/test/public/textAnalyticsClient.spec.ts +++ b/sdk/textanalytics/ai-text-analytics/test/public/textAnalyticsClient.spec.ts @@ -944,8 +944,6 @@ matrix([["APIKey", "AAD"]] as const, async (authMethod: AuthMethod) => { text: "A recent report by the Government Accountability Office (GAO) found that the dramatic increase in oil and natural gas development on federal lands over the past six years has stretched the staff of the BLM to a point that it has been unable to meet its environmental protection responsibilities.", }, ]; - console.log("11111111111111", env.TEXT_ANALYTICS_RECOGNIZE_CUSTOM_ENTITIES_PROJECT_NAME.toString()); - console.log("22222222222222", env.TEXT_ANALYTICS_RECOGNIZE_CUSTOM_ENTITIES_DEPLOYMENT_NAME.toString()); const poller = await client.beginAnalyzeActions( docs, From 4faa97e4c843ccec3c9490a8f43ef0e91327b116 Mon Sep 17 00:00:00 2001 From: zedy Date: Sun, 30 Jan 2022 14:16:30 +0800 Subject: [PATCH 099/133] remove changes --- sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts | 1 - sdk/keyvault/keyvault-certificates/tests.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts index 90d791d84007..01e7ef54f2c9 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts @@ -356,7 +356,6 @@ describe("Certificates client - create, read, update and delete", () => { testPollerProperties ); const poller = await client.beginDeleteCertificate(certificateName, testPollerProperties); - await poller.pollUntilDone(); const result = poller.getResult()!; assert.equal(typeof result.recoveryId, "string"); diff --git a/sdk/keyvault/keyvault-certificates/tests.yml b/sdk/keyvault/keyvault-certificates/tests.yml index a0954b86e767..0533e2c255ff 100644 --- a/sdk/keyvault/keyvault-certificates/tests.yml +++ b/sdk/keyvault/keyvault-certificates/tests.yml @@ -5,7 +5,7 @@ stages: parameters: PackageName: "@azure/keyvault-certificates" ServiceDirectory: keyvault - TimeoutInMinutes: 90, + TimeoutInMinutes: 35, SupportedClouds: 'Public,UsGov,China' AdditionalMatrixConfigs: - Name: Keyvault_live_test_base From db1553881b6ec9eb43ce17319d1ec0abd55d7705 Mon Sep 17 00:00:00 2001 From: zedy Date: Mon, 7 Feb 2022 18:05:14 +0800 Subject: [PATCH 100/133] fix unstable bug --- sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts index e91bfc0a66ba..cd6ec79cfe83 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts @@ -120,11 +120,12 @@ describe("Certificates client - create, read, update and delete", () => { it("can update the tags of a certificate", async function (this: Context) { const certificateName = testClient.formatName(`${prefix}-${this!.test!.title}-${suffix}`); - await client.beginCreateCertificate( + const certificatePoller = await client.beginCreateCertificate( certificateName, basicCertificatePolicy, testPollerProperties ); + await certificatePoller.pollUntilDone(); await client.updateCertificateProperties(certificateName, "", { tags: { customTag: "value", @@ -350,11 +351,12 @@ describe("Certificates client - create, read, update and delete", () => { it("can delete a certificate", async function (this: Context) { const certificateName = testClient.formatName(`${prefix}-${this!.test!.title}-${suffix}`); - await client.beginCreateCertificate( + const certificatePoller = await client.beginCreateCertificate( certificateName, basicCertificatePolicy, testPollerProperties ); + await certificatePoller.pollUntilDone(); const poller = await client.beginDeleteCertificate(certificateName, testPollerProperties); const result = poller.getResult()!; From 82e61e88b03d2edb09d170b3f5a0828ddf56a7a6 Mon Sep 17 00:00:00 2001 From: zedy Date: Tue, 8 Feb 2022 11:22:23 +0800 Subject: [PATCH 101/133] upgrade poller --- sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts | 3 ++- .../keyvault-certificates/test/public/lro.operation.spec.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts index cd6ec79cfe83..6bba923c4830 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts @@ -561,11 +561,12 @@ describe("Certificates client - create, read, update and delete", () => { this.retries(2); const certificateName = recorder.getUniqueName("crudcertoperation"); - await client.beginCreateCertificate( + const certificatePoller = await client.beginCreateCertificate( certificateName, basicCertificatePolicy, testPollerProperties ); + await certificatePoller.pollUntilDone(); let certificateOperation: any; diff --git a/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts index 9198e46f8788..2e7a4ee8e2b4 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts @@ -46,6 +46,7 @@ describe("Certificates client - LRO - certificate operation", () => { DefaultCertificatePolicy, testPollerProperties ); + await createPoller.pollUntilDone(); createPoller.stopPolling(); const poller = await client.getCertificateOperation(certificateName, testPollerProperties); assert.ok(poller.getOperationState().isStarted); @@ -73,6 +74,7 @@ describe("Certificates client - LRO - certificate operation", () => { DefaultCertificatePolicy, testPollerProperties ); + await createPoller.pollUntilDone(); createPoller.stopPolling(); From b70cb84b7307a4d9fc40aa47a271f7f0953d83f8 Mon Sep 17 00:00:00 2001 From: zedy Date: Tue, 8 Feb 2022 13:26:10 +0800 Subject: [PATCH 102/133] Remove invalid changes, fix unstable bug --- sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts | 1 + .../keyvault-certificates/test/public/lro.operation.spec.ts | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts index 6bba923c4830..c2a7f26ae107 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts @@ -358,6 +358,7 @@ describe("Certificates client - create, read, update and delete", () => { ); await certificatePoller.pollUntilDone(); const poller = await client.beginDeleteCertificate(certificateName, testPollerProperties); + await poller.pollUntilDone(); const result = poller.getResult()!; assert.equal(typeof result.recoveryId, "string"); diff --git a/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts index 2e7a4ee8e2b4..9198e46f8788 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts @@ -46,7 +46,6 @@ describe("Certificates client - LRO - certificate operation", () => { DefaultCertificatePolicy, testPollerProperties ); - await createPoller.pollUntilDone(); createPoller.stopPolling(); const poller = await client.getCertificateOperation(certificateName, testPollerProperties); assert.ok(poller.getOperationState().isStarted); @@ -74,7 +73,6 @@ describe("Certificates client - LRO - certificate operation", () => { DefaultCertificatePolicy, testPollerProperties ); - await createPoller.pollUntilDone(); createPoller.stopPolling(); From 30c7b22722b3bd2e4d932d5649ae7595459f2780 Mon Sep 17 00:00:00 2001 From: zedy Date: Tue, 8 Feb 2022 13:59:31 +0800 Subject: [PATCH 103/133] remove invalid changes, fix unstable bug --- sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts index c2a7f26ae107..71a40fb358a4 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts @@ -562,12 +562,11 @@ describe("Certificates client - create, read, update and delete", () => { this.retries(2); const certificateName = recorder.getUniqueName("crudcertoperation"); - const certificatePoller = await client.beginCreateCertificate( + await client.beginCreateCertificate( certificateName, basicCertificatePolicy, testPollerProperties ); - await certificatePoller.pollUntilDone(); let certificateOperation: any; From 75552893dc20ffe976f453b14a6c59528d580084 Mon Sep 17 00:00:00 2001 From: zedy Date: Tue, 1 Mar 2022 16:40:41 +0800 Subject: [PATCH 104/133] set a long time for usgov and china clouds --- sdk/eventhub/event-hubs/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index 88cee4b8aa72..fd627bdcf065 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -5,7 +5,7 @@ stages: parameters: PackageName: "@azure/event-hubs" ServiceDirectory: eventhub - TimeoutInMinutes: 90 + TimeoutInMinutes: 120 SupportedClouds: 'Public,UsGov,China' CloudConfig: Public: From 1fbbbe77e4d15ea963e1caefa1bf0aee6d7f69f7 Mon Sep 17 00:00:00 2001 From: zedy Date: Tue, 1 Mar 2022 18:45:33 +0800 Subject: [PATCH 105/133] add retry number in unstable test --- .../keyvault-certificates/test/public/lro.recover.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts index 312f545a7d2b..db3c9cc1dabc 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts @@ -68,6 +68,7 @@ describe("Certificates client - LRO - recoverDelete", () => { }); it("can resume from a stopped poller", async function (this: Context) { + this.retries(5); const certificateName = testClient.formatName( `${certificatePrefix}-${this!.test!.title}-${certificateSuffix}` ); From 7326bf136018966d5bc819b0cb1728155caa00de Mon Sep 17 00:00:00 2001 From: zedy Date: Wed, 2 Mar 2022 17:13:47 +0800 Subject: [PATCH 106/133] check the error position --- .../test/internal/eventProcessor.spec.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts index cb8832a2a4ea..3f8dc4327672 100644 --- a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts +++ b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts @@ -760,6 +760,9 @@ testWithServiceTypes((serviceVersion) => { }); it("should support start after stopping", async function (): Promise { + console.log("************************************************") + console.log("***********Testing ***********") + console.log("************************************************") const partitionIds = await producerClient.getPartitionIds(); // ensure we have at least 2 partitions @@ -799,7 +802,13 @@ testWithServiceTypes((serviceVersion) => { loggerForTest(`Starting processor again`); subscriptionEventHandler.clear(); + console.log("************************************************") + console.log("***********Testing processor begining***********") + console.log("************************************************") processor.start(); + console.log("************************************************") + console.log("***********Testing processor begining***********") + console.log("************************************************") await subscriptionEventHandler.waitUntilInitialized(partitionIds); @@ -1655,8 +1664,7 @@ testWithServiceTypes((serviceVersion) => { const claimedPartitions = claimedPartitionsMap[eventProcessorId]; claimedPartitions.delete(partitionId); loggerForTest( - `[${(context as any).eventProcessorId}] processClose(${reason}) on partition ${ - context.partitionId + `[${(context as any).eventProcessorId}] processClose(${reason}) on partition ${context.partitionId }` ); if (reason === CloseReason.OwnershipLost && allPartitionsClaimed) { @@ -1820,8 +1828,7 @@ testWithServiceTypes((serviceVersion) => { const claimedPartitions = claimedPartitionsMap[eventProcessorId]; claimedPartitions.delete(partitionId); loggerForTest( - `[${(context as any).eventProcessorId}] processClose(${reason}) on partition ${ - context.partitionId + `[${(context as any).eventProcessorId}] processClose(${reason}) on partition ${context.partitionId }` ); if (reason === CloseReason.OwnershipLost && allPartitionsClaimed) { From b20bb3ea32b86ee4ae31aacdb2b07c8688cf296c Mon Sep 17 00:00:00 2001 From: zedy Date: Wed, 2 Mar 2022 17:29:02 +0800 Subject: [PATCH 107/133] check the error position --- sdk/eventhub/event-hubs/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index fd627bdcf065..88cee4b8aa72 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -5,7 +5,7 @@ stages: parameters: PackageName: "@azure/event-hubs" ServiceDirectory: eventhub - TimeoutInMinutes: 120 + TimeoutInMinutes: 90 SupportedClouds: 'Public,UsGov,China' CloudConfig: Public: From 30ba0996323a1173317601078aad26631ca17554 Mon Sep 17 00:00:00 2001 From: zedy Date: Thu, 24 Mar 2022 22:24:47 +0800 Subject: [PATCH 108/133] locate the time out steps --- .../test/internal/eventProcessor.spec.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts index 3f8dc4327672..017d2bbe568b 100644 --- a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts +++ b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts @@ -761,15 +761,24 @@ testWithServiceTypes((serviceVersion) => { it("should support start after stopping", async function (): Promise { console.log("************************************************") - console.log("***********Testing ***********") + console.log("***********Testing step 1***********") console.log("************************************************") const partitionIds = await producerClient.getPartitionIds(); + console.log("************************************************") + console.log("***********Testing step 2***********") + console.log("************************************************") // ensure we have at least 2 partitions partitionIds.length.should.gte(2); + console.log("************************************************") + console.log("***********Testing step 3***********") + console.log("************************************************") const { subscriptionEventHandler, startPosition } = await SubscriptionHandlerForTests.startingFromHere(producerClient); + console.log("************************************************") + console.log("***********Testing step 4***********") + console.log("************************************************") const processor = new EventProcessor( EventHubConsumerClient.defaultConsumerGroupName, @@ -781,6 +790,9 @@ testWithServiceTypes((serviceVersion) => { startPosition: startPosition, } ); + console.log("************************************************") + console.log("***********Testing step 5***********") + console.log("************************************************") loggerForTest(`Starting processor for the first time`); processor.start(); From 7caa3f197c2917f804dd92555993807181d747bf Mon Sep 17 00:00:00 2001 From: zedy Date: Fri, 22 Apr 2022 10:22:08 +0800 Subject: [PATCH 109/133] increase the timeout to 150 min --- sdk/eventhub/event-hubs/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index 88cee4b8aa72..09a703513ee4 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -5,7 +5,7 @@ stages: parameters: PackageName: "@azure/event-hubs" ServiceDirectory: eventhub - TimeoutInMinutes: 90 + TimeoutInMinutes: 150 SupportedClouds: 'Public,UsGov,China' CloudConfig: Public: From 15b68dc045d26a76805bb2a45063946df542f48f Mon Sep 17 00:00:00 2001 From: "Wenjie Yu (Wicresoft North America Ltd)" Date: Mon, 16 May 2022 16:12:32 +0800 Subject: [PATCH 110/133] test fix china time out bug --- .../event-hubs/test/internal/eventProcessor.spec.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts index bb0ef31579d4..aadee9ae9d9a 100644 --- a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts +++ b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts @@ -37,6 +37,7 @@ import { delay } from "@azure/core-amqp"; import { isLatestPosition } from "../../src/eventPosition"; import { loggerForTest } from "../public/utils/logHelpers"; import { testWithServiceTypes } from "../public/utils/testWithServiceTypes"; +import { v4 } from "uuid"; const should = chai.should(); chai.use(chaiAsPromised); @@ -699,6 +700,12 @@ testWithServiceTypes((serviceVersion) => { // ensure we have at least 2 partitions partitionIds.length.should.gte(2); + // work around initial state issue by filling partitions with at least one message + for (let i = 1; i < 100; i++) { + const filer = { body: "b", messageId: v4() }; + await producerClient.sendBatch([filer]); + } + const { subscriptionEventHandler, startPosition } = await SubscriptionHandlerForTests.startingFromHere(producerClient); @@ -713,8 +720,6 @@ testWithServiceTypes((serviceVersion) => { } ); - processor.start(); - processor.start(); processor.start(); const expectedMessages = await sendOneMessagePerPartition(partitionIds, producerClient); From 2abe9ae80522e1a53e737f9ab7ae8d9366bc8505 Mon Sep 17 00:00:00 2001 From: "Wenjie Yu (Wicresoft North America Ltd)" Date: Mon, 30 May 2022 16:38:34 +0800 Subject: [PATCH 111/133] fix some variable --- sdk/textanalytics/ai-text-analytics/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/textanalytics/ai-text-analytics/tests.yml b/sdk/textanalytics/ai-text-analytics/tests.yml index 8bdb772bd7bf..66f42151166a 100644 --- a/sdk/textanalytics/ai-text-analytics/tests.yml +++ b/sdk/textanalytics/ai-text-analytics/tests.yml @@ -5,12 +5,12 @@ stages: parameters: PackageName: "@azure/ai-text-analytics" ServiceDirectory: textanalytics - TimeoutInMinutes: 180 + TimeoutInMinutes: 60 SupportedClouds: 'Public,UsGov,China' EnvVars: - AZURE_CLIENT_ID: $(TEXTANALYTICS_CLIENT_ID) - AZURE_TENANT_ID: $(TEXTANALYTICS_TENANT_ID) - AZURE_CLIENT_SECRET: $(TEXTANALYTICS_CLIENT_SECRET) + AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) + AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) + AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) ENDPOINT: $(js-textanalytics-test-service-endpoint) LANGUAGE_API_KEY: $(js-textanalytics-api-key-new) LANGUAGE_API_KEY_ALT: $(js-textanalytics-api-key-alt) From 75aa2d395a0ec8dc18a8f60822a6b5cdec1e1240 Mon Sep 17 00:00:00 2001 From: "Wenjie Yu (Wicresoft North America Ltd)" Date: Mon, 30 May 2022 17:24:31 +0800 Subject: [PATCH 112/133] add minutes in eventhub tests --- .../test/internal/eventProcessor.spec.ts | 21 ------------------- .../public/eventHubConsumerClient.spec.ts | 18 ++++++++-------- 2 files changed, 9 insertions(+), 30 deletions(-) diff --git a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts index aadee9ae9d9a..85f1706bace6 100644 --- a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts +++ b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts @@ -765,25 +765,13 @@ testWithServiceTypes((serviceVersion) => { }); it("should support start after stopping", async function (): Promise { - console.log("************************************************") - console.log("***********Testing step 1***********") - console.log("************************************************") const partitionIds = await producerClient.getPartitionIds(); - console.log("************************************************") - console.log("***********Testing step 2***********") - console.log("************************************************") // ensure we have at least 2 partitions partitionIds.length.should.gte(2); - console.log("************************************************") - console.log("***********Testing step 3***********") - console.log("************************************************") const { subscriptionEventHandler, startPosition } = await SubscriptionHandlerForTests.startingFromHere(producerClient); - console.log("************************************************") - console.log("***********Testing step 4***********") - console.log("************************************************") const processor = new EventProcessor( EventHubConsumerClient.defaultConsumerGroupName, @@ -795,9 +783,6 @@ testWithServiceTypes((serviceVersion) => { startPosition: startPosition, } ); - console.log("************************************************") - console.log("***********Testing step 5***********") - console.log("************************************************") loggerForTest(`Starting processor for the first time`); processor.start(); @@ -819,13 +804,7 @@ testWithServiceTypes((serviceVersion) => { loggerForTest(`Starting processor again`); subscriptionEventHandler.clear(); - console.log("************************************************") - console.log("***********Testing processor begining***********") - console.log("************************************************") processor.start(); - console.log("************************************************") - console.log("***********Testing processor begining***********") - console.log("************************************************") await subscriptionEventHandler.waitUntilInitialized(partitionIds); diff --git a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts index b7dae5837a0f..7bdc7e8994d2 100644 --- a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts +++ b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts @@ -255,7 +255,7 @@ testWithServiceTypes((serviceVersion) => { subscription2 = consumerClient2.subscribe(partitionId, subscriptionHandlers2, { ownerLevel: 1, maxBatchSize: 1, - maxWaitTimeInSeconds: 1, + maxWaitTimeInSeconds: 10, }); } else { // stop this subscription, we know close was called so we've restarted @@ -271,7 +271,7 @@ testWithServiceTypes((serviceVersion) => { }, { maxBatchSize: 1, - maxWaitTimeInSeconds: 1, + maxWaitTimeInSeconds: 10, } ); @@ -296,13 +296,13 @@ testWithServiceTypes((serviceVersion) => { EventHubConsumerClient.defaultConsumerGroupName, service.connectionString, service.path, - { loadBalancingOptions: { updateIntervalInMs: 1000 } } + { loadBalancingOptions: { updateIntervalInMs: 5000 } } ); const consumerClient2 = new EventHubConsumerClient( EventHubConsumerClient.defaultConsumerGroupName, service.connectionString, service.path, - { loadBalancingOptions: { updateIntervalInMs: 1000 } } + { loadBalancingOptions: { updateIntervalInMs: 5000 } } ); clients.push(consumerClient1, consumerClient2); @@ -339,13 +339,13 @@ testWithServiceTypes((serviceVersion) => { const subscription1 = consumerClient1.subscribe(subscriptionHandlers1, { maxBatchSize: 1, - maxWaitTimeInSeconds: 1, + maxWaitTimeInSeconds: 10, }); await loopUntil({ maxTimes: 10, name: "Wait for subscription1 to read from all partitions", - timeBetweenRunsMs: 1000, + timeBetweenRunsMs: 5000, async until() { // wait until we've seen processEvents invoked for each partition. return ( @@ -369,14 +369,14 @@ testWithServiceTypes((serviceVersion) => { // start 2nd subscription with an ownerLevel so it triggers the close handlers on the 1st subscription. const subscription2 = consumerClient2.subscribe(subscriptionHandlers2, { maxBatchSize: 1, - maxWaitTimeInSeconds: 1, + maxWaitTimeInSeconds: 10, ownerLevel: 1, }); await loopUntil({ maxTimes: 10, name: "Wait for subscription2 to read from all partitions and subscription1 to invoke close handlers", - timeBetweenRunsMs: 1000, + timeBetweenRunsMs: 5000, async until() { const sub1CloseHandlersCalled = Boolean( partitionIds.filter((id) => { @@ -393,7 +393,7 @@ testWithServiceTypes((serviceVersion) => { await loopUntil({ maxTimes: 10, name: "Wait for subscription1 to recover", - timeBetweenRunsMs: 1000, + timeBetweenRunsMs: 5000, async until() { // wait until we've seen an additional processEvent for each partition. return ( From c2ed62e8ad0e59272222d950405dcd9856e061dc Mon Sep 17 00:00:00 2001 From: "Wenjie Yu (Wicresoft North America Ltd)" Date: Mon, 30 May 2022 17:26:52 +0800 Subject: [PATCH 113/133] update Timeout times --- sdk/eventhub/event-hubs/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index 09a703513ee4..88cee4b8aa72 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -5,7 +5,7 @@ stages: parameters: PackageName: "@azure/event-hubs" ServiceDirectory: eventhub - TimeoutInMinutes: 150 + TimeoutInMinutes: 90 SupportedClouds: 'Public,UsGov,China' CloudConfig: Public: From 8c222afb19b713e24026a98400e260bc9c8ad7c7 Mon Sep 17 00:00:00 2001 From: "Wenjie Yu (Wicresoft North America Ltd)" Date: Tue, 31 May 2022 09:48:52 +0800 Subject: [PATCH 114/133] fix time issue --- .../test/public/eventHubConsumerClient.spec.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts index 7bdc7e8994d2..b7dae5837a0f 100644 --- a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts +++ b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts @@ -255,7 +255,7 @@ testWithServiceTypes((serviceVersion) => { subscription2 = consumerClient2.subscribe(partitionId, subscriptionHandlers2, { ownerLevel: 1, maxBatchSize: 1, - maxWaitTimeInSeconds: 10, + maxWaitTimeInSeconds: 1, }); } else { // stop this subscription, we know close was called so we've restarted @@ -271,7 +271,7 @@ testWithServiceTypes((serviceVersion) => { }, { maxBatchSize: 1, - maxWaitTimeInSeconds: 10, + maxWaitTimeInSeconds: 1, } ); @@ -296,13 +296,13 @@ testWithServiceTypes((serviceVersion) => { EventHubConsumerClient.defaultConsumerGroupName, service.connectionString, service.path, - { loadBalancingOptions: { updateIntervalInMs: 5000 } } + { loadBalancingOptions: { updateIntervalInMs: 1000 } } ); const consumerClient2 = new EventHubConsumerClient( EventHubConsumerClient.defaultConsumerGroupName, service.connectionString, service.path, - { loadBalancingOptions: { updateIntervalInMs: 5000 } } + { loadBalancingOptions: { updateIntervalInMs: 1000 } } ); clients.push(consumerClient1, consumerClient2); @@ -339,13 +339,13 @@ testWithServiceTypes((serviceVersion) => { const subscription1 = consumerClient1.subscribe(subscriptionHandlers1, { maxBatchSize: 1, - maxWaitTimeInSeconds: 10, + maxWaitTimeInSeconds: 1, }); await loopUntil({ maxTimes: 10, name: "Wait for subscription1 to read from all partitions", - timeBetweenRunsMs: 5000, + timeBetweenRunsMs: 1000, async until() { // wait until we've seen processEvents invoked for each partition. return ( @@ -369,14 +369,14 @@ testWithServiceTypes((serviceVersion) => { // start 2nd subscription with an ownerLevel so it triggers the close handlers on the 1st subscription. const subscription2 = consumerClient2.subscribe(subscriptionHandlers2, { maxBatchSize: 1, - maxWaitTimeInSeconds: 10, + maxWaitTimeInSeconds: 1, ownerLevel: 1, }); await loopUntil({ maxTimes: 10, name: "Wait for subscription2 to read from all partitions and subscription1 to invoke close handlers", - timeBetweenRunsMs: 5000, + timeBetweenRunsMs: 1000, async until() { const sub1CloseHandlersCalled = Boolean( partitionIds.filter((id) => { @@ -393,7 +393,7 @@ testWithServiceTypes((serviceVersion) => { await loopUntil({ maxTimes: 10, name: "Wait for subscription1 to recover", - timeBetweenRunsMs: 5000, + timeBetweenRunsMs: 1000, async until() { // wait until we've seen an additional processEvent for each partition. return ( From db48a4c8cc93fd7e5c2676ac022fb5fe064608fd Mon Sep 17 00:00:00 2001 From: "Wenjie Yu (Wicresoft North America Ltd)" Date: Tue, 31 May 2022 12:15:51 +0800 Subject: [PATCH 115/133] update variables --- sdk/textanalytics/ai-text-analytics/tests.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sdk/textanalytics/ai-text-analytics/tests.yml b/sdk/textanalytics/ai-text-analytics/tests.yml index 66f42151166a..5439c31f7ff6 100644 --- a/sdk/textanalytics/ai-text-analytics/tests.yml +++ b/sdk/textanalytics/ai-text-analytics/tests.yml @@ -8,10 +8,18 @@ stages: TimeoutInMinutes: 60 SupportedClouds: 'Public,UsGov,China' EnvVars: - AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) - AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) - AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_CLIENT_ID: $(TEXTANALYTICS_CLIENT_ID) + AZURE_TENANT_ID: $(TEXTANALYTICS_TENANT_ID) + AZURE_CLIENT_SECRET: $(TEXTANALYTICS_CLIENT_SECRET) ENDPOINT: $(js-textanalytics-test-service-endpoint) + TEXT_ANALYTICS_API_KEY: $(js-textanalytics-api-key-new) + TEXT_ANALYTICS_API_KEY_ALT: $(js-textanalytics-api-key-alt) + TEXT_ANALYTICS_RECOGNIZE_CUSTOM_ENTITIES_PROJECT_NAME: $(js-recognize-custom-entities-project-name) + TEXT_ANALYTICS_RECOGNIZE_CUSTOM_ENTITIES_DEPLOYMENT_NAME: $(js-recognize-custom-entities-deployment-name) + TEXT_ANALYTICS_SINGLE_CATEGORY_CLASSIFY_PROJECT_NAME: $(js-single-category-classify-project-name) + TEXT_ANALYTICS_SINGLE_CATEGORY_CLASSIFY_DEPLOYMENT_NAME: $(js-single-category-classify-deployment-name) + TEXT_ANALYTICS_MULTI_CATEGORY_CLASSIFY_PROJECT_NAME: $(js-multi-category-classify-project-name) + TEXT_ANALYTICS_MULTI_CATEGORY_CLASSIFY_DEPLOYMENT_NAME: $(js-multi-category-classify-deployment-name) LANGUAGE_API_KEY: $(js-textanalytics-api-key-new) LANGUAGE_API_KEY_ALT: $(js-textanalytics-api-key-alt) LANGUAGE_CUSTOM_ENTITY_RECOGNITION_PROJECT_NAME: $(js-recognize-custom-entities-project-name) From 5e7ae353e4c918a1b3df198005a7863940331c6d Mon Sep 17 00:00:00 2001 From: "Wenjie Yu (Wicresoft North America Ltd)" Date: Tue, 31 May 2022 14:24:21 +0800 Subject: [PATCH 116/133] remove some invalid variable --- sdk/textanalytics/ai-text-analytics/tests.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sdk/textanalytics/ai-text-analytics/tests.yml b/sdk/textanalytics/ai-text-analytics/tests.yml index 5439c31f7ff6..33b80561e3da 100644 --- a/sdk/textanalytics/ai-text-analytics/tests.yml +++ b/sdk/textanalytics/ai-text-analytics/tests.yml @@ -12,14 +12,6 @@ stages: AZURE_TENANT_ID: $(TEXTANALYTICS_TENANT_ID) AZURE_CLIENT_SECRET: $(TEXTANALYTICS_CLIENT_SECRET) ENDPOINT: $(js-textanalytics-test-service-endpoint) - TEXT_ANALYTICS_API_KEY: $(js-textanalytics-api-key-new) - TEXT_ANALYTICS_API_KEY_ALT: $(js-textanalytics-api-key-alt) - TEXT_ANALYTICS_RECOGNIZE_CUSTOM_ENTITIES_PROJECT_NAME: $(js-recognize-custom-entities-project-name) - TEXT_ANALYTICS_RECOGNIZE_CUSTOM_ENTITIES_DEPLOYMENT_NAME: $(js-recognize-custom-entities-deployment-name) - TEXT_ANALYTICS_SINGLE_CATEGORY_CLASSIFY_PROJECT_NAME: $(js-single-category-classify-project-name) - TEXT_ANALYTICS_SINGLE_CATEGORY_CLASSIFY_DEPLOYMENT_NAME: $(js-single-category-classify-deployment-name) - TEXT_ANALYTICS_MULTI_CATEGORY_CLASSIFY_PROJECT_NAME: $(js-multi-category-classify-project-name) - TEXT_ANALYTICS_MULTI_CATEGORY_CLASSIFY_DEPLOYMENT_NAME: $(js-multi-category-classify-deployment-name) LANGUAGE_API_KEY: $(js-textanalytics-api-key-new) LANGUAGE_API_KEY_ALT: $(js-textanalytics-api-key-alt) LANGUAGE_CUSTOM_ENTITY_RECOGNITION_PROJECT_NAME: $(js-recognize-custom-entities-project-name) From fbd583a1bbd3b1e68348fa2d2b17c1b0c469fdb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenjie=20Yu=EF=BC=88MSFT=EF=BC=89?= <81678720+zedy-wj@users.noreply.github.com> Date: Mon, 13 Mar 2023 17:49:22 +0800 Subject: [PATCH 117/133] Update eventHubConsumerClient.spec.ts add max wait time for china cloud --- .../event-hubs/test/public/eventHubConsumerClient.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts index b7dae5837a0f..92f669bb1cf4 100644 --- a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts +++ b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts @@ -255,7 +255,7 @@ testWithServiceTypes((serviceVersion) => { subscription2 = consumerClient2.subscribe(partitionId, subscriptionHandlers2, { ownerLevel: 1, maxBatchSize: 1, - maxWaitTimeInSeconds: 1, + maxWaitTimeInSeconds: 10, }); } else { // stop this subscription, we know close was called so we've restarted @@ -271,14 +271,14 @@ testWithServiceTypes((serviceVersion) => { }, { maxBatchSize: 1, - maxWaitTimeInSeconds: 1, + maxWaitTimeInSeconds: 10, } ); await loopUntil({ - maxTimes: 10, + maxTimes: 50, name: "Wait for subscription1 to recover", - timeBetweenRunsMs: 5000, + timeBetweenRunsMs: 25000, async until() { return !subscription1.isRunning && !subscription2!.isRunning; }, From 88b78be9ce19bf7e2015d7a51b413d2ba8e98d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenjie=20Yu=EF=BC=88MSFT=EF=BC=89?= <81678720+zedy-wj@users.noreply.github.com> Date: Tue, 14 Mar 2023 09:25:59 +0800 Subject: [PATCH 118/133] Update tests.yml fix location --- sdk/eventhub/event-hubs/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/eventhub/event-hubs/tests.yml b/sdk/eventhub/event-hubs/tests.yml index 88cee4b8aa72..1c2fcab8b6b1 100644 --- a/sdk/eventhub/event-hubs/tests.yml +++ b/sdk/eventhub/event-hubs/tests.yml @@ -15,6 +15,7 @@ stages: Location: 'usgovarizona' China: SubscriptionConfiguration: $(sub-config-cn-test-resources) + Location: 'chinaeast' EnvVars: AZURE_CLIENT_ID: $(EVENTHUB_CLIENT_ID) AZURE_CLIENT_SECRET: $(EVENTHUB_CLIENT_SECRET) From 3155f4d98a12385365ff0b22342e9543c5661e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenjie=20Yu=EF=BC=88MSFT=EF=BC=89?= <81678720+zedy-wj@users.noreply.github.com> Date: Tue, 14 Mar 2023 09:58:05 +0800 Subject: [PATCH 119/133] Update eventHubConsumerClient.spec.ts remove invalid changes --- .../event-hubs/test/public/eventHubConsumerClient.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts index 92f669bb1cf4..0fb696730a87 100644 --- a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts +++ b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts @@ -255,7 +255,7 @@ testWithServiceTypes((serviceVersion) => { subscription2 = consumerClient2.subscribe(partitionId, subscriptionHandlers2, { ownerLevel: 1, maxBatchSize: 1, - maxWaitTimeInSeconds: 10, + maxWaitTimeInSeconds: 1, }); } else { // stop this subscription, we know close was called so we've restarted @@ -271,14 +271,14 @@ testWithServiceTypes((serviceVersion) => { }, { maxBatchSize: 1, - maxWaitTimeInSeconds: 10, + maxWaitTimeInSeconds: 1, } ); await loopUntil({ - maxTimes: 50, + maxTimes: 20, name: "Wait for subscription1 to recover", - timeBetweenRunsMs: 25000, + timeBetweenRunsMs: 10000, async until() { return !subscription1.isRunning && !subscription2!.isRunning; }, From f0a961ce909ea94824f146d5b4dddee2d67445c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenjie=20Yu=EF=BC=88MSFT=EF=BC=89?= <81678720+zedy-wj@users.noreply.github.com> Date: Tue, 14 Mar 2023 11:04:31 +0800 Subject: [PATCH 120/133] Update eventHubConsumerClient.spec.ts update loop times --- .../test/public/eventHubConsumerClient.spec.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts index 0fb696730a87..24e81fe79b21 100644 --- a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts +++ b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts @@ -276,9 +276,9 @@ testWithServiceTypes((serviceVersion) => { ); await loopUntil({ - maxTimes: 20, + maxTimes: 10, name: "Wait for subscription1 to recover", - timeBetweenRunsMs: 10000, + timeBetweenRunsMs: 5000, async until() { return !subscription1.isRunning && !subscription2!.isRunning; }, @@ -343,9 +343,9 @@ testWithServiceTypes((serviceVersion) => { }); await loopUntil({ - maxTimes: 10, + maxTimes: 20, name: "Wait for subscription1 to read from all partitions", - timeBetweenRunsMs: 1000, + timeBetweenRunsMs: 5000, async until() { // wait until we've seen processEvents invoked for each partition. return ( @@ -374,9 +374,9 @@ testWithServiceTypes((serviceVersion) => { }); await loopUntil({ - maxTimes: 10, + maxTimes: 20, name: "Wait for subscription2 to read from all partitions and subscription1 to invoke close handlers", - timeBetweenRunsMs: 1000, + timeBetweenRunsMs: 5000, async until() { const sub1CloseHandlersCalled = Boolean( partitionIds.filter((id) => { @@ -391,9 +391,9 @@ testWithServiceTypes((serviceVersion) => { await subscription2.close(); await loopUntil({ - maxTimes: 10, + maxTimes: 20, name: "Wait for subscription1 to recover", - timeBetweenRunsMs: 1000, + timeBetweenRunsMs: 5000, async until() { // wait until we've seen an additional processEvent for each partition. return ( From 24349555d2d07cfff773d64740843085ab4485d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenjie=20Yu=EF=BC=88MSFT=EF=BC=89?= <81678720+zedy-wj@users.noreply.github.com> Date: Tue, 14 Mar 2023 11:05:45 +0800 Subject: [PATCH 121/133] Update package.json run single test --- sdk/eventhub/event-hubs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/package.json b/sdk/eventhub/event-hubs/package.json index 1aa2f80ad117..a67d038c49a6 100644 --- a/sdk/eventhub/event-hubs/package.json +++ b/sdk/eventhub/event-hubs/package.json @@ -60,7 +60,7 @@ "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"", "generate-certs": "node ./scripts/generateCerts.js", "integration-test:browser": "cross-env TEST_TARGET=live DISABLE_MULTI_VERSION_TESTING=true karma start --single-run", - "integration-test:node": "cross-env TEST_TARGET=live DISABLE_MULTI_VERSION_TESTING=true nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 600000 --full-trace \"dist-esm/test/internal/*.spec.js\" \"dist-esm/test/public/*.spec.js\" \"dist-esm/test/public/**/*.spec.js\" \"dist-esm/test/internal/**/*.spec.js\"", + "integration-test:node": "cross-env TEST_TARGET=live DISABLE_MULTI_VERSION_TESTING=true nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 600000 --full-trace \"dist-esm/test/public/eventHubConsumerClient.spec.js\"", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint package.json api-extractor.json README.md src test --ext .ts,.javascript,.js --fix --fix-type [problem,suggestion]", "lint": "eslint package.json api-extractor.json README.md src test --ext .ts,.javascript,.js", From 01282895490ef50fc6147f80577eec22a93a3040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenjie=20Yu=EF=BC=88MSFT=EF=BC=89?= <81678720+zedy-wj@users.noreply.github.com> Date: Tue, 14 Mar 2023 13:37:04 +0800 Subject: [PATCH 122/133] Update package.json run all tests --- sdk/eventhub/event-hubs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventhub/event-hubs/package.json b/sdk/eventhub/event-hubs/package.json index a67d038c49a6..1aa2f80ad117 100644 --- a/sdk/eventhub/event-hubs/package.json +++ b/sdk/eventhub/event-hubs/package.json @@ -60,7 +60,7 @@ "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"", "generate-certs": "node ./scripts/generateCerts.js", "integration-test:browser": "cross-env TEST_TARGET=live DISABLE_MULTI_VERSION_TESTING=true karma start --single-run", - "integration-test:node": "cross-env TEST_TARGET=live DISABLE_MULTI_VERSION_TESTING=true nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 600000 --full-trace \"dist-esm/test/public/eventHubConsumerClient.spec.js\"", + "integration-test:node": "cross-env TEST_TARGET=live DISABLE_MULTI_VERSION_TESTING=true nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 600000 --full-trace \"dist-esm/test/internal/*.spec.js\" \"dist-esm/test/public/*.spec.js\" \"dist-esm/test/public/**/*.spec.js\" \"dist-esm/test/internal/**/*.spec.js\"", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint package.json api-extractor.json README.md src test --ext .ts,.javascript,.js --fix --fix-type [problem,suggestion]", "lint": "eslint package.json api-extractor.json README.md src test --ext .ts,.javascript,.js", From 6f2689bad03845c6ebdd4249bca817d4d2b90727 Mon Sep 17 00:00:00 2001 From: zedy Date: Wed, 26 Apr 2023 14:15:26 +0800 Subject: [PATCH 123/133] add cloud config --- sdk/formrecognizer/ai-form-recognizer/tests.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/formrecognizer/ai-form-recognizer/tests.yml b/sdk/formrecognizer/ai-form-recognizer/tests.yml index 99b9f77f3be8..ddd8fcfc6a7d 100644 --- a/sdk/formrecognizer/ai-form-recognizer/tests.yml +++ b/sdk/formrecognizer/ai-form-recognizer/tests.yml @@ -16,7 +16,17 @@ stages: PackageName: "@azure/ai-form-recognizer" ServiceDirectory: formrecognizer TimeoutInMinutes: 120 - SupportedClouds: 'Public,UsGov,China' + SupportedClouds: "Public,UsGov,China" + CloudConfig: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + Location: "${{ parameters.Location }}" + UsGov: + SubscriptionConfiguration: $(sub-config-gov-test-resources) + Location: "usgovvirginia" + China: + SubscriptionConfiguration: $(sub-config-cn-test-resources) + Location: "chinaeast2" EnvVars: AZURE_CLIENT_ID: $(FORMRECOGNIZER_CLIENT_ID) AZURE_TENANT_ID: $(FORMRECOGNIZER_TENANT_ID) From c971c7e108e363d737a4e9486e772ccd18aa2d99 Mon Sep 17 00:00:00 2001 From: zedy Date: Thu, 31 Aug 2023 14:18:33 +0800 Subject: [PATCH 124/133] fix some error --- sdk/formrecognizer/test-resources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/formrecognizer/test-resources.json b/sdk/formrecognizer/test-resources.json index 073cb4a7580f..5eb762840b97 100644 --- a/sdk/formrecognizer/test-resources.json +++ b/sdk/formrecognizer/test-resources.json @@ -11,7 +11,7 @@ }, "location": { "type": "string", - "defaultValue": "centralus", + "defaultValue": "[resourceGroup().location]", "metadata": { "description": "The location of the resource. By default, this is the same as the resource group." } @@ -85,7 +85,7 @@ "type": "Microsoft.CognitiveServices/accounts/providers/roleAssignments", "apiVersion": "2018-09-01-preview", "name": "[format('{0}/Microsoft.Authorization/{1}', parameters('baseName'), guid(parameters('baseName')))]", - "dependsOn": ["[resourceId('Microsoft.CognitiveServices/accounts', parameters('baseName'))]"], + "dependsOn": [ "[resourceId('Microsoft.CognitiveServices/accounts', parameters('baseName'))]" ], "properties": { "principalId": "[parameters('testApplicationOid')]", "roleDefinitionId": "[variables('frRoleId')]" From fb79927d69496b107dbd4de548439d1207ab5ba5 Mon Sep 17 00:00:00 2001 From: zedy Date: Mon, 25 Sep 2023 15:25:23 +0800 Subject: [PATCH 125/133] remove invalid changes --- .../test/public/eventHubConsumerClient.spec.ts | 6 +++--- sdk/keyvault/keyvault-admin/tests.yml | 18 +++--------------- .../test/public/CRUD.spec.ts | 7 ++----- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts index 684d2a9ed549..bb0943846cc4 100644 --- a/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts +++ b/sdk/eventhub/event-hubs/test/public/eventHubConsumerClient.spec.ts @@ -358,7 +358,7 @@ testWithServiceTypes((serviceVersion) => { }); await loopUntil({ - maxTimes: 20, + maxTimes: 10, name: "Wait for subscription1 to read from all partitions", timeBetweenRunsMs: 5000, async until() { @@ -389,7 +389,7 @@ testWithServiceTypes((serviceVersion) => { }); await loopUntil({ - maxTimes: 20, + maxTimes: 10, name: "Wait for subscription2 to read from all partitions and subscription1 to invoke close handlers", timeBetweenRunsMs: 5000, async until() { @@ -406,7 +406,7 @@ testWithServiceTypes((serviceVersion) => { await subscription2.close(); await loopUntil({ - maxTimes: 20, + maxTimes: 10, name: "Wait for subscription1 to recover", timeBetweenRunsMs: 5000, async until() { diff --git a/sdk/keyvault/keyvault-admin/tests.yml b/sdk/keyvault/keyvault-admin/tests.yml index 34173ee728d1..cfdaf083bf71 100644 --- a/sdk/keyvault/keyvault-admin/tests.yml +++ b/sdk/keyvault/keyvault-admin/tests.yml @@ -5,31 +5,19 @@ stages: parameters: PackageName: "@azure/keyvault-admin" ServiceDirectory: keyvault - SupportedClouds: 'Public,UsGov,China' - CloudConfig: - Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - Location: 'eastus2' - UsGov: - SubscriptionConfiguration: $(sub-config-gov-test-resources) - MatrixFilters: - - ArmTemplateParameters=^(?!.*enableHsm.*true) - China: - SubscriptionConfiguration: $(sub-config-cn-test-resources) - MatrixFilters: - - ArmTemplateParameters=^(?!.*enableHsm.*true) # KV HSM limitation prevents us from running live tests # against multiple platforms in parallel (we're limited to five # instances per region per subscription) so we're only running # live tests against a single instance. + Location: eastus2 MatrixConfigs: - Name: Keyvault_live_test_base Path: sdk/keyvault/keyvault-admin/platform-matrix.json Selection: sparse GenerateVMJobs: true - ${{ if not(contains(variables['Build.DefinitionName'], 'tests-weekly')) }}: - # Due to the high cost of Managed HSMs, which keyvault-admin requires, we only want to run + ? ${{ if not(contains(variables['Build.DefinitionName'], 'tests-weekly')) }} + : # Due to the high cost of Managed HSMs, which keyvault-admin requires, we only want to run # the live tests weekly. MatrixFilters: - ArmTemplateParameters=^(?!.*enableHsm.*true) diff --git a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts index 347e6e7dfd0c..1ac45a14dd32 100644 --- a/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts @@ -103,12 +103,11 @@ describe("Certificates client - create, read, update and delete", () => { this.retries(5); const certificateName = testClient.formatName(`${prefix}-${this!.test!.title}-${suffix}`); - const certificatePoller = await client.beginCreateCertificate( + await client.beginCreateCertificate( certificateName, basicCertificatePolicy, testPollerProperties ); - await certificatePoller.pollUntilDone(); await client.updateCertificateProperties(certificateName, "", { tags: { customTag: "value", @@ -295,14 +294,12 @@ describe("Certificates client - create, read, update and delete", () => { it("can delete a certificate", async function (this: Context) { this.retries(5); const certificateName = testClient.formatName(`${prefix}-${this!.test!.title}-${suffix}`); - const certificatePoller = await client.beginCreateCertificate( + await client.beginCreateCertificate( certificateName, basicCertificatePolicy, testPollerProperties ); - await certificatePoller.pollUntilDone(); const poller = await client.beginDeleteCertificate(certificateName, testPollerProperties); - await poller.pollUntilDone(); const result = poller.getResult()!; assert.equal(typeof result.recoveryId, "string"); From 438654797b3e9d346fea352030062aa1f05bd29b Mon Sep 17 00:00:00 2001 From: zedy Date: Mon, 25 Sep 2023 15:29:41 +0800 Subject: [PATCH 126/133] remove invalid changes --- .../event-hubs/test/internal/eventProcessor.spec.ts | 6 ++++-- sdk/keyvault/keyvault-admin/tests.yml | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts index 70aa50710e44..d56943cb332e 100644 --- a/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts +++ b/sdk/eventhub/event-hubs/test/internal/eventProcessor.spec.ts @@ -1661,7 +1661,8 @@ testWithServiceTypes((serviceVersion) => { const claimedPartitions = claimedPartitionsMap[eventProcessorId]; claimedPartitions.delete(partitionId); loggerForTest( - `[${(context as any).eventProcessorId}] processClose(${reason}) on partition ${context.partitionId + `[${(context as any).eventProcessorId}] processClose(${reason}) on partition ${ + context.partitionId }` ); if (reason === CloseReason.OwnershipLost && allPartitionsClaimed) { @@ -1825,7 +1826,8 @@ testWithServiceTypes((serviceVersion) => { const claimedPartitions = claimedPartitionsMap[eventProcessorId]; claimedPartitions.delete(partitionId); loggerForTest( - `[${(context as any).eventProcessorId}] processClose(${reason}) on partition ${context.partitionId + `[${(context as any).eventProcessorId}] processClose(${reason}) on partition ${ + context.partitionId }` ); if (reason === CloseReason.OwnershipLost && allPartitionsClaimed) { diff --git a/sdk/keyvault/keyvault-admin/tests.yml b/sdk/keyvault/keyvault-admin/tests.yml index cfdaf083bf71..40d752f767a8 100644 --- a/sdk/keyvault/keyvault-admin/tests.yml +++ b/sdk/keyvault/keyvault-admin/tests.yml @@ -16,12 +16,12 @@ stages: Selection: sparse GenerateVMJobs: true - ? ${{ if not(contains(variables['Build.DefinitionName'], 'tests-weekly')) }} - : # Due to the high cost of Managed HSMs, which keyvault-admin requires, we only want to run + ${{ if not(contains(variables['Build.DefinitionName'], 'tests-weekly')) }}: + # Due to the high cost of Managed HSMs, which keyvault-admin requires, we only want to run # the live tests weekly. MatrixFilters: - ArmTemplateParameters=^(?!.*enableHsm.*true) EnvVars: - AZURE_CLIENT_ID: $(KEYVAULT_CLIENT_ID) - AZURE_TENANT_ID: $(KEYVAULT_TENANT_ID) - AZURE_CLIENT_SECRET: $(KEYVAULT_CLIENT_SECRET) + AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) + AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) + AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) From c21c9ba043d0fc247f274e7215f4daf75c4e4c5e Mon Sep 17 00:00:00 2001 From: zedy Date: Fri, 2 Aug 2024 10:19:28 +0800 Subject: [PATCH 127/133] change auth model so remove some envVars --- sdk/formrecognizer/ai-form-recognizer/tests.yml | 4 ---- sdk/textanalytics/ai-text-analytics/tests.yml | 3 --- 2 files changed, 7 deletions(-) diff --git a/sdk/formrecognizer/ai-form-recognizer/tests.yml b/sdk/formrecognizer/ai-form-recognizer/tests.yml index 56832587ed9a..92ab8bb1bea4 100644 --- a/sdk/formrecognizer/ai-form-recognizer/tests.yml +++ b/sdk/formrecognizer/ai-form-recognizer/tests.yml @@ -27,7 +27,3 @@ extends: China: SubscriptionConfiguration: $(sub-config-cn-test-resources) Location: "chinaeast2" - EnvVars: - AZURE_CLIENT_ID: $(FORMRECOGNIZER_CLIENT_ID) - AZURE_TENANT_ID: $(FORMRECOGNIZER_TENANT_ID) - AZURE_CLIENT_SECRET: $(FORMRECOGNIZER_CLIENT_SECRET) diff --git a/sdk/textanalytics/ai-text-analytics/tests.yml b/sdk/textanalytics/ai-text-analytics/tests.yml index b554eace7592..c734234ec443 100644 --- a/sdk/textanalytics/ai-text-analytics/tests.yml +++ b/sdk/textanalytics/ai-text-analytics/tests.yml @@ -8,9 +8,6 @@ extends: TimeoutInMinutes: 60 SupportedClouds: 'Public,UsGov,China' EnvVars: - AZURE_CLIENT_ID: $(TEXTANALYTICS_CLIENT_ID) - AZURE_TENANT_ID: $(TEXTANALYTICS_TENANT_ID) - AZURE_CLIENT_SECRET: $(TEXTANALYTICS_CLIENT_SECRET) ENDPOINT: $(js-textanalytics-test-service-endpoint) LANGUAGE_API_KEY: $(js-textanalytics-api-key-new) LANGUAGE_API_KEY_ALT: $(js-textanalytics-api-key-alt) From 86431ae7cb23a362c730d608c69244d5c407bb73 Mon Sep 17 00:00:00 2001 From: zedy Date: Mon, 5 Aug 2024 14:14:04 +0800 Subject: [PATCH 128/133] update yml of formrecognizer --- sdk/formrecognizer/ai-form-recognizer/tests.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sdk/formrecognizer/ai-form-recognizer/tests.yml b/sdk/formrecognizer/ai-form-recognizer/tests.yml index 92ab8bb1bea4..d5aeb6a40418 100644 --- a/sdk/formrecognizer/ai-form-recognizer/tests.yml +++ b/sdk/formrecognizer/ai-form-recognizer/tests.yml @@ -19,11 +19,17 @@ extends: SupportedClouds: "Public,UsGov,China" CloudConfig: Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + ServiceConnection: azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzurePublicMsft.json Location: "${{ parameters.Location }}" UsGov: - SubscriptionConfiguration: $(sub-config-gov-test-resources) + ServiceConnection: usgov_azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzureUsGovMsft.json Location: "usgovvirginia" China: - SubscriptionConfiguration: $(sub-config-cn-test-resources) + ServiceConnection: china_azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzureChinaMsft.json Location: "chinaeast2" From 9ea20ffa225b33c99c7ae44bfb6a92d414490cd5 Mon Sep 17 00:00:00 2001 From: zedy Date: Tue, 6 Aug 2024 11:10:53 +0800 Subject: [PATCH 129/133] update js text --- sdk/textanalytics/ai-text-analytics/tests.yml | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/sdk/textanalytics/ai-text-analytics/tests.yml b/sdk/textanalytics/ai-text-analytics/tests.yml index c734234ec443..5c7032fb1775 100644 --- a/sdk/textanalytics/ai-text-analytics/tests.yml +++ b/sdk/textanalytics/ai-text-analytics/tests.yml @@ -7,13 +7,19 @@ extends: ServiceDirectory: textanalytics TimeoutInMinutes: 60 SupportedClouds: 'Public,UsGov,China' - EnvVars: - ENDPOINT: $(js-textanalytics-test-service-endpoint) - LANGUAGE_API_KEY: $(js-textanalytics-api-key-new) - LANGUAGE_API_KEY_ALT: $(js-textanalytics-api-key-alt) - LANGUAGE_CUSTOM_ENTITY_RECOGNITION_PROJECT_NAME: $(js-recognize-custom-entities-project-name) - LANGUAGE_CUSTOM_ENTITY_RECOGNITION_DEPLOYMENT_NAME: $(js-recognize-custom-entities-deployment-name) - LANGUAGE_CUSTOM_SINGLE_LABEL_CLASSIFICATION_PROJECT_NAME: $(js-single-category-classify-project-name) - LANGUAGE_CUSTOM_SINGLE_LABEL_CLASSIFICATION_DEPLOYMENT_NAME: $(js-single-category-classify-deployment-name) - LANGUAGE_CUSTOM_MULTI_LABEL_CLASSIFICATION_PROJECT_NAME: $(js-multi-category-classify-project-name) - LANGUAGE_CUSTOM_MULTI_LABEL_CLASSIFICATION_DEPLOYMENT_NAME: $(js-multi-category-classify-deployment-name) + CloudConfig: + Public: + ServiceConnection: azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzurePublicMsft.json + Location: "${{ parameters.Location }}" + UsGov: + ServiceConnection: usgov_azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzureUsGovMsft.json + Location: "usgovvirginia" + China: + ServiceConnection: china_azure-sdk-tests + SubscriptionConfigurationFilePaths: + - eng/common/TestResources/sub-config/AzureChinaMsft.json + Location: "chinaeast2" From 1ea2eeafd68b7c0146fd9c5e62466bd7ea9fdd48 Mon Sep 17 00:00:00 2001 From: zedy Date: Tue, 6 Aug 2024 11:14:29 +0800 Subject: [PATCH 130/133] update js text default location --- sdk/textanalytics/ai-text-analytics/tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/textanalytics/ai-text-analytics/tests.yml b/sdk/textanalytics/ai-text-analytics/tests.yml index 5c7032fb1775..a22f876ef93a 100644 --- a/sdk/textanalytics/ai-text-analytics/tests.yml +++ b/sdk/textanalytics/ai-text-analytics/tests.yml @@ -1,3 +1,9 @@ +parameters: + - name: Location + displayName: Location + type: string + default: centralus + trigger: none extends: From 30a2a18b0f6e264c989d20940a33c63630c5c809 Mon Sep 17 00:00:00 2001 From: zedy Date: Thu, 29 Aug 2024 09:53:48 +0800 Subject: [PATCH 131/133] restore resource file --- sdk/formrecognizer/test-resources.bicep | 65 +++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sdk/formrecognizer/test-resources.bicep diff --git a/sdk/formrecognizer/test-resources.bicep b/sdk/formrecognizer/test-resources.bicep new file mode 100644 index 000000000000..1f99d323666d --- /dev/null +++ b/sdk/formrecognizer/test-resources.bicep @@ -0,0 +1,65 @@ +param baseName string = resourceGroup().name +param location string = resourceGroup().location +param testApplicationOid string +param blobStorageAccount string = 'azuresdktrainingdata' +param trainingDataContainer string = 'trainingdata-v3' +param selectionMarkTrainingDataContainer string = 'selectionmark-v3' +param blobResourceId string = resourceId('2cd617ea-1866-46b1-90e3-fffb087ebf9b', 'TrainingData', 'Microsoft.Storage/storageAccounts', blobStorageAccount) +param trainingDataSasProperties object = { + canonicalizedResource: '/blob/${blobStorageAccount}/${trainingDataContainer}' + signedExpiry: dateTimeAdd(utcNow('u'), 'PT2H') + signedPermission: 'rl' + signedResource: 'c' +} +param selectionMarkTrainingDataSasProperties object = { + canonicalizedResource: '/blob/${blobStorageAccount}/${selectionMarkTrainingDataContainer}' + signedExpiry: dateTimeAdd(utcNow('u'), 'PT2H') + signedPermission: 'rl' + signedResource: 'c' +} +param testingDataContainer string = 'testingdata' +param testingDataSasProperties object = { + canonicalizedResource: '/blob/${blobStorageAccount}/${testingDataContainer}' + signedExpiry: dateTimeAdd(utcNow('u'), 'PT2H') + signedPermission: 'rl' + signedResource: 'c' +} + +var frRoleId = 'a97b65f3-24c7-4388-baec-2e87135dc908' +var apiVersion = '2024-04-01-preview' +var storageApiVersion = '2023-05-01' + +// Create Cognitive Services Account for Form Recognizer +resource cognitiveServicesAccount 'Microsoft.CognitiveServices/accounts@2024-04-01-preview' = { + name: baseName + location: location + sku: { + name: 'S0' + } + kind: 'FormRecognizer' + properties: { + customSubDomainName: baseName + publicNetworkAccess: 'Enabled' + } +} + +// Assign Role to the Test Application +resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid(frRoleId, baseName) + properties: { + roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', frRoleId) + principalId: testApplicationOid + } + dependsOn: [ + cognitiveServicesAccount + ] +} + +// Outputs +output FORM_RECOGNIZER_ENDPOINT string = cognitiveServicesAccount.properties.endpoint +output FORM_RECOGNIZER_API_KEY string = listKeys(cognitiveServicesAccount.id, apiVersion).key1 +output FORM_RECOGNIZER_TRAINING_CONTAINER_SAS_URL string = '${reference(blobResourceId, storageApiVersion).primaryEndpoints.blob}${trainingDataContainer}?${listServiceSas(blobResourceId, storageApiVersion, trainingDataSasProperties).serviceSasToken}' +output FORM_RECOGNIZER_TESTING_CONTAINER_SAS_URL string = '${reference(blobResourceId, storageApiVersion).primaryEndpoints.blob}${testingDataContainer}?${listServiceSas(blobResourceId, storageApiVersion, testingDataSasProperties).serviceSasToken}' +output FORM_RECOGNIZER_SELECTION_MARK_STORAGE_CONTAINER_SAS_URL string = '${reference(blobResourceId, storageApiVersion).primaryEndpoints.blob}${selectionMarkTrainingDataContainer}?${listServiceSas(blobResourceId, storageApiVersion, selectionMarkTrainingDataSasProperties).serviceSasToken}' +output FORM_RECOGNIZER_TARGET_RESOURCE_REGION string = location +output FORM_RECOGNIZER_TARGET_RESOURCE_ID string = cognitiveServicesAccount.id From bdf1b40e4939e47b23b00f20c95501b0e3a60823 Mon Sep 17 00:00:00 2001 From: zedy Date: Thu, 29 Aug 2024 16:27:50 +0800 Subject: [PATCH 132/133] update --- sdk/formrecognizer/test-resources.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/formrecognizer/test-resources.bicep b/sdk/formrecognizer/test-resources.bicep index 1f99d323666d..b066d276078c 100644 --- a/sdk/formrecognizer/test-resources.bicep +++ b/sdk/formrecognizer/test-resources.bicep @@ -4,7 +4,7 @@ param testApplicationOid string param blobStorageAccount string = 'azuresdktrainingdata' param trainingDataContainer string = 'trainingdata-v3' param selectionMarkTrainingDataContainer string = 'selectionmark-v3' -param blobResourceId string = resourceId('2cd617ea-1866-46b1-90e3-fffb087ebf9b', 'TrainingData', 'Microsoft.Storage/storageAccounts', blobStorageAccount) +param blobResourceId string = resourceId('TrainingData', 'Microsoft.Storage/storageAccounts', blobStorageAccount) param trainingDataSasProperties object = { canonicalizedResource: '/blob/${blobStorageAccount}/${trainingDataContainer}' signedExpiry: dateTimeAdd(utcNow('u'), 'PT2H') From 6c84800e8964ee9d0c71a0e323086aa7e62b0a8c Mon Sep 17 00:00:00 2001 From: zedy Date: Mon, 4 Nov 2024 11:01:23 +0800 Subject: [PATCH 133/133] fix pipeline fail --- sdk/formrecognizer/ai-form-recognizer/tests.yml | 9 --------- sdk/textanalytics/ai-text-analytics/tests.yml | 9 --------- 2 files changed, 18 deletions(-) diff --git a/sdk/formrecognizer/ai-form-recognizer/tests.yml b/sdk/formrecognizer/ai-form-recognizer/tests.yml index d5aeb6a40418..a679daea2b24 100644 --- a/sdk/formrecognizer/ai-form-recognizer/tests.yml +++ b/sdk/formrecognizer/ai-form-recognizer/tests.yml @@ -19,17 +19,8 @@ extends: SupportedClouds: "Public,UsGov,China" CloudConfig: Public: - ServiceConnection: azure-sdk-tests - SubscriptionConfigurationFilePaths: - - eng/common/TestResources/sub-config/AzurePublicMsft.json Location: "${{ parameters.Location }}" UsGov: - ServiceConnection: usgov_azure-sdk-tests - SubscriptionConfigurationFilePaths: - - eng/common/TestResources/sub-config/AzureUsGovMsft.json Location: "usgovvirginia" China: - ServiceConnection: china_azure-sdk-tests - SubscriptionConfigurationFilePaths: - - eng/common/TestResources/sub-config/AzureChinaMsft.json Location: "chinaeast2" diff --git a/sdk/textanalytics/ai-text-analytics/tests.yml b/sdk/textanalytics/ai-text-analytics/tests.yml index a22f876ef93a..4948920fe86d 100644 --- a/sdk/textanalytics/ai-text-analytics/tests.yml +++ b/sdk/textanalytics/ai-text-analytics/tests.yml @@ -15,17 +15,8 @@ extends: SupportedClouds: 'Public,UsGov,China' CloudConfig: Public: - ServiceConnection: azure-sdk-tests - SubscriptionConfigurationFilePaths: - - eng/common/TestResources/sub-config/AzurePublicMsft.json Location: "${{ parameters.Location }}" UsGov: - ServiceConnection: usgov_azure-sdk-tests - SubscriptionConfigurationFilePaths: - - eng/common/TestResources/sub-config/AzureUsGovMsft.json Location: "usgovvirginia" China: - ServiceConnection: china_azure-sdk-tests - SubscriptionConfigurationFilePaths: - - eng/common/TestResources/sub-config/AzureChinaMsft.json Location: "chinaeast2"