From 25e1b4a6eb47069c8d3bceae1daa1bd704e1c39f Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Wed, 17 Jun 2020 21:11:07 +0000 Subject: [PATCH 1/6] [Key Vault] Separating public and internal folders --- sdk/keyvault/keyvault-certificates/package.json | 4 ++-- .../keyvault-certificates/rollup.base.config.js | 4 ++-- .../challengeBasedAuthenticationPolicy.spc.ts} | 13 +++++++------ .../userAgent.spec.ts} | 6 +++--- .../test/{CRUD.test.ts => public/CRUD.spec.ts} | 11 ++++++----- .../test/{list.test.ts => public/list.spec.ts} | 14 ++++++++------ .../lro.create.spec.ts} | 11 ++++++----- .../lro.delete.spec.ts} | 11 ++++++----- .../lro.operation.spec.ts} | 11 ++++++----- .../lro.recover.spec.ts} | 11 ++++++----- .../mergeAndImport.spec.ts} | 13 +++++++------ .../recoverBackupRestore.spec.ts} | 11 ++++++----- sdk/keyvault/keyvault-keys/package.json | 4 ++-- sdk/keyvault/keyvault-keys/rollup.base.config.js | 4 ++-- .../challengeBasedAuthenticationPolicy.spec.ts} | 11 ++++++----- .../userAgent.spec.ts} | 6 +++--- .../test/{CRUD.test.ts => public/CRUD.spec.ts} | 13 +++++++------ .../test/{crypto.test.ts => public/crypto.spec.ts} | 13 +++++++------ .../test/{import.test.ts => public/import.spec.ts} | 7 ++++--- .../test/{list.test.ts => public/list.spec.ts} | 11 ++++++----- .../lro.delete.spec.ts} | 9 +++++---- .../lro.recoverDelete.spec.ts} | 11 ++++++----- .../recoverBackupRestore.spec.ts} | 11 ++++++----- .../challengeBasedAuthenticationPolicy.spec.ts | 9 +++++---- .../keyvault-secrets/test/public/CRUD.spec.ts | 7 ++++--- .../keyvault-secrets/test/public/list.spec.ts | 6 ++++-- .../test/public/lro.delete.spec.ts | 7 ++++--- .../test/public/lro.recover.spec.ts | 7 ++++--- .../test/public/recoverBackupRestore.spec.ts | 7 ++++--- 29 files changed, 144 insertions(+), 119 deletions(-) rename sdk/keyvault/keyvault-certificates/test/{challengeBasedAuthenticationPolicy.test.ts => internal/challengeBasedAuthenticationPolicy.spc.ts} (95%) rename sdk/keyvault/keyvault-certificates/test/{userAgent.test.ts => internal/userAgent.spec.ts} (71%) rename sdk/keyvault/keyvault-certificates/test/{CRUD.test.ts => public/CRUD.spec.ts} (98%) rename sdk/keyvault/keyvault-certificates/test/{list.test.ts => public/list.spec.ts} (97%) rename sdk/keyvault/keyvault-certificates/test/{lro.create.test.ts => public/lro.create.spec.ts} (93%) rename sdk/keyvault/keyvault-certificates/test/{lro.delete.test.ts => public/lro.delete.spec.ts} (94%) rename sdk/keyvault/keyvault-certificates/test/{lro.operation.test.ts => public/lro.operation.spec.ts} (94%) rename sdk/keyvault/keyvault-certificates/test/{lro.recover.test.ts => public/lro.recover.spec.ts} (94%) rename sdk/keyvault/keyvault-certificates/test/{mergeAndImport.test.ts => public/mergeAndImport.spec.ts} (94%) rename sdk/keyvault/keyvault-certificates/test/{recoverBackupRestore.test.ts => public/recoverBackupRestore.spec.ts} (94%) rename sdk/keyvault/keyvault-keys/test/{challengeBasedAuthenticationPolicy.test.ts => internal/challengeBasedAuthenticationPolicy.spec.ts} (95%) rename sdk/keyvault/keyvault-keys/test/{userAgent.test.ts => internal/userAgent.spec.ts} (71%) rename sdk/keyvault/keyvault-keys/test/{CRUD.test.ts => public/CRUD.spec.ts} (98%) rename sdk/keyvault/keyvault-keys/test/{crypto.test.ts => public/crypto.spec.ts} (94%) rename sdk/keyvault/keyvault-keys/test/{import.test.ts => public/import.spec.ts} (96%) rename sdk/keyvault/keyvault-keys/test/{list.test.ts => public/list.spec.ts} (96%) rename sdk/keyvault/keyvault-keys/test/{lro.delete.test.ts => public/lro.delete.spec.ts} (92%) rename sdk/keyvault/keyvault-keys/test/{lro.recoverDelete.test.ts => public/lro.recoverDelete.spec.ts} (92%) rename sdk/keyvault/keyvault-keys/test/{recoverBackupRestore.test.ts => public/recoverBackupRestore.spec.ts} (95%) diff --git a/sdk/keyvault/keyvault-certificates/package.json b/sdk/keyvault/keyvault-certificates/package.json index 4566dee06c2a..5bcfb8f9bbd6 100644 --- a/sdk/keyvault/keyvault-certificates/package.json +++ b/sdk/keyvault/keyvault-certificates/package.json @@ -52,8 +52,8 @@ "extract-api": "tsc -p . && api-extractor run --local", "format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"samples/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "integration-test:browser": "karma start --single-run", - "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace dist-esm/test/*.test.js", - "integration-test:node:no-timeout": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --no-timeouts --full-trace dist-esm/test/*.test.js", + "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace dist-esm/test/**/*.spec.js", + "integration-test:node:no-timeout": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --no-timeouts --full-trace dist-esm/test/**/*.spec.js", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", "lint": "eslint package.json api-extractor.json src test --ext .ts -f html -o keyvault-certificates-lintReport.html", diff --git a/sdk/keyvault/keyvault-certificates/rollup.base.config.js b/sdk/keyvault/keyvault-certificates/rollup.base.config.js index 4a16bae35245..6a320313ffa0 100644 --- a/sdk/keyvault/keyvault-certificates/rollup.base.config.js +++ b/sdk/keyvault/keyvault-certificates/rollup.base.config.js @@ -57,7 +57,7 @@ export function nodeConfig(test = false) { if (test) { // entry point is every test file - baseConfig.input = ["dist-esm/test/*.test.js"]; + baseConfig.input = ["dist-esm/test/**/*.spec.js"]; baseConfig.plugins.unshift( multiEntry({ exports: false }), json() // This allows us to import/require the package.json file, to get the version and test it against the user agent. @@ -131,7 +131,7 @@ export function browserConfig(test = false) { baseConfig.external = ["fs", "fs-extra", "child_process", "path", "crypto", "constants"]; if (test) { baseConfig.external.push("os"); - baseConfig.input = ["dist-esm/test/*.test.js"]; + baseConfig.input = ["dist-esm/test/**/*.spec.js"]; baseConfig.plugins.unshift( multiEntry({ exports: false }), json() // This allows us to import/require the package.json file, to get the version and test it against the user agent. diff --git a/sdk/keyvault/keyvault-certificates/test/challengeBasedAuthenticationPolicy.test.ts b/sdk/keyvault/keyvault-certificates/test/internal/challengeBasedAuthenticationPolicy.spc.ts similarity index 95% rename from sdk/keyvault/keyvault-certificates/test/challengeBasedAuthenticationPolicy.test.ts rename to sdk/keyvault/keyvault-certificates/test/internal/challengeBasedAuthenticationPolicy.spc.ts index 6af5ca084dbe..421b91d01854 100644 --- a/sdk/keyvault/keyvault-certificates/test/challengeBasedAuthenticationPolicy.test.ts +++ b/sdk/keyvault/keyvault-certificates/test/internal/challengeBasedAuthenticationPolicy.spc.ts @@ -2,17 +2,18 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { CertificateClient } from "../src"; +import { createSandbox } from "sinon"; import { env, Recorder } from "@azure/test-utils-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; + +import { CertificateClient } from "../../src"; import { AuthenticationChallengeCache, AuthenticationChallenge, parseWWWAuthenticate -} from "../src/core/challengeBasedAuthenticationPolicy"; -import { createSandbox } from "sinon"; -import { testPollerProperties } from './utils/recorderUtils'; +} from "../../src/core/challengeBasedAuthenticationPolicy"; +import { testPollerProperties } from '../utils/recorderUtils'; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; // Following the philosophy of not testing the insides if we can test the outsides... // I present you with this "Get Out of Jail Free" card (in reference to Monopoly). diff --git a/sdk/keyvault/keyvault-certificates/test/userAgent.test.ts b/sdk/keyvault/keyvault-certificates/test/internal/userAgent.spec.ts similarity index 71% rename from sdk/keyvault/keyvault-certificates/test/userAgent.test.ts rename to sdk/keyvault/keyvault-certificates/test/internal/userAgent.spec.ts index 21ddadb74cfa..b8758871c0e4 100644 --- a/sdk/keyvault/keyvault-certificates/test/userAgent.test.ts +++ b/sdk/keyvault/keyvault-certificates/test/internal/userAgent.spec.ts @@ -2,9 +2,9 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { version } from "../package.json"; -import { SDK_VERSION } from "../src/core/utils/constants"; -import { packageVersion } from "../src/core/keyVaultClientContext"; +import { version } from "../../package.json"; +import { SDK_VERSION } from "../../src/core/utils/constants"; +import { packageVersion } from "../../src/core/keyVaultClientContext"; describe("Certificates client's user agent", () => { // The tests follow diff --git a/sdk/keyvault/keyvault-certificates/test/CRUD.test.ts b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts similarity index 98% rename from sdk/keyvault/keyvault-certificates/test/CRUD.test.ts rename to sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts index 0c6b41119fe8..b3c663dd5ddd 100644 --- a/sdk/keyvault/keyvault-certificates/test/CRUD.test.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/CRUD.spec.ts @@ -5,17 +5,18 @@ import os from "os"; import fs from "fs"; import childProcess from "child_process"; import * as assert from "assert"; -import { CertificateClient } from "../src"; import { env, Recorder } from "@azure/test-utils-recorder"; -import { testPollerProperties } from "./utils/recorderUtils"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; import { AbortController } from "@azure/abort-controller"; -import { assertThrowsAbortError } from "./utils/utils.common"; import { SecretClient } from "@azure/keyvault-secrets"; import { ClientSecretCredential } from "@azure/identity"; import { isNode } from "@azure/core-http"; +import { CertificateClient } from "../../src"; +import { assertThrowsAbortError } from "../utils/utils.common"; +import { testPollerProperties } from "../utils/recorderUtils"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; + describe("Certificates client - create, read, update and delete", () => { const prefix = `recover${env.CERTIFICATE_NAME || "CertificateName"}`; let suffix: string; diff --git a/sdk/keyvault/keyvault-certificates/test/list.test.ts b/sdk/keyvault/keyvault-certificates/test/public/list.spec.ts similarity index 97% rename from sdk/keyvault/keyvault-certificates/test/list.test.ts rename to sdk/keyvault/keyvault-certificates/test/public/list.spec.ts index 62b32f559fc7..be9af2ea2f4f 100644 --- a/sdk/keyvault/keyvault-certificates/test/list.test.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/list.spec.ts @@ -1,15 +1,17 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import * as assert from "assert"; import chai from "chai"; -import { CertificateClient } from "../src"; +import * as assert from "assert"; import { env, isPlaybackMode, Recorder, isRecordMode } from "@azure/test-utils-recorder"; -import { testPollerProperties } from "./utils/recorderUtils"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; import { isNode } from "@azure/core-http"; -import { assertThrowsAbortError } from "./utils/utils.common"; + +import { CertificateClient } from "../../src"; +import { assertThrowsAbortError } from "../utils/utils.common"; +import { testPollerProperties } from "../utils/recorderUtils"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; + const { expect } = chai; describe("Certificates client - list certificates in various ways", () => { diff --git a/sdk/keyvault/keyvault-certificates/test/lro.create.test.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.create.spec.ts similarity index 93% rename from sdk/keyvault/keyvault-certificates/test/lro.create.test.ts rename to sdk/keyvault/keyvault-certificates/test/public/lro.create.spec.ts index 79c58e2eb934..cbe2cb774853 100644 --- a/sdk/keyvault/keyvault-certificates/test/lro.create.test.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.create.spec.ts @@ -2,12 +2,13 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { CertificateClient, KeyVaultCertificate, DefaultCertificatePolicy } from "../src"; -import { testPollerProperties } from "./utils/recorderUtils"; -import { env, Recorder } from "@azure/test-utils-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; import { PollerStoppedError } from "@azure/core-lro"; +import { env, Recorder } from "@azure/test-utils-recorder"; + +import { CertificateClient, KeyVaultCertificate, DefaultCertificatePolicy } from "../../src"; +import { testPollerProperties } from "../utils/recorderUtils"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; describe("Certificates client - LRO - create", () => { const certificatePrefix = `recover${env.CERTIFICATE_NAME || "CertificateName"}`; diff --git a/sdk/keyvault/keyvault-certificates/test/lro.delete.test.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.delete.spec.ts similarity index 94% rename from sdk/keyvault/keyvault-certificates/test/lro.delete.test.ts rename to sdk/keyvault/keyvault-certificates/test/public/lro.delete.spec.ts index 82e5dbd98d25..89fd83181863 100644 --- a/sdk/keyvault/keyvault-certificates/test/lro.delete.test.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.delete.spec.ts @@ -2,12 +2,13 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { CertificateClient, DeletedCertificate, DefaultCertificatePolicy } from "../src"; -import { testPollerProperties } from "./utils/recorderUtils"; -import { env, Recorder } from "@azure/test-utils-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; import { PollerStoppedError } from "@azure/core-lro"; +import { env, Recorder } from "@azure/test-utils-recorder"; + +import { CertificateClient, DeletedCertificate, DefaultCertificatePolicy } from "../../src"; +import { testPollerProperties } from "../utils/recorderUtils"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; describe("Certificates client - lro - delete", () => { const certificatePrefix = `recover${env.CERTIFICATE_NAME || "CertificateName"}`; diff --git a/sdk/keyvault/keyvault-certificates/test/lro.operation.test.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts similarity index 94% rename from sdk/keyvault/keyvault-certificates/test/lro.operation.test.ts rename to sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts index 6c0100e0a48c..225a2e13f489 100644 --- a/sdk/keyvault/keyvault-certificates/test/lro.operation.test.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.operation.spec.ts @@ -2,16 +2,17 @@ // Licensed under the MIT license. import * as assert from "assert"; +import { env, Recorder } from "@azure/test-utils-recorder"; + import { CertificateClient, CertificateOperation, DefaultCertificatePolicy, KeyVaultCertificateWithPolicy -} from "../src"; -import { testPollerProperties } from "./utils/recorderUtils"; -import { env, Recorder } from "@azure/test-utils-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; +} from "../../src"; +import { testPollerProperties } from "../utils/recorderUtils"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; describe("Certificates client - LRO - certificate operation", () => { const certificatePrefix = `recover${env.CERTIFICATE_NAME || "CertificateName"}`; diff --git a/sdk/keyvault/keyvault-certificates/test/lro.recover.test.ts b/sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts similarity index 94% rename from sdk/keyvault/keyvault-certificates/test/lro.recover.test.ts rename to sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts index 4111c6736cc5..dae1ece5d3fa 100644 --- a/sdk/keyvault/keyvault-certificates/test/lro.recover.test.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/lro.recover.spec.ts @@ -2,13 +2,14 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { CertificateClient, DeletedCertificate, DefaultCertificatePolicy } from "../src"; -import { testPollerProperties } from "./utils/recorderUtils"; import { env, Recorder } from "@azure/test-utils-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; import { PollerStoppedError } from "@azure/core-lro"; -import { assertThrowsAbortError } from "./utils/utils.common"; + +import { CertificateClient, DeletedCertificate, DefaultCertificatePolicy } from "../../src"; +import { assertThrowsAbortError } from "../utils/utils.common"; +import { testPollerProperties } from "../utils/recorderUtils"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; describe("Certificates client - LRO - recoverDelete", () => { const certificatePrefix = `recover${env.CERTIFICATE_NAME || "CertificateName"}`; diff --git a/sdk/keyvault/keyvault-certificates/test/mergeAndImport.test.ts b/sdk/keyvault/keyvault-certificates/test/public/mergeAndImport.spec.ts similarity index 94% rename from sdk/keyvault/keyvault-certificates/test/mergeAndImport.test.ts rename to sdk/keyvault/keyvault-certificates/test/public/mergeAndImport.spec.ts index c895f4cff2d9..1b4ed7b7b146 100644 --- a/sdk/keyvault/keyvault-certificates/test/mergeAndImport.test.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/mergeAndImport.spec.ts @@ -3,15 +3,16 @@ import fs from "fs"; import childProcess from "child_process"; -import { CertificateClient } from "../src"; -import { testPollerProperties } from "./utils/recorderUtils"; +import { isNode } from "@azure/core-http"; import { env, Recorder } from "@azure/test-utils-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; import { SecretClient } from "@azure/keyvault-secrets"; import { ClientSecretCredential } from "@azure/identity"; -import { base64ToUint8Array, stringToUint8Array } from "../src/utils"; -import { isNode } from "@azure/core-http"; + +import { CertificateClient } from "../../src"; +import { base64ToUint8Array, stringToUint8Array } from "../../src/utils"; +import { testPollerProperties } from "../utils/recorderUtils"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; describe("Certificates client - merge and import certificates", () => { const prefix = `merge${env.CERTIFICATE_NAME || "CertificateName"}`; diff --git a/sdk/keyvault/keyvault-certificates/test/recoverBackupRestore.test.ts b/sdk/keyvault/keyvault-certificates/test/public/recoverBackupRestore.spec.ts similarity index 94% rename from sdk/keyvault/keyvault-certificates/test/recoverBackupRestore.test.ts rename to sdk/keyvault/keyvault-certificates/test/public/recoverBackupRestore.spec.ts index bc6b2cbb271f..037ca96268cb 100644 --- a/sdk/keyvault/keyvault-certificates/test/recoverBackupRestore.test.ts +++ b/sdk/keyvault/keyvault-certificates/test/public/recoverBackupRestore.spec.ts @@ -2,14 +2,15 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { CertificateClient } from "../src"; import { env, isPlaybackMode, Recorder, delay, isRecordMode } from "@azure/test-utils-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; -import { testPollerProperties } from "./utils/recorderUtils"; -import { assertThrowsAbortError } from "./utils/utils.common"; import { isNode } from "@azure/core-http"; +import { CertificateClient } from "../../src"; +import { testPollerProperties } from "../utils/recorderUtils"; +import { assertThrowsAbortError } from "../utils/utils.common"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; + describe("Certificates client - restore certificates and recover backups", () => { const prefix = `recover${env.CERTIFICATE_NAME || "CertificateName"}`; let suffix: string; diff --git a/sdk/keyvault/keyvault-keys/package.json b/sdk/keyvault/keyvault-keys/package.json index 7a4fb7476e19..48ff73bd7896 100644 --- a/sdk/keyvault/keyvault-keys/package.json +++ b/sdk/keyvault/keyvault-keys/package.json @@ -52,8 +52,8 @@ "extract-api": "tsc -p . && api-extractor run --local", "format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "integration-test:browser": "karma start --single-run", - "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace dist-esm/test/*.test.js", - "integration-test:node:no-timeout": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --no-timeouts --full-trace dist-esm/test/*.test.js", + "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace dist-esm/test/**/*.spec.js", + "integration-test:node:no-timeout": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --no-timeouts --full-trace dist-esm/test/**/*.spec.js", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", "lint": "eslint package.json api-extractor.json src test --ext .ts -f html -o keyvault-keys-lintReport.html", diff --git a/sdk/keyvault/keyvault-keys/rollup.base.config.js b/sdk/keyvault/keyvault-keys/rollup.base.config.js index 412ea6052ced..21f9640c64a3 100644 --- a/sdk/keyvault/keyvault-keys/rollup.base.config.js +++ b/sdk/keyvault/keyvault-keys/rollup.base.config.js @@ -57,7 +57,7 @@ export function nodeConfig(test = false) { if (test) { // entry point is every test file - baseConfig.input = ["dist-esm/test/*.test.js"]; + baseConfig.input = ["dist-esm/test/**/*.spec.js"]; baseConfig.plugins.unshift( multiEntry({ exports: false }), json() // This allows us to import/require the package.json file, to get the version and test it against the user agent. @@ -128,7 +128,7 @@ export function browserConfig(test = false) { baseConfig.external = ["fs-extra", "path", "crypto", "constants"]; if (test) { - baseConfig.input = ["dist-esm/test/*.test.js"]; + baseConfig.input = ["dist-esm/test/**/*.spec.js"]; baseConfig.plugins.unshift( multiEntry({ exports: false }), json() // This allows us to import/require the package.json file, to get the version and test it against the user agent. diff --git a/sdk/keyvault/keyvault-keys/test/challengeBasedAuthenticationPolicy.test.ts b/sdk/keyvault/keyvault-keys/test/internal/challengeBasedAuthenticationPolicy.spec.ts similarity index 95% rename from sdk/keyvault/keyvault-keys/test/challengeBasedAuthenticationPolicy.test.ts rename to sdk/keyvault/keyvault-keys/test/internal/challengeBasedAuthenticationPolicy.spec.ts index 82a7ea1cae08..6821fe7d8bf5 100644 --- a/sdk/keyvault/keyvault-keys/test/challengeBasedAuthenticationPolicy.test.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/challengeBasedAuthenticationPolicy.spec.ts @@ -2,16 +2,17 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { KeyClient } from "../src"; +import { createSandbox } from "sinon"; import { env, Recorder } from "@azure/test-utils-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; + +import { KeyClient } from "../../src"; import { AuthenticationChallengeCache, AuthenticationChallenge, parseWWWAuthenticate -} from "../src/core/challengeBasedAuthenticationPolicy"; -import { createSandbox } from "sinon"; +} from "../../src/core/challengeBasedAuthenticationPolicy"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; // Following the philosophy of not testing the insides if we can test the outsides... // I present you with this "Get Out of Jail Free" card (in reference to Monopoly). diff --git a/sdk/keyvault/keyvault-keys/test/userAgent.test.ts b/sdk/keyvault/keyvault-keys/test/internal/userAgent.spec.ts similarity index 71% rename from sdk/keyvault/keyvault-keys/test/userAgent.test.ts rename to sdk/keyvault/keyvault-keys/test/internal/userAgent.spec.ts index 17a3d4201934..6e5a998e6fc8 100644 --- a/sdk/keyvault/keyvault-keys/test/userAgent.test.ts +++ b/sdk/keyvault/keyvault-keys/test/internal/userAgent.spec.ts @@ -2,9 +2,9 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { version } from "../package.json"; -import { SDK_VERSION } from "../src/core/utils/constants"; -import { packageVersion } from "../src/core/keyVaultClientContext"; +import { version } from "../../package.json"; +import { SDK_VERSION } from "../../src/core/utils/constants"; +import { packageVersion } from "../../src/core/keyVaultClientContext"; describe("Keys client's user agent", () => { // The tests follow diff --git a/sdk/keyvault/keyvault-keys/test/CRUD.test.ts b/sdk/keyvault/keyvault-keys/test/public/CRUD.spec.ts similarity index 98% rename from sdk/keyvault/keyvault-keys/test/CRUD.test.ts rename to sdk/keyvault/keyvault-keys/test/public/CRUD.spec.ts index a7fb4a6b2151..7afcc983bbc9 100644 --- a/sdk/keyvault/keyvault-keys/test/CRUD.test.ts +++ b/sdk/keyvault/keyvault-keys/test/public/CRUD.spec.ts @@ -2,14 +2,15 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { KeyClient, CreateEcKeyOptions, UpdateKeyPropertiesOptions, GetKeyOptions } from "../src"; import { RestError } from "@azure/core-http"; -import { testPollerProperties } from "./utils/recorderUtils"; -import { env, Recorder } from "@azure/test-utils-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; import { AbortController } from "@azure/abort-controller"; -import { assertThrowsAbortError } from "./utils/utils.common"; +import { env, Recorder } from "@azure/test-utils-recorder"; + +import { KeyClient, CreateEcKeyOptions, UpdateKeyPropertiesOptions, GetKeyOptions } from "../../src"; +import { assertThrowsAbortError } from "../utils/utils.common"; +import { testPollerProperties } from "../utils/recorderUtils"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; describe("Keys client - create, read, update and delete operations", () => { const keyPrefix = `recover${env.KEY_NAME || "KeyName"}`; diff --git a/sdk/keyvault/keyvault-keys/test/crypto.test.ts b/sdk/keyvault/keyvault-keys/test/public/crypto.spec.ts similarity index 94% rename from sdk/keyvault/keyvault-keys/test/crypto.test.ts rename to sdk/keyvault/keyvault-keys/test/public/crypto.spec.ts index d2b172c276aa..2a4d223d9bc6 100644 --- a/sdk/keyvault/keyvault-keys/test/crypto.test.ts +++ b/sdk/keyvault/keyvault-keys/test/public/crypto.spec.ts @@ -4,15 +4,16 @@ import * as assert from "assert"; import { createHash, publicEncrypt } from "crypto"; import * as constants from "constants"; -import { ClientSecretCredential } from "@azure/identity"; -import { CryptographyClient, KeyVaultKey, KeyClient } from "../src"; -import { convertJWKtoPEM } from "../src/cryptographyClient"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; -import { stringToUint8Array, uint8ArrayToString } from "./utils/crypto"; import { isRecordMode, Recorder } from "@azure/test-utils-recorder"; +import { ClientSecretCredential } from "@azure/identity"; import { isNode } from "@azure/core-http"; +import { CryptographyClient, KeyVaultKey, KeyClient } from "../../src"; +import { convertJWKtoPEM } from "../../src/cryptographyClient"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; +import { stringToUint8Array, uint8ArrayToString } from "../utils/crypto"; + describe("CryptographyClient (all decrypts happen remotely)", () => { let client: KeyClient; let testClient: TestClient; diff --git a/sdk/keyvault/keyvault-keys/test/import.test.ts b/sdk/keyvault/keyvault-keys/test/public/import.spec.ts similarity index 96% rename from sdk/keyvault/keyvault-keys/test/import.test.ts rename to sdk/keyvault/keyvault-keys/test/public/import.spec.ts index f6628fc0c545..86d0b00369a0 100644 --- a/sdk/keyvault/keyvault-keys/test/import.test.ts +++ b/sdk/keyvault/keyvault-keys/test/public/import.spec.ts @@ -2,12 +2,13 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { KeyClient, JsonWebKey } from "../src"; import { env, Recorder } from "@azure/test-utils-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; import { isNode } from "@azure/core-http"; +import { KeyClient, JsonWebKey } from "../../src"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; + describe("Keys client - import keys", () => { const prefix = `merge${env.CERTIFICATE_NAME || "KeyName"}`; let suffix: string; diff --git a/sdk/keyvault/keyvault-keys/test/list.test.ts b/sdk/keyvault/keyvault-keys/test/public/list.spec.ts similarity index 96% rename from sdk/keyvault/keyvault-keys/test/list.test.ts rename to sdk/keyvault/keyvault-keys/test/public/list.spec.ts index 69f7b452a7ae..79ace4aaa2af 100644 --- a/sdk/keyvault/keyvault-keys/test/list.test.ts +++ b/sdk/keyvault/keyvault-keys/test/public/list.spec.ts @@ -2,12 +2,13 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { KeyClient } from "../src"; -import { testPollerProperties } from "./utils/recorderUtils"; import { env, Recorder, isRecordMode } from "@azure/test-utils-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; -import { assertThrowsAbortError } from "./utils/utils.common"; + +import { KeyClient } from "../../src"; +import { assertThrowsAbortError } from "../utils/utils.common"; +import { testPollerProperties } from "../utils/recorderUtils"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; describe("Keys client - list keys in various ways", () => { const keyPrefix = `recover${env.KEY_NAME || "KeyName"}`; diff --git a/sdk/keyvault/keyvault-keys/test/lro.delete.test.ts b/sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts similarity index 92% rename from sdk/keyvault/keyvault-keys/test/lro.delete.test.ts rename to sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts index 707abff6621f..a278f6ed02da 100644 --- a/sdk/keyvault/keyvault-keys/test/lro.delete.test.ts +++ b/sdk/keyvault/keyvault-keys/test/public/lro.delete.spec.ts @@ -2,13 +2,14 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { KeyClient, DeletedKey } from "../src"; -import { testPollerProperties } from "./utils/recorderUtils"; import { env, Recorder } from "@azure/test-utils-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; import { PollerStoppedError } from "@azure/core-lro"; +import { KeyClient, DeletedKey } from "../../src"; +import { testPollerProperties } from "../utils/recorderUtils"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; + describe("Keys client - Long Running Operations - delete", () => { const keyPrefix = `recover${env.CERTIFICATE_NAME || "KeyName"}`; let keySuffix: string; diff --git a/sdk/keyvault/keyvault-keys/test/lro.recoverDelete.test.ts b/sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts similarity index 92% rename from sdk/keyvault/keyvault-keys/test/lro.recoverDelete.test.ts rename to sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts index b85420148f0d..0b73af9c279b 100644 --- a/sdk/keyvault/keyvault-keys/test/lro.recoverDelete.test.ts +++ b/sdk/keyvault/keyvault-keys/test/public/lro.recoverDelete.spec.ts @@ -2,13 +2,14 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { KeyClient, DeletedKey } from "../src"; -import { testPollerProperties } from "./utils/recorderUtils"; import { env, Recorder } from "@azure/test-utils-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; import { PollerStoppedError } from "@azure/core-lro"; -import { assertThrowsAbortError } from "./utils/utils.common"; + +import { KeyClient, DeletedKey } from "../../src"; +import { assertThrowsAbortError } from "../utils/utils.common"; +import { testPollerProperties } from "../utils/recorderUtils"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; describe("Keys client - Long Running Operations - recoverDelete", () => { const keyPrefix = `recover${env.CERTIFICATE_NAME || "KeyName"}`; diff --git a/sdk/keyvault/keyvault-keys/test/recoverBackupRestore.test.ts b/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts similarity index 95% rename from sdk/keyvault/keyvault-keys/test/recoverBackupRestore.test.ts rename to sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts index 8f3526b2abbf..e84b06477db7 100644 --- a/sdk/keyvault/keyvault-keys/test/recoverBackupRestore.test.ts +++ b/sdk/keyvault/keyvault-keys/test/public/recoverBackupRestore.spec.ts @@ -2,13 +2,14 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { KeyClient } from "../src"; import { isNode } from "@azure/core-http"; -import { testPollerProperties } from "./utils/recorderUtils"; import { env, Recorder, delay, isRecordMode, isPlaybackMode } from "@azure/test-utils-recorder"; -import { authenticate } from "./utils/testAuthentication"; -import TestClient from "./utils/testClient"; -import { assertThrowsAbortError } from "./utils/utils.common"; + +import { KeyClient } from "../../src"; +import { assertThrowsAbortError } from "../utils/utils.common"; +import { testPollerProperties } from "../utils/recorderUtils"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; describe("Keys client - restore keys and recover backups", () => { const keyPrefix = `recover${env.KEY_NAME || "KeyName"}`; diff --git a/sdk/keyvault/keyvault-secrets/test/internal/challengeBasedAuthenticationPolicy.spec.ts b/sdk/keyvault/keyvault-secrets/test/internal/challengeBasedAuthenticationPolicy.spec.ts index 8714bc6caaf5..e7d3767717b9 100644 --- a/sdk/keyvault/keyvault-secrets/test/internal/challengeBasedAuthenticationPolicy.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/internal/challengeBasedAuthenticationPolicy.spec.ts @@ -2,16 +2,17 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { SecretClient } from "../../src"; import { env, Recorder } from "@azure/test-utils-recorder"; -import { authenticate } from "../utils/testAuthentication"; -import TestClient from "../utils/testClient"; +import { createSandbox } from "sinon"; + +import { SecretClient } from "../../src"; import { AuthenticationChallengeCache, AuthenticationChallenge, parseWWWAuthenticate } from "../../src/core/challengeBasedAuthenticationPolicy"; -import { createSandbox } from "sinon"; +import { authenticate } from "../utils/testAuthentication"; +import TestClient from "../utils/testClient"; // Following the philosophy of not testing the insides if we can test the outsides... // I present you with this "Get Out of Jail Free" card (in reference to Monopoly). diff --git a/sdk/keyvault/keyvault-secrets/test/public/CRUD.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/CRUD.spec.ts index 3acb099c7475..ec127fa594f3 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/CRUD.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/CRUD.spec.ts @@ -2,13 +2,14 @@ // Licensed under the MIT license. import * as assert from "assert"; +import { env, Recorder } from "@azure/test-utils-recorder"; +import { AbortController } from "@azure/abort-controller"; + import { SecretClient } from "../../src"; +import { assertThrowsAbortError } from "../utils/utils.common"; import { testPollerProperties } from "../utils/recorderUtils"; -import { env, Recorder } from "@azure/test-utils-recorder"; import { authenticate } from "../utils/testAuthentication"; import TestClient from "../utils/testClient"; -import { AbortController } from "@azure/abort-controller"; -import { assertThrowsAbortError } from "../utils/utils.common"; describe("Secret client - create, read, update and delete operations", () => { const secretValue = "SECRET_VALUE"; diff --git a/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts index bad9223d2827..11ed3f520333 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/list.spec.ts @@ -3,12 +3,14 @@ import * as assert from "assert"; import chai from "chai"; +import { env, Recorder, isRecordMode } from "@azure/test-utils-recorder"; + import { SecretClient } from "../../src"; +import { assertThrowsAbortError } from "../utils/utils.common"; import { testPollerProperties } from "../utils/recorderUtils"; -import { env, Recorder, isRecordMode } from "@azure/test-utils-recorder"; import { authenticate } from "../utils/testAuthentication"; import TestClient from "../utils/testClient"; -import { assertThrowsAbortError } from "../utils/utils.common"; + const { expect } = chai; describe("Secret client - list secrets in various ways", () => { 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 11d6d0e8d257..339f14fe59ba 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/lro.delete.spec.ts @@ -2,13 +2,14 @@ // Licensed under the MIT license. import * as assert from "assert"; +import { env, Recorder } from "@azure/test-utils-recorder"; +import { PollerStoppedError } from "@azure/core-lro"; + import { SecretClient, DeletedSecret } from "../../src"; +import { assertThrowsAbortError } from "../utils/utils.common"; import { testPollerProperties } from "../utils/recorderUtils"; -import { env, Recorder } from "@azure/test-utils-recorder"; import { authenticate } from "../utils/testAuthentication"; import TestClient from "../utils/testClient"; -import { PollerStoppedError } from "@azure/core-lro"; -import { assertThrowsAbortError } from "../utils/utils.common"; describe("Secrets client - Long Running Operations - delete", () => { const secretPrefix = `recover${env.CERTIFICATE_NAME || "SecretName"}`; diff --git a/sdk/keyvault/keyvault-secrets/test/public/lro.recover.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/lro.recover.spec.ts index c805bdd93647..c67c299ac2c7 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/lro.recover.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/lro.recover.spec.ts @@ -2,13 +2,14 @@ // Licensed under the MIT license. import * as assert from "assert"; +import { env, Recorder } from "@azure/test-utils-recorder"; +import { PollerStoppedError } from "@azure/core-lro"; + import { SecretClient, SecretProperties } from "../../src"; +import { assertThrowsAbortError } from "../utils/utils.common"; import { testPollerProperties } from "../utils/recorderUtils"; -import { env, Recorder } from "@azure/test-utils-recorder"; import { authenticate } from "../utils/testAuthentication"; import TestClient from "../utils/testClient"; -import { PollerStoppedError } from "@azure/core-lro"; -import { assertThrowsAbortError } from "../utils/utils.common"; describe("Secrets client - Long Running Operations - recoverDelete", () => { const secretPrefix = `recover${env.CERTIFICATE_NAME || "SecretName"}`; diff --git a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts index 1fda75a01b3f..fa9d14678df3 100644 --- a/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts +++ b/sdk/keyvault/keyvault-secrets/test/public/recoverBackupRestore.spec.ts @@ -2,13 +2,14 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { SecretClient } from "../../src"; import { isNode } from "@azure/core-http"; -import { testPollerProperties } from "../utils/recorderUtils"; import { env, isPlaybackMode, Recorder, delay, isRecordMode } from "@azure/test-utils-recorder"; + +import { SecretClient } from "../../src"; +import { assertThrowsAbortError } from "../utils/utils.common"; +import { testPollerProperties } from "../utils/recorderUtils"; import { authenticate } from "../utils/testAuthentication"; import TestClient from "../utils/testClient"; -import { assertThrowsAbortError } from "../utils/utils.common"; describe("Secret client - restore secrets and recover backups", () => { const secretPrefix = `CRUD${env.SECRET_NAME || "SecretName"}`; From 3bd1ce8dac468d034384a52e04cfcf76d9460efb Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Wed, 17 Jun 2020 21:57:15 +0000 Subject: [PATCH 2/6] TestMinMax: true --- sdk/keyvault/keyvault-certificates/tests.yml | 1 + sdk/keyvault/keyvault-keys/tests.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/sdk/keyvault/keyvault-certificates/tests.yml b/sdk/keyvault/keyvault-certificates/tests.yml index f6f36fb0890a..dd5041399c35 100644 --- a/sdk/keyvault/keyvault-certificates/tests.yml +++ b/sdk/keyvault/keyvault-certificates/tests.yml @@ -5,6 +5,7 @@ extends: parameters: PackageName: "@azure/keyvault-certificates" ResourceServiceDirectory: keyvault + TestMinMax: true EnvVars: AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) diff --git a/sdk/keyvault/keyvault-keys/tests.yml b/sdk/keyvault/keyvault-keys/tests.yml index 5e800fcc4fe6..28bd746f03a9 100644 --- a/sdk/keyvault/keyvault-keys/tests.yml +++ b/sdk/keyvault/keyvault-keys/tests.yml @@ -5,6 +5,7 @@ extends: parameters: PackageName: "@azure/keyvault-keys" ResourceServiceDirectory: keyvault + TestMinMax: true EnvVars: AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) From 4251cbeccab8bee34fe16fff5f0afd18898942e1 Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Wed, 17 Jun 2020 23:43:06 +0000 Subject: [PATCH 3/6] cleanups after merging the latest master --- sdk/keyvault/keyvault-secrets/package.json | 4 ++-- sdk/keyvault/keyvault-secrets/rollup.base.config.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/keyvault/keyvault-secrets/package.json b/sdk/keyvault/keyvault-secrets/package.json index 1509900515b3..43ccc15dbe80 100644 --- a/sdk/keyvault/keyvault-secrets/package.json +++ b/sdk/keyvault/keyvault-secrets/package.json @@ -57,8 +57,8 @@ "extract-api": "tsc -p . && api-extractor run --local", "format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "integration-test:browser": "karma start --single-run", - "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace dist-esm/keyvault-secrets/test/**/*.spec.js", - "integration-test:node:no-timeout": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --no-timeouts --full-trace dist-esm/keyvault-secrets/test/**/*.spec.js", + "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace dist-esm/keyvault-secrets/**/*.spec.js", + "integration-test:node:no-timeout": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --no-timeouts --full-trace dist-esm/keyvault-secrets/**/*.spec.js", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", "lint": "eslint package.json api-extractor.json src test --ext .ts -f html -o keyvault-secrets-lintReport.html", diff --git a/sdk/keyvault/keyvault-secrets/rollup.base.config.js b/sdk/keyvault/keyvault-secrets/rollup.base.config.js index 04105e552dc6..4097e5072bc7 100644 --- a/sdk/keyvault/keyvault-secrets/rollup.base.config.js +++ b/sdk/keyvault/keyvault-secrets/rollup.base.config.js @@ -57,7 +57,7 @@ export function nodeConfig(test = false) { if (test) { // entry point is every test file - baseConfig.input = ["dist-esm/keyvault-secrets/test/**/*.spec.js"]; + baseConfig.input = ["dist-esm/keyvault-secrets/**/*.spec.js"]; baseConfig.plugins.unshift( multiEntry({ exports: false }), json() // This allows us to import/require the package.json file, to get the version and test it against the user agent. @@ -127,7 +127,7 @@ export function browserConfig(test = false) { }; if (test) { - baseConfig.input = ["dist-esm/keyvault-secrets/test/**/*.spec.js"]; + baseConfig.input = ["dist-esm/keyvault-secrets/**/*.spec.js"]; baseConfig.plugins.unshift( multiEntry({ exports: false }), json() // This allows us to import/require the package.json file, to get the version and test it against the user agent. From f95eda1c2f2eb987064096085ef6a3640743ff58 Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Wed, 17 Jun 2020 23:52:30 +0000 Subject: [PATCH 4/6] broke the build by mistake while fixing conflicts --- sdk/keyvault/keyvault-keys/rollup.base.config.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sdk/keyvault/keyvault-keys/rollup.base.config.js b/sdk/keyvault/keyvault-keys/rollup.base.config.js index c5f66911b520..6f0642fefde0 100644 --- a/sdk/keyvault/keyvault-keys/rollup.base.config.js +++ b/sdk/keyvault/keyvault-keys/rollup.base.config.js @@ -128,11 +128,7 @@ export function browserConfig(test = false) { baseConfig.external = ["fs-extra", "path", "crypto", "constants"]; if (test) { -<<<<<<< HEAD - baseConfig.input = ["dist-esm/test/**/*.spec.js"]; -======= - baseConfig.input = ["dist-esm/keyvault-keys/test/*.test.js"]; ->>>>>>> Azure/master + baseConfig.input = ["dist-esm/**/*.spec.js"]; baseConfig.plugins.unshift( multiEntry({ exports: false }), json() // This allows us to import/require the package.json file, to get the version and test it against the user agent. From 2f0db9170d10ec99a021ea7f4c3c55572ef341c2 Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Wed, 17 Jun 2020 23:54:51 +0000 Subject: [PATCH 5/6] aligning secrets to the path changes to keys and certificates --- sdk/keyvault/keyvault-secrets/package.json | 4 ++-- sdk/keyvault/keyvault-secrets/rollup.base.config.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/keyvault/keyvault-secrets/package.json b/sdk/keyvault/keyvault-secrets/package.json index 43ccc15dbe80..da14045386a1 100644 --- a/sdk/keyvault/keyvault-secrets/package.json +++ b/sdk/keyvault/keyvault-secrets/package.json @@ -57,8 +57,8 @@ "extract-api": "tsc -p . && api-extractor run --local", "format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "integration-test:browser": "karma start --single-run", - "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace dist-esm/keyvault-secrets/**/*.spec.js", - "integration-test:node:no-timeout": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --no-timeouts --full-trace dist-esm/keyvault-secrets/**/*.spec.js", + "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace dist-esm/**/*.spec.js", + "integration-test:node:no-timeout": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --no-timeouts --full-trace dist-esm/**/*.spec.js", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", "lint": "eslint package.json api-extractor.json src test --ext .ts -f html -o keyvault-secrets-lintReport.html", diff --git a/sdk/keyvault/keyvault-secrets/rollup.base.config.js b/sdk/keyvault/keyvault-secrets/rollup.base.config.js index 4097e5072bc7..b9aafc627dd1 100644 --- a/sdk/keyvault/keyvault-secrets/rollup.base.config.js +++ b/sdk/keyvault/keyvault-secrets/rollup.base.config.js @@ -57,7 +57,7 @@ export function nodeConfig(test = false) { if (test) { // entry point is every test file - baseConfig.input = ["dist-esm/keyvault-secrets/**/*.spec.js"]; + baseConfig.input = ["dist-esm/**/*.spec.js"]; baseConfig.plugins.unshift( multiEntry({ exports: false }), json() // This allows us to import/require the package.json file, to get the version and test it against the user agent. @@ -127,7 +127,7 @@ export function browserConfig(test = false) { }; if (test) { - baseConfig.input = ["dist-esm/keyvault-secrets/**/*.spec.js"]; + baseConfig.input = ["dist-esm/**/*.spec.js"]; baseConfig.plugins.unshift( multiEntry({ exports: false }), json() // This allows us to import/require the package.json file, to get the version and test it against the user agent. From 698d6f3cea23a17d2b68174d718d3fff767e215a Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Thu, 18 Jun 2020 02:28:43 +0000 Subject: [PATCH 6/6] samples path fix --- sdk/keyvault/keyvault-certificates/package.json | 2 +- sdk/keyvault/keyvault-keys/package.json | 2 +- sdk/keyvault/keyvault-secrets/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/keyvault/keyvault-certificates/package.json b/sdk/keyvault/keyvault-certificates/package.json index f8d8443d2217..e9d7ef3fe693 100644 --- a/sdk/keyvault/keyvault-certificates/package.json +++ b/sdk/keyvault/keyvault-certificates/package.json @@ -49,7 +49,7 @@ "check-format": "prettier --list-different --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "clean": "rimraf dist-esm dist-test typings *.tgz *.log samples/typescript/dist", "execute:js-samples": "node ../../../common/scripts/run-samples.js samples/javascript/", - "execute:ts-samples": "node ../../../common/scripts/run-samples.js samples/typescript/dist/samples/typescript/src/", + "execute:ts-samples": "node ../../../common/scripts/run-samples.js samples/typescript/dist/keyvault-certificates/samples/typescript/src/", "execute:samples": "npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples", "extract-api": "tsc -p . && api-extractor run --local", "format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"samples/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", diff --git a/sdk/keyvault/keyvault-keys/package.json b/sdk/keyvault/keyvault-keys/package.json index 915060c18eb6..f35234206fe3 100644 --- a/sdk/keyvault/keyvault-keys/package.json +++ b/sdk/keyvault/keyvault-keys/package.json @@ -41,7 +41,7 @@ "check-format": "prettier --list-different --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "clean": "rimraf dist dist-esm dist-test types *.tgz *.log dist-browser statistics.html coverage && rimraf src/**/*.js && rimraf test/**/*.js", "execute:js-samples": "node ../../../common/scripts/run-samples.js samples/javascript/", - "execute:ts-samples": "node ../../../common/scripts/run-samples.js samples/typescript/dist/samples/typescript/src/", + "execute:ts-samples": "node ../../../common/scripts/run-samples.js samples/typescript/dist/keyvault-keys/samples/typescript/src/", "execute:samples": "npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples", "extract-api": "tsc -p . && api-extractor run --local", "format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", diff --git a/sdk/keyvault/keyvault-secrets/package.json b/sdk/keyvault/keyvault-secrets/package.json index da14045386a1..131b077da480 100644 --- a/sdk/keyvault/keyvault-secrets/package.json +++ b/sdk/keyvault/keyvault-secrets/package.json @@ -52,7 +52,7 @@ "check-format": "prettier --list-different --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "clean": "rimraf dist dist-esm dist-test types *.tgz *.log dist-browser statistics.html coverage && rimraf src/**/*.js && rimraf test/**/*.js", "execute:js-samples": "node ../../../common/scripts/run-samples.js samples/javascript/", - "execute:ts-samples": "node ../../../common/scripts/run-samples.js samples/typescript/dist/samples/typescript/src/", + "execute:ts-samples": "node ../../../common/scripts/run-samples.js samples/typescript/dist/keyvault-secrets/samples/typescript/src/", "execute:samples": "npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples", "extract-api": "tsc -p . && api-extractor run --local", "format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",