Skip to content

Commit 93ee7db

Browse files
authored
[KeyVault] - Enable multi-version tests for KV certificates (Azure#19923)
Added support for multi-version testing for keyvault-certificates Resolved Azure#17890
1 parent 08cb50f commit 93ee7db

14 files changed

+80
-12
lines changed

sdk/keyvault/keyvault-certificates/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"clean": "rimraf dist-esm dist-test types *.tgz *.log samples/typescript/dist",
5151
"execute:samples": "dev-tool samples run samples-dev",
5252
"extract-api": "tsc -p . && api-extractor run --local",
53-
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"samples/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
53+
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"samples-dev/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
5454
"generate:client": "autorest --typescript swagger/README.md",
5555
"integration-test:browser": "karma start --single-run",
5656
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 350000 --full-trace \"dist-esm/**/*.spec.js\"",
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"include": [
3+
{
4+
"Agent": {
5+
"ubuntu-20.04": {
6+
"OSVmImage": "MMSUbuntu20.04",
7+
"Pool": "azsdk-pool-mms-ubuntu-2004-general"
8+
}
9+
},
10+
"TestType": "node",
11+
"NodeTestVersion": "16.x",
12+
"ServiceVersion": ["7.0", "7.1", "7.2"]
13+
}
14+
],
15+
"displayNames": {
16+
"7.0": "service_version_7_0",
17+
"7.1": "service_version_7_1",
18+
"7.2": "service_version_7_2"
19+
}
20+
}

sdk/keyvault/keyvault-certificates/test/internal/challengeBasedAuthenticationPolicy.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { assert } from "chai";
55
import { Context } from "mocha";
66
import { createSandbox } from "sinon";
77
import { env, Recorder } from "@azure-tools/test-recorder";
8+
import { getServiceVersion } from "../utils/utils.common";
89

910
import {
1011
AuthenticationChallengeCache,
@@ -37,7 +38,7 @@ describe("Challenge based authentication tests", () => {
3738
};
3839

3940
beforeEach(async function (this: Context) {
40-
const authentication = await authenticate(this);
41+
const authentication = await authenticate(this, getServiceVersion());
4142
certificateSuffix = authentication.suffix;
4243
client = authentication.client;
4344
testClient = authentication.testClient;

sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { CertificateClient } from "../../src";
1818
import { assertThrowsAbortError } from "../utils/utils.common";
1919
import { testPollerProperties } from "../utils/recorderUtils";
2020
import { authenticate } from "../utils/testAuthentication";
21+
import { getServiceVersion } from "../utils/utils.common";
2122
import TestClient from "../utils/testClient";
2223

2324
describe("Certificates client - create, read, update and delete", () => {
@@ -36,7 +37,7 @@ describe("Certificates client - create, read, update and delete", () => {
3637
};
3738

3839
beforeEach(async function (this: Context) {
39-
const authentication = await authenticate(this);
40+
const authentication = await authenticate(this, getServiceVersion());
4041
suffix = authentication.suffix;
4142
client = authentication.client;
4243
testClient = authentication.testClient;

sdk/keyvault/keyvault-certificates/test/public/list.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { CertificateClient } from "../../src";
1111
import { assertThrowsAbortError } from "../utils/utils.common";
1212
import { testPollerProperties } from "../utils/recorderUtils";
1313
import { authenticate } from "../utils/testAuthentication";
14+
import { getServiceVersion } from "../utils/utils.common";
1415
import TestClient from "../utils/testClient";
1516

1617
const { expect } = chai;
@@ -28,7 +29,7 @@ describe("Certificates client - list certificates in various ways", () => {
2829
};
2930

3031
beforeEach(async function (this: Context) {
31-
const authentication = await authenticate(this);
32+
const authentication = await authenticate(this, getServiceVersion());
3233
suffix = authentication.suffix;
3334
client = authentication.client;
3435
testClient = authentication.testClient;

sdk/keyvault/keyvault-certificates/test/public/lro.create.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { env, Recorder } from "@azure-tools/test-recorder";
99
import { CertificateClient, KeyVaultCertificate, DefaultCertificatePolicy } from "../../src";
1010
import { testPollerProperties } from "../utils/recorderUtils";
1111
import { authenticate } from "../utils/testAuthentication";
12+
import { getServiceVersion } from "../utils/utils.common";
1213
import TestClient from "../utils/testClient";
1314

1415
describe("Certificates client - LRO - create", () => {
@@ -19,7 +20,7 @@ describe("Certificates client - LRO - create", () => {
1920
let recorder: Recorder;
2021

2122
beforeEach(async function (this: Context) {
22-
const authentication = await authenticate(this);
23+
const authentication = await authenticate(this, getServiceVersion());
2324
certificateSuffix = authentication.suffix;
2425
client = authentication.client;
2526
testClient = authentication.testClient;

sdk/keyvault/keyvault-certificates/test/public/lro.delete.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { env, Recorder } from "@azure-tools/test-recorder";
99
import { CertificateClient, DeletedCertificate, DefaultCertificatePolicy } from "../../src";
1010
import { testPollerProperties } from "../utils/recorderUtils";
1111
import { authenticate } from "../utils/testAuthentication";
12+
import { getServiceVersion } from "../utils/utils.common";
1213
import TestClient from "../utils/testClient";
1314

1415
describe("Certificates client - lro - delete", () => {
@@ -19,7 +20,7 @@ describe("Certificates client - lro - delete", () => {
1920
let recorder: Recorder;
2021

2122
beforeEach(async function (this: Context) {
22-
const authentication = await authenticate(this);
23+
const authentication = await authenticate(this, getServiceVersion());
2324
certificateSuffix = authentication.suffix;
2425
client = authentication.client;
2526
testClient = authentication.testClient;

sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
} from "../../src";
1414
import { testPollerProperties } from "../utils/recorderUtils";
1515
import { authenticate } from "../utils/testAuthentication";
16+
import { getServiceVersion } from "../utils/utils.common";
1617
import TestClient from "../utils/testClient";
1718

1819
describe("Certificates client - LRO - certificate operation", () => {
@@ -23,7 +24,7 @@ describe("Certificates client - LRO - certificate operation", () => {
2324
let recorder: Recorder;
2425

2526
beforeEach(async function (this: Context) {
26-
const authentication = await authenticate(this);
27+
const authentication = await authenticate(this, getServiceVersion());
2728
certificateSuffix = authentication.suffix;
2829
client = authentication.client;
2930
testClient = authentication.testClient;

sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { CertificateClient, DeletedCertificate, DefaultCertificatePolicy } from
1010
import { assertThrowsAbortError } from "../utils/utils.common";
1111
import { testPollerProperties } from "../utils/recorderUtils";
1212
import { authenticate } from "../utils/testAuthentication";
13+
import { getServiceVersion } from "../utils/utils.common";
1314
import TestClient from "../utils/testClient";
1415

1516
describe("Certificates client - LRO - recoverDelete", () => {
@@ -20,7 +21,7 @@ describe("Certificates client - LRO - recoverDelete", () => {
2021
let recorder: Recorder;
2122

2223
beforeEach(async function (this: Context) {
23-
const authentication = await authenticate(this);
24+
const authentication = await authenticate(this, getServiceVersion());
2425
certificateSuffix = authentication.suffix;
2526
client = authentication.client;
2627
testClient = authentication.testClient;

sdk/keyvault/keyvault-certificates/test/public/mergeAndImport.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { CertificateClient } from "../../src";
1313
import { base64ToUint8Array, stringToUint8Array } from "../../src/utils";
1414
import { testPollerProperties } from "../utils/recorderUtils";
1515
import { authenticate } from "../utils/testAuthentication";
16+
import { getServiceVersion } from "../utils/utils.common";
1617
import TestClient from "../utils/testClient";
1718

1819
describe("Certificates client - merge and import certificates", () => {
@@ -26,7 +27,7 @@ describe("Certificates client - merge and import certificates", () => {
2627
let secretClient: SecretClient;
2728

2829
beforeEach(async function (this: Context) {
29-
const authentication = await authenticate(this);
30+
const authentication = await authenticate(this, getServiceVersion());
3031
suffix = authentication.suffix;
3132
client = authentication.client;
3233
testClient = authentication.testClient;

0 commit comments

Comments
 (0)