Skip to content

Commit aa2120a

Browse files
authored
[storage-file-share] Migrate to latest test recorder & test proxy (Azure#26149)
### Packages impacted by this PR `@azure/storage-file-share` ### Issues associated with this PR Azure#23427 ### Describe the problem that is addressed by this PR Migrate to use the latest test recorder based on the standard EngSys test proxy. This will allow us to migrate recordings out of the repository in a future PR.
1 parent 8e4aa78 commit aa2120a

File tree

775 files changed

+106069
-71799
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

775 files changed

+106069
-71799
lines changed

sdk/storage/storage-file-share/karma.conf.js

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
// https://github.com/karma-runner/karma-chrome-launcher
22
process.env.CHROME_BIN = require("puppeteer").executablePath();
33
require("dotenv").config({ path: "./.env" });
4-
const {
5-
jsonRecordingFilterFunction,
6-
isPlaybackMode,
7-
isSoftRecordMode,
8-
isRecordMode,
9-
} = require("@azure-tools/test-recorder");
4+
const { relativeRecordingsPath } = require("@azure-tools/test-recorder");
5+
6+
process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath();
107

118
module.exports = function (config) {
129
config.set({
@@ -26,15 +23,13 @@ module.exports = function (config) {
2623
"karma-coverage",
2724
"karma-sourcemap-loader",
2825
"karma-junit-reporter",
29-
"karma-json-to-file-reporter",
30-
"karma-json-preprocessor",
3126
],
3227

3328
// list of files / patterns to load in the browser
3429
files: [
3530
"dist-test/index.browser.js",
3631
{ pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true },
37-
].concat(isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : []),
32+
],
3833

3934
// list of files / patterns to exclude
4035
exclude: [],
@@ -46,7 +41,6 @@ module.exports = function (config) {
4641
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
4742
// Preprocess source file to calculate code coverage, however this will make source file unreadable
4843
// "dist-test/index.browser.js": ["coverage"],
49-
"recordings/browsers/**/*.json": ["json"],
5044
},
5145

5246
// inject following environment values into browser testing with window.__env__
@@ -60,12 +54,13 @@ module.exports = function (config) {
6054
"PREMIUM_FILE_ACCOUNT_NAME",
6155
"PREMIUM_FILE_ACCOUNT_SAS",
6256
"TEST_MODE",
57+
"RECORDINGS_RELATIVE_PATH",
6358
],
6459

6560
// test results reporter to use
6661
// possible values: 'dots', 'progress'
6762
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
68-
reporters: ["mocha", "coverage", "junit", "json-to-file"],
63+
reporters: ["mocha", "coverage", "junit"],
6964

7065
coverageReporter: {
7166
// specify a common output directory
@@ -88,12 +83,6 @@ module.exports = function (config) {
8883
properties: {}, // key value pair of properties to add to the <properties> section of the report
8984
},
9085

91-
jsonToFileReporter: {
92-
// required - to save the recordings of browser tests
93-
filter: jsonRecordingFilterFunction,
94-
outputPath: ".",
95-
},
96-
9786
// web server port
9887
port: 9876,
9988

@@ -123,9 +112,6 @@ module.exports = function (config) {
123112
browserNoActivityTimeout: 1200000,
124113
browserDisconnectTimeout: 10000,
125114
browserDisconnectTolerance: 3,
126-
browserConsoleLogOptions: {
127-
terminal: !isRecordMode(),
128-
},
129115

130116
client: {
131117
mocha: {

sdk/storage/storage-file-share/package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@
4747
"execute:samples": "dev-tool samples run samples-dev",
4848
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
4949
"generate:client": "autorest --typescript ./swagger/README.md",
50-
"integration-test:browser": "karma start --single-run",
51-
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000 \"dist-esm/storage-file-share/test/*.spec.js\" \"dist-esm/storage-file-share/test/node/*.spec.js\"",
50+
"integration-test:browser": "dev-tool run test:browser",
51+
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/storage-file-share/test/**/*.spec.js'",
5252
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
5353
"lint:fix": "eslint package.json api-extractor.json README.md src test --ext .ts,.javascript,.js --fix",
5454
"lint": "eslint package.json api-extractor.json README.md src test --ext .ts,.javascript,.js",
5555
"pack": "npm pack 2>&1",
5656
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
5757
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
5858
"test": "npm run clean && npm run build:test && npm run unit-test",
59-
"unit-test:browser": "karma start --single-run",
60-
"unit-test:node": "mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}*.spec.ts\"",
59+
"unit-test:browser": "dev-tool run test:browser",
60+
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
6161
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
6262
},
6363
"files": [
@@ -142,7 +142,8 @@
142142
"@azure/dev-tool": "^1.0.0",
143143
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
144144
"@azure/test-utils": "^1.0.0",
145-
"@azure-tools/test-recorder": "^1.0.0",
145+
"@azure-tools/test-credential": "^1.0.0",
146+
"@azure-tools/test-recorder": "^3.0.0",
146147
"@azure/test-utils-perf": "^1.0.0",
147148
"@microsoft/api-extractor": "^7.31.1",
148149
"@types/chai": "^4.1.6",
@@ -163,8 +164,6 @@
163164
"karma-coverage": "^2.0.0",
164165
"karma-env-preprocessor": "^0.1.1",
165166
"karma-firefox-launcher": "^1.1.0",
166-
"karma-json-preprocessor": "^0.3.3",
167-
"karma-json-to-file-reporter": "^1.0.1",
168167
"karma-junit-reporter": "^2.0.1",
169168
"karma-mocha": "^2.0.1",
170169
"karma-mocha-reporter": "^2.2.5",

sdk/storage/storage-file-share/recordings/browsers/aborter/recording_should_abort_after_aborter_timeout.json

Lines changed: 4 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/storage/storage-file-share/recordings/browsers/aborter/recording_should_abort_after_parent_aborter_calls_abort.json

Lines changed: 4 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/storage/storage-file-share/recordings/browsers/aborter/recording_should_abort_when_calling_abort_before_request_finishes.json

Lines changed: 4 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/storage/storage-file-share/recordings/browsers/aborter/recording_should_not_abort_after_calling_abort.json

Lines changed: 84 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)