diff --git a/sdk/keyvault/keyvault-admin/test/utils/authentication.ts b/sdk/keyvault/keyvault-admin/test/utils/authentication.ts index e39267f8646a..cbbc4d981e20 100644 --- a/sdk/keyvault/keyvault-admin/test/utils/authentication.ts +++ b/sdk/keyvault/keyvault-admin/test/utils/authentication.ts @@ -26,7 +26,7 @@ export async function authenticate(that: any): Promise { AZURE_CLIENT_ID: "azure_client_id", AZURE_CLIENT_SECRET: "azure_client_secret", AZURE_TENANT_ID: "azure_tenant_id", - KEYVAULT_URI: "https://uri.keyvault.azure.net", + KEYVAULT_URI: "https://keyvault_name.vault.azure.net", BLOB_CONTAINER_NAME: "uri", BLOB_STORAGE_ACCOUNT_NAME: "blob_storage_account_name", BLOB_STORAGE_SAS_TOKEN: "blob_storage_sas_token", diff --git a/sdk/keyvault/keyvault-certificates/karma.conf.js b/sdk/keyvault/keyvault-certificates/karma.conf.js index 105085fe393b..4713581df0d8 100644 --- a/sdk/keyvault/keyvault-certificates/karma.conf.js +++ b/sdk/keyvault/keyvault-certificates/karma.conf.js @@ -49,6 +49,7 @@ module.exports = function(config) { "AZURE_CLIENT_SECRET", "AZURE_TENANT_ID", "KEYVAULT_NAME", + "KEYVAULT_URI", "TEST_MODE" ], diff --git a/sdk/keyvault/keyvault-certificates/test/utils/testAuthentication.ts b/sdk/keyvault/keyvault-certificates/test/utils/testAuthentication.ts index 3b5227847c1f..12325c1e807c 100644 --- a/sdk/keyvault/keyvault-certificates/test/utils/testAuthentication.ts +++ b/sdk/keyvault/keyvault-certificates/test/utils/testAuthentication.ts @@ -15,7 +15,8 @@ export async function authenticate(that: Context): Promise { AZURE_CLIENT_ID: "azure_client_id", AZURE_CLIENT_SECRET: "azure_client_secret", AZURE_TENANT_ID: "azure_tenant_id", - KEYVAULT_NAME: "keyvault_name" + KEYVAULT_NAME: "keyvault_name", + KEYVAULT_URI: "https://keyvault_name.vault.azure.net" }, customizationsOnRecordings: [ (recording: any): any => diff --git a/sdk/keyvault/keyvault-keys/karma.conf.js b/sdk/keyvault/keyvault-keys/karma.conf.js index 287a194c79c5..eb03a2d993ea 100644 --- a/sdk/keyvault/keyvault-keys/karma.conf.js +++ b/sdk/keyvault/keyvault-keys/karma.conf.js @@ -49,6 +49,7 @@ module.exports = function(config) { "AZURE_CLIENT_SECRET", "AZURE_TENANT_ID", "KEYVAULT_NAME", + "KEYVAULT_URI", "TEST_MODE" ], diff --git a/sdk/keyvault/keyvault-keys/test/public/list.spec.ts b/sdk/keyvault/keyvault-keys/test/public/list.spec.ts index 08c39ab8c162..4fc6c6172a52 100644 --- a/sdk/keyvault/keyvault-keys/test/public/list.spec.ts +++ b/sdk/keyvault/keyvault-keys/test/public/list.spec.ts @@ -20,7 +20,7 @@ versionsToTest(serviceApiVersions, {}, (serviceVersion, onVersions) => { let testClient: TestClient; let recorder: Recorder; - beforeEach(async function () { + beforeEach(async function() { const authentication = await authenticate(this, serviceVersion); keySuffix = authentication.keySuffix; client = authentication.client; @@ -28,7 +28,7 @@ versionsToTest(serviceApiVersions, {}, (serviceVersion, onVersions) => { recorder = authentication.recorder; }); - afterEach(async function () { + afterEach(async function() { await recorder.stop(); }); @@ -37,8 +37,8 @@ versionsToTest(serviceApiVersions, {}, (serviceVersion, onVersions) => { // Use this while recording to make sure the target keyvault is clean. // The next tests will produce a more consistent output. // This test is only useful while developing locally. - it("can purge all keys", async function (): Promise { - // WARNING: When TEST_MODE equals "record", all of the keys in the indicated KEYVAULT_NAME will be deleted as part of this test. + it("can purge all keys", async function(): Promise { + // WARNING: When TEST_MODE equals "record", all of the keys in the indicated KEYVAULT_URI will be deleted as part of this test. if (!isRecordMode()) { return this.skip(); } @@ -58,7 +58,7 @@ versionsToTest(serviceApiVersions, {}, (serviceVersion, onVersions) => { } }); - it("can get the versions of a key", async function () { + it("can get the versions of a key", async function() { const keyName = testClient.formatName(`${keyPrefix}-${this!.test!.title}-${keySuffix}`); await client.createKey(keyName, "RSA"); let totalVersions = 0; @@ -75,7 +75,7 @@ versionsToTest(serviceApiVersions, {}, (serviceVersion, onVersions) => { }); // On playback mode, the tests happen too fast for the timeout to work - it("can get the versions of a key with requestOptions timeout", async function () { + it("can get the versions of a key with requestOptions timeout", async function() { recorder.skip(undefined, "Timeout tests don't work on playback mode."); const iter = client.listPropertiesOfKeyVersions("doesntmatter", { requestOptions: { timeout: 1 } @@ -85,7 +85,7 @@ versionsToTest(serviceApiVersions, {}, (serviceVersion, onVersions) => { }); }); - it("can get the versions of a key (paged)", async function () { + it("can get the versions of a key (paged)", async function() { const keyName = testClient.formatName(`${keyPrefix}-${this!.test!.title}-${keySuffix}`); await client.createKey(keyName, "RSA"); let totalVersions = 0; @@ -103,7 +103,7 @@ versionsToTest(serviceApiVersions, {}, (serviceVersion, onVersions) => { await testClient.flushKey(keyName); }); - it("list 0 versions of a non-existing key", async function () { + it("list 0 versions of a non-existing key", async function() { const keyName = testClient.formatName(`${keyPrefix}-${this!.test!.title}-${keySuffix}`); let totalVersions = 0; for await (const version of client.listPropertiesOfKeyVersions(keyName)) { @@ -117,7 +117,7 @@ versionsToTest(serviceApiVersions, {}, (serviceVersion, onVersions) => { assert.equal(totalVersions, 0, `Unexpected total versions for key ${keyName}`); }); - it("list 0 versions of a non-existing key (paged)", async function () { + it("list 0 versions of a non-existing key (paged)", async function() { const keyName = testClient.formatName(`${keyPrefix}-${this!.test!.title}-${keySuffix}`); let totalVersions = 0; for await (const page of client.listPropertiesOfKeyVersions(keyName).byPage()) { @@ -133,7 +133,7 @@ versionsToTest(serviceApiVersions, {}, (serviceVersion, onVersions) => { assert.equal(totalVersions, 0, `Unexpected total versions for key ${keyName}`); }); - it("can get several inserted keys", async function () { + it("can get several inserted keys", async function() { const keyName = testClient.formatName(`${keyPrefix}-${this!.test!.title}-${keySuffix}`); const keyNames = [`${keyName}-0`, `${keyName}-1`]; for (const name of keyNames) { @@ -155,7 +155,7 @@ versionsToTest(serviceApiVersions, {}, (serviceVersion, onVersions) => { }); // On playback mode, the tests happen too fast for the timeout to work - it("can get several inserted keys with requestOptions timeout", async function () { + it("can get several inserted keys with requestOptions timeout", async function() { recorder.skip(undefined, "Timeout tests don't work on playback mode."); const iter = client.listPropertiesOfKeys({ requestOptions: { timeout: 1 } }); @@ -164,7 +164,7 @@ versionsToTest(serviceApiVersions, {}, (serviceVersion, onVersions) => { }); }); - it("can get several inserted keys (paged)", async function () { + it("can get several inserted keys (paged)", async function() { const keyName = testClient.formatName(`${keyPrefix}-${this!.test!.title}-${keySuffix}`); const keyNames = [`${keyName}-0`, `${keyName}-1`]; for (const name of keyNames) { @@ -187,7 +187,7 @@ versionsToTest(serviceApiVersions, {}, (serviceVersion, onVersions) => { } }); - it("list deleted keys", async function () { + it("list deleted keys", async function() { const keyName = testClient.formatName(`${keyPrefix}-${this!.test!.title}-${keySuffix}`); const keyNames = [`${keyName}-0`, `${keyName}-1`]; for (const name of keyNames) { @@ -213,7 +213,7 @@ versionsToTest(serviceApiVersions, {}, (serviceVersion, onVersions) => { }); // On playback mode, the tests happen too fast for the timeout to work - it("list deleted keys with requestOptions timeout", async function () { + it("list deleted keys with requestOptions timeout", async function() { recorder.skip(undefined, "Timeout tests don't work on playback mode."); const iter = client.listDeletedKeys({ requestOptions: { timeout: 1 } }); await assertThrowsAbortError(async () => { @@ -221,7 +221,7 @@ versionsToTest(serviceApiVersions, {}, (serviceVersion, onVersions) => { }); }); - it("list deleted keys (paged)", async function () { + it("list deleted keys (paged)", async function() { const keyName = testClient.formatName(`${keyPrefix}-${this!.test!.title}-${keySuffix}`); const keyNames = [`${keyName}-0`, `${keyName}-1`]; for (const name of keyNames) { diff --git a/sdk/keyvault/keyvault-keys/test/utils/testAuthentication.ts b/sdk/keyvault/keyvault-keys/test/utils/testAuthentication.ts index e7c6ece9c2dc..d276e5ab353a 100644 --- a/sdk/keyvault/keyvault-keys/test/utils/testAuthentication.ts +++ b/sdk/keyvault/keyvault-keys/test/utils/testAuthentication.ts @@ -17,7 +17,8 @@ export async function authenticate(that: Context, version?: string): Promise @@ -28,7 +29,7 @@ export async function authenticate(that: Context, version?: string): Promise { // The next tests will produce a more consistent output. // This test is only useful while developing locally. it("can purge all secrets", async function(): Promise { - // WARNING: When TEST_MODE equals "record", all of the secrets in the indicated KEYVAULT_NAME will be deleted as part of this test. + // 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/utils/testAuthentication.ts b/sdk/keyvault/keyvault-secrets/test/utils/testAuthentication.ts index 04649ebe775f..d5f577f7a247 100644 --- a/sdk/keyvault/keyvault-secrets/test/utils/testAuthentication.ts +++ b/sdk/keyvault/keyvault-secrets/test/utils/testAuthentication.ts @@ -15,7 +15,8 @@ export async function authenticate(that: Context): Promise { AZURE_CLIENT_ID: "azure_client_id", AZURE_CLIENT_SECRET: "azure_client_secret", AZURE_TENANT_ID: "azure_tenant_id", - KEYVAULT_NAME: "keyvault_name" + KEYVAULT_NAME: "keyvault_name", + KEYVAULT_URI: "https://keyvault_name.vault.azure.net" }, customizationsOnRecordings: [ (recording: any): any =>