Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[keyvault] Migrate keyvault-secrets to new recorder #23496

Merged
merged 2 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions sdk/keyvault/keyvault-secrets/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// https://github.com/karma-runner/karma-chrome-launcher
process.env.CHROME_BIN = require("puppeteer").executablePath();
require("dotenv").config();
const {
jsonRecordingFilterFunction,
isPlaybackMode,
isSoftRecordMode,
isRecordMode,
} = require("@azure-tools/test-recorder");

process.env.RECORDINGS_RELATIVE_PATH =
require("@azure-tools/test-recorder").relativeRecordingsPath();

module.exports = function (config) {
config.set({
Expand All @@ -24,21 +21,17 @@ module.exports = function (config) {
"karma-coverage",
"karma-sourcemap-loader",
"karma-junit-reporter",
"karma-json-to-file-reporter",
"karma-json-preprocessor",
],

files: [
"dist-test/index.browser.js",
{ pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true },
].concat(isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : []),
],

exclude: [],

preprocessors: {
"**/*.js": ["sourcemap", "env"],
// "dist-test/index.browser.js": ["coverage"],
"recordings/browsers/**/*.json": ["json"],
},

envPreprocessor: [
Expand All @@ -48,9 +41,10 @@ module.exports = function (config) {
"KEYVAULT_URI",
"TEST_MODE",
"AZURE_AUTHORITY_HOST",
"RECORDINGS_RELATIVE_PATH",
],

reporters: ["mocha", "coverage", "junit", "json-to-file"],
reporters: ["mocha", "coverage", "junit"],

coverageReporter: {
// specify a common output directory
Expand All @@ -73,12 +67,6 @@ module.exports = function (config) {
properties: {},
},

jsonToFileReporter: {
// required - to save the recordings of browser tests
filter: jsonRecordingFilterFunction,
outputPath: ".",
},

port: 9330,
colors: true,
logLevel: config.LOG_INFO,
Expand All @@ -100,10 +88,6 @@ module.exports = function (config) {
browserNoActivityTimeout: 350000,
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 3,
browserConsoleLogOptions: {
// IMPORTANT: COMMENT the following line if you want to print debug logs in your browsers in record mode!!
terminal: !isRecordMode(),
},

client: {
mocha: {
Expand Down
16 changes: 7 additions & 9 deletions sdk/keyvault/keyvault-secrets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"generate:client": "autorest --typescript swagger/README.md",
"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 350000 --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:browser": "dev-tool run test:browser",
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 350000 'dist-esm/**/*.spec.js'",
"integration-test:node:no-timeout": "dev-tool run test:node-js-input -- --no-timeout '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",
"pack": "npm pack 2>&1",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
"test": "npm run clean && npm run build:test && npm run unit-test",
"unit-test:browser": "karma start --single-run",
"unit-test:node": "mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 250000 --full-trace \"test/{,!(browser)/**/}*.spec.ts\"",
"unit-test:node:no-timeout": "mocha --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --no-timeouts --full-trace \"dist-test/index.node.js\"",
"unit-test:browser": "dev-tool run test:browser",
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 250000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
"unit-test:node:no-timeout": "dev-tool run test:node-ts-input -- --no-timeout --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"sideEffects": false,
Expand Down Expand Up @@ -118,7 +118,7 @@
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^2.1.0-beta.2",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-recorder": "^1.0.0",
"@azure-tools/test-recorder": "^2.0.0",
"@azure-tools/test-credential": "^1.0.0",
"@microsoft/api-extractor": "^7.31.1",
"@types/mocha": "^7.0.2",
Expand All @@ -135,8 +135,6 @@
"karma-env-preprocessor": "^0.1.1",
"karma-firefox-launcher": "^1.1.0",
"karma-ie-launcher": "^1.0.0",
"karma-json-preprocessor": "^0.3.3",
"karma-json-to-file-reporter": "^1.0.1",
"karma-junit-reporter": "^2.0.1",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
Expand Down
Loading