Skip to content

Commit cf8eb07

Browse files
joherediscbedd
andauthored
[Tables] Migrating to new recorder (Azure#20164)
* cleanup tests * First set of tests * Table client tests * Table Service * Node Tests * Browser Tests * Fix lint * Update recordings * Fix lint * go after a new version of the test-proxy that dumps the testmismatch * newer proxy version with additional logging. need to pr back this into sdk/tools * return test-proxy to align with main. there are conflicts that are not present in the investigation branch * Update recorded client * Update proxy tool build * fix format * Revert proxy tool version * Ignore headers * Fix format * Use HeaderlessMatcher * Fix format * Fix tests * Remove un needed config Co-authored-by: scbedd <[email protected]>
1 parent 6a1ee2b commit cf8eb07

File tree

205 files changed

+12633
-16185
lines changed

Some content is hidden

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

205 files changed

+12633
-16185
lines changed

sdk/tables/data-tables/karma.conf.js

Lines changed: 6 additions & 17 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();
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({
@@ -41,7 +38,7 @@ module.exports = function (config) {
4138
included: false,
4239
served: true,
4340
},
44-
].concat(isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : []),
41+
],
4542

4643
// list of files / patterns to exclude
4744
exclude: [],
@@ -50,7 +47,6 @@ module.exports = function (config) {
5047
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
5148
preprocessors: {
5249
"**/*.js": ["sourcemap", "env"],
53-
"recordings/browsers/**/*.json": ["json"],
5450
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
5551
// Preprocess source file to calculate code coverage, however this will make source file unreadable
5652
// [`dist-test/${testMode}.index.browser.js`]: ["coverage"]
@@ -70,12 +66,13 @@ module.exports = function (config) {
7066
"AZURE_TENANT_ID",
7167
"AZURE_CLIENT_ID",
7268
"AZURE_CLIENT_SECRET",
69+
"RECORDINGS_RELATIVE_PATH",
7370
],
7471

7572
// test results reporter to use
7673
// possible values: 'dots', 'progress'
7774
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
78-
reporters: ["mocha", "coverage", "junit", "json-to-file"],
75+
reporters: ["mocha", "coverage", "junit"],
7976

8077
coverageReporter: {
8178
// specify a common output directory
@@ -98,11 +95,6 @@ module.exports = function (config) {
9895
properties: {}, // key value pair of properties to add to the <properties> section of the report
9996
},
10097

101-
jsonToFileReporter: {
102-
filter: jsonRecordingFilterFunction,
103-
outputPath: ".",
104-
},
105-
10698
// web server port
10799
port: 9876,
108100

@@ -140,9 +132,6 @@ module.exports = function (config) {
140132
browserNoActivityTimeout: 600000,
141133
browserDisconnectTimeout: 10000,
142134
browserDisconnectTolerance: 3,
143-
browserConsoleLogOptions: {
144-
terminal: !isRecordMode(),
145-
},
146135

147136
client: {
148137
mocha: {

sdk/tables/data-tables/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@
3636
"extract-api": "tsc -p . && api-extractor run --local",
3737
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
3838
"generate:client": "autorest --typescript ./swagger/README.md",
39-
"integration-test:browser": "karma start --single-run",
40-
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace --exclude \"dist-esm/test/**/browser/**/*.spec.js\" \"dist-esm/test/**/*.spec.js\"",
39+
"integration-test:browser": "dev-tool run test:browser",
40+
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'",
4141
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
4242
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
4343
"lint": "eslint package.json api-extractor.json src test --ext .ts",
4444
"pack": "npm pack 2>&1",
4545
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
4646
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
4747
"test": "npm run clean && npm run build:test && npm run unit-test",
48-
"unit-test:browser": "karma start --single-run",
49-
"unit-test:node": "mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace --exclude \"test/**/browser/**/*.spec.ts\" \"test/**/*.spec.ts\"",
48+
"unit-test:browser": "dev-tool run test:browser",
49+
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
5050
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
5151
},
5252
"files": [
@@ -120,7 +120,8 @@
120120
"typescript": "~4.2.0",
121121
"util": "^0.12.1",
122122
"dotenv": "^8.2.0",
123-
"@azure-tools/test-recorder": "^1.0.0",
123+
"@azure-tools/test-recorder": "^2.0.0",
124+
"@azure-tools/test-credential": "^1.0.0",
124125
"@azure/test-utils": "^1.0.0",
125126
"ts-node": "^10.0.0"
126127
},

sdk/tables/data-tables/recordings/browsers/access_policy_operations/recording_should_send_a_null_ap.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

sdk/tables/data-tables/recordings/browsers/batch_operations/recording_should_send_a_set_of_create_actions_when_using_tabletransaction_helper.json

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

sdk/tables/data-tables/recordings/browsers/batch_operations/recording_should_send_a_set_of_create_batch_operations.json

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

0 commit comments

Comments
 (0)