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

[Recorder] Unified recorder prototyping with storage-queue/data-tables SDKs #15826

Merged
merged 117 commits into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
d13f614
update rush.json
HarshaNalluru Jun 3, 2021
c1f1145
lock file
HarshaNalluru Jun 3, 2021
e71e26f
package.json, rollup and tsconfig
HarshaNalluru Jun 3, 2021
9b3c32e
src file
HarshaNalluru Jun 3, 2021
77bc49b
test
HarshaNalluru Jun 3, 2021
2b83ec6
add recorder.stop call
HarshaNalluru Jun 3, 2021
e5d5269
set http
HarshaNalluru Jun 3, 2021
8c3828b
set protocol to http
HarshaNalluru Jun 3, 2021
f630cda
core-rest-pipeline draft
HarshaNalluru Jun 8, 2021
470b842
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-js in…
HarshaNalluru Jun 8, 2021
224bbee
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-js in…
HarshaNalluru Jun 9, 2021
2368ff7
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-js in…
HarshaNalluru Jun 15, 2021
8d76e96
storage test
HarshaNalluru Jun 16, 2021
7a11116
keep only the storage test
HarshaNalluru Jun 17, 2021
29fca04
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Jul 8, 2021
07267b2
lock file
HarshaNalluru Jul 8, 2021
e9efe0a
update package.json
HarshaNalluru Jul 8, 2021
593f583
recorder-new
HarshaNalluru Jul 8, 2021
10c96ac
lock file
HarshaNalluru Jul 8, 2021
2ac2a7b
undefined to null
HarshaNalluru Jul 8, 2021
5e633c3
remove target es5
HarshaNalluru Jul 9, 2021
62e7e54
add a guide with starter steps
HarshaNalluru Jul 9, 2021
af29558
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Jul 9, 2021
edf3644
testing-recorder-new
HarshaNalluru Jul 9, 2021
b7ca3af
lock file
HarshaNalluru Jul 9, 2021
2c702f9
types - recorder-new
HarshaNalluru Jul 9, 2021
4b0bfda
import urlBuilder from core-http
HarshaNalluru Jul 9, 2021
f74f134
disclaimer in the guide
HarshaNalluru Jul 9, 2021
ab42bd1
comment out the test in recorder-new
HarshaNalluru Jul 9, 2021
500016c
testing recorder-new setup and test
HarshaNalluru Jul 9, 2021
4208082
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Jul 9, 2021
5b36133
rest-pipeline 1.1.0
HarshaNalluru Jul 9, 2021
8febc81
lock file
HarshaNalluru Jul 9, 2021
28fc698
"versionPolicyName": "test" and sdkType
HarshaNalluru Jul 9, 2021
710ceb4
karma.conf
HarshaNalluru Jul 9, 2021
c56bdb2
fix package.json
HarshaNalluru Jul 9, 2021
7d71697
update test to take sas url
HarshaNalluru Jul 9, 2021
bb5f0c3
omit readme checks for testing-recorder-new, recorder-new
HarshaNalluru Jul 12, 2021
12e8999
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Jul 12, 2021
aff2b98
lock file from master
HarshaNalluru Jul 12, 2021
0727862
lock file and readmes
HarshaNalluru Jul 12, 2021
bdb22e8
remove TEST_MODE variable
HarshaNalluru Jul 12, 2021
bdf1b46
update readme with temp-location
HarshaNalluru Jul 12, 2021
b5523e5
resources update
HarshaNalluru Jul 12, 2021
e7f3560
skip runnign in ci
HarshaNalluru Jul 12, 2021
4dfbef7
update package.json
HarshaNalluru Jul 12, 2021
8b084ad
remove console.logs and fix queue name
HarshaNalluru Jul 12, 2021
879cae3
fix browser mappings
HarshaNalluru Jul 12, 2021
249f915
index.browser.ts and console.logs
HarshaNalluru Jul 12, 2021
dc3cbae
remove .olg from clean command
HarshaNalluru Jul 12, 2021
40c1074
test file with logs
HarshaNalluru Jul 12, 2021
bb9126a
update readme
HarshaNalluru Jul 13, 2021
90249b0
update readme to reflect additional environment variables that must b…
scbedd Jul 13, 2021
ebd33d9
login steps
HarshaNalluru Jul 21, 2021
5ec3d61
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Aug 20, 2021
84d204e
lock file
HarshaNalluru Aug 20, 2021
1a85cd1
test file
HarshaNalluru Aug 20, 2021
dfa3838
Copying the recordings saved in the container
HarshaNalluru Aug 20, 2021
f181829
remove console logs
HarshaNalluru Aug 20, 2021
9b1f2ab
"@azure/data-tables": "^12.1.2"
HarshaNalluru Aug 20, 2021
a7db71f
dependencies
HarshaNalluru Aug 20, 2021
99fec55
rename test file
HarshaNalluru Aug 20, 2021
64c1964
core-v2 recorder first draft
HarshaNalluru Aug 20, 2021
727f294
core-v2 node test works
HarshaNalluru Aug 20, 2021
335f48c
karma-conf fix
HarshaNalluru Aug 20, 2021
968e17b
uri -> url
HarshaNalluru Aug 20, 2021
eee1249
update tests
HarshaNalluru Aug 21, 2021
bbe4571
refactor core-v1 and core-v2 recorder clients
HarshaNalluru Aug 21, 2021
2de33b5
refactor common code between core-v1 core-v2 and node and browser
HarshaNalluru Aug 21, 2021
a27e3a2
renames and underscore removals
HarshaNalluru Aug 21, 2021
079bec9
typings -> types
HarshaNalluru Aug 21, 2021
675fe90
address feedback
HarshaNalluru Aug 21, 2021
1ff021a
RecordingStateManager
HarshaNalluru Aug 21, 2021
6eac674
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Aug 21, 2021
cfb162e
lock file
HarshaNalluru Aug 21, 2021
43356fd
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Aug 23, 2021
5395f69
lock file
HarshaNalluru Aug 23, 2021
5cec898
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Aug 24, 2021
a4ce6d8
lock file from master
HarshaNalluru Aug 24, 2021
b5f384a
lock file
HarshaNalluru Aug 24, 2021
370019b
recorder-new package test skipped
HarshaNalluru Aug 24, 2021
a589bf1
delete commented test file
HarshaNalluru Aug 24, 2021
6f066c0
Update sdk/test-utils/testing-recorder-new/README.md
HarshaNalluru Aug 24, 2021
090d2e5
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Aug 24, 2021
bf97266
empty test file
HarshaNalluru Aug 24, 2021
2e0eec2
lock file
HarshaNalluru Aug 24, 2021
df0a4f3
Merge branch 'harshan/recorder/unified' of https://github.com/HarshaN…
HarshaNalluru Aug 24, 2021
c04e92b
add link descriptions
HarshaNalluru Aug 24, 2021
d8629f1
Daniel's feedback
HarshaNalluru Aug 24, 2021
e030f45
Update sdk/test-utils/recorder-new/README.md
HarshaNalluru Aug 24, 2021
eb26b85
Scott's feedback
HarshaNalluru Aug 24, 2021
dec81b5
Merge branch 'harshan/recorder/unified' of https://github.com/HarshaN…
HarshaNalluru Aug 24, 2021
5508864
Addressing Will's feedback
HarshaNalluru Aug 24, 2021
9284c12
Add tslib
HarshaNalluru Aug 24, 2021
416509b
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Aug 25, 2021
93123c7
RecordingState
HarshaNalluru Aug 25, 2021
09dc6bb
lock file
HarshaNalluru Aug 25, 2021
07838e8
currentState
HarshaNalluru Aug 26, 2021
9e0dfb5
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Aug 26, 2021
a3b95c2
Merge branch 'harshan/recorder/unified' of https://github.com/HarshaN…
HarshaNalluru Aug 26, 2021
bee2997
lock file
HarshaNalluru Aug 26, 2021
c200a0e
docker cp
HarshaNalluru Aug 26, 2021
af43aa5
remove lib from tsconfig
HarshaNalluru Aug 26, 2021
d8a1459
more feedback
HarshaNalluru Aug 26, 2021
0103399
utils file and base tests
HarshaNalluru Aug 26, 2021
ccc8f3c
update error message
HarshaNalluru Aug 26, 2021
626724c
initial set of tests
HarshaNalluru Aug 26, 2021
293f78a
Add copyright headers
HarshaNalluru Aug 26, 2021
63bdbcd
No need of the if checks
HarshaNalluru Aug 26, 2021
e72e3a2
both Test_Modes
HarshaNalluru Aug 26, 2021
03dff7d
Append ${testMode} mode:
HarshaNalluru Aug 26, 2021
0d0694c
karma conf and tests
HarshaNalluru Aug 26, 2021
45e5743
Daniel's new found love - npm run clean move from prebuild to build
HarshaNalluru Aug 26, 2021
c2dd7b9
Added many many comments for Daniel 🐱‍👤
HarshaNalluru Aug 26, 2021
b9ef37d
lock file
HarshaNalluru Aug 26, 2021
0b05af6
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Aug 26, 2021
93b7d0f
package renames
HarshaNalluru Aug 26, 2021
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
117 changes: 113 additions & 4 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions eng/.docsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ omitted_paths:
- sdk/servicefabric/servicefabric/README.md
- sdk/storage/storage-datalake/README.md
- sdk/storage/storage-internal-avro/*
- sdk/test-utils/perfstress/README.md
- sdk/test-utils/multi-version/README.md
- sdk/test-utils/*/README.md

language: js
root_check_enabled: True
required_readme_sections:
Expand Down
10 changes: 10 additions & 0 deletions rush.json
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,11 @@
"projectFolder": "sdk/template/template",
"versionPolicyName": "client"
},
{
"packageName": "@azure-tools/testing-recorder-new",
"projectFolder": "sdk/test-utils/testing-recorder-new",
"versionPolicyName": "test"
},
{
"packageName": "@azure/eslint-plugin-azure-sdk",
"projectFolder": "common/tools/eslint-plugin-azure-sdk",
Expand All @@ -696,6 +701,11 @@
"projectFolder": "sdk/test-utils/recorder",
"versionPolicyName": "utility"
},
{
"packageName": "@azure-tools/test-recorder-new",
"projectFolder": "sdk/test-utils/recorder-new",
"versionPolicyName": "utility"
},
{
"packageName": "@azure/test-utils-perfstress",
"projectFolder": "sdk/test-utils/perfstress",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/event-hubs": "^5.6.0",
"@azure/data-tables": "^12.1.1",
"@azure/data-tables": "^12.1.2",
"@azure/logger": "^1.0.0",
"tslib": "^2.2.0"
},
Expand Down
2 changes: 1 addition & 1 deletion sdk/tables/perf-tests/data-tables/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@azure/data-tables": "^12.1.1",
"@azure/data-tables": "^12.1.2",
"@azure/test-utils-perfstress": "^1.0.0",
"dotenv": "^8.2.0",
"uuid": "^8.3.0"
Expand Down
38 changes: 38 additions & 0 deletions sdk/test-utils/recorder-new/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Azure @azure-tools/test-recorder-new library for JavaScript

This is an experimental tool to record and playback the tests in the JS repo by leveraging the unified out-of-process test proxy server. This library is still under construction.
Feature work is being tracked at [#15829](https://github.com/Azure/azure-sdk-for-js/issues/15829)

## Resources

- [Azure SDK Tools Test Proxy](https://github.com/Azure/azure-sdk-tools/tree/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy)
- [Using Test Proxy with docker container](https://github.com/Azure/azure-sdk-tools/tree/main/tools/test-proxy/docker#build-and-run)

## Running the proxy server

Run this command

> `docker run -v temp-location:/etc/testproxy -p 5001:5001 -p 5000:5000 azsdkengsys.azurecr.io/engsys/testproxy-lin:latest`
HarshaNalluru marked this conversation as resolved.
Show resolved Hide resolved

(Eventually, recorder will trigger this for you!)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!!!


[Note: Update `temp-location` in the command to your desired location.]

If the above command doesn't work directly, try [Troubleshooting Access to Public Container Registry](https://github.com/Azure/azure-sdk-tools/tree/main/tools/test-proxy/docker#troubleshooting-access-to-public-container-registry).

Reference: [Using Test Proxy with docker container](https://github.com/Azure/azure-sdk-tools/tree/main/tools/test-proxy/docker#build-and-run)

## Run the tests using recorder-new at `test-utils/testing-recorder-new`

- Navigate to the test-utils\testing-recorder-new folder
- Run `rush update && rush build -t .`
- Run `rushx test:node`
- Run `rushx test:browser`

## Copying the recordings saved in the container

For some reason, the volume mapping did not work for you, copy the recordings manually.

- `docker cp <container_id>:/etc/testproxy/ temp-location`
HarshaNalluru marked this conversation as resolved.
Show resolved Hide resolved

[This will be fixed eventually [#Issue-17138](https://github.com/Azure/azure-sdk-for-js/issues/17138)]
127 changes: 127 additions & 0 deletions sdk/test-utils/recorder-new/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// https://github.com/karma-runner/karma-chrome-launcher
process.env.CHROME_BIN = require("puppeteer").executablePath();
require("dotenv").config({ path: "../.env" });

module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: "./",

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ["mocha"],

plugins: [
"karma-mocha",
"karma-mocha-reporter",
"karma-chrome-launcher",
"karma-edge-launcher",
"karma-firefox-launcher",
"karma-ie-launcher",
"karma-env-preprocessor",
"karma-coverage",
"karma-sourcemap-loader",
"karma-junit-reporter",
"karma-json-preprocessor"
],

// list of files / patterns to load in the browser
files: [
"dist-test/index.browser.js",
{ pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true }
],

// list of files / patterns to exclude
exclude: [],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.js": ["sourcemap", "env"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
// "dist-test/index.browser.js": ["coverage"]
},

// inject following environment values into browser testing with window.__env__
// environment values MUST be exported or set with same console running "karma start"
// https://www.npmjs.com/package/karma-env-preprocessor
// envPreprocessor: [],

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["mocha", "coverage", "junit"],

coverageReporter: {
// specify a common output directory
dir: "coverage-browser/",
reporters: [
{ type: "json", subdir: ".", file: "coverage.json" },
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
{ type: "html", subdir: "html" },
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" }
]
},

junitReporter: {
outputDir: "", // results will be saved as $outputDir/$browserName.xml
outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile
suite: "", // suite will become the package name attribute in xml testsuite element
useBrowserName: false, // add browser name to report and classes names
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {} // key value pair of properties to add to the <properties> section of the report
},

// web server port
port: 9328,

// enable / disable colors in the output (reporters and logs)
colors: true,

// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,

// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
// 'ChromeHeadless', 'Chrome', 'Firefox', 'Edge', 'IE'
// --no-sandbox allows our tests to run in Linux without having to change the system.
// --disable-web-security allows us to authenticate from the browser without having to write tests using interactive auth, which would be far more complex.
browsers: ["ChromeHeadlessNoSandbox"],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: "ChromeHeadless",
flags: ["--no-sandbox", "--disable-web-security"]
}
},

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,

// Concurrency level
// how many browser should be started simultaneous
concurrency: 1,

browserNoActivityTimeout: 600000,
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 3,
browserConsoleLogOptions: {
// We would usually hide the logs from the tests, but we don't need to do this inside of the recorder package because we are not recording the tests.
// // terminal: process.env.TEST_MODE !== "record"
},

client: {
mocha: {
// change Karma's debug.html to the mocha web reporter
reporter: "html",
timeout: "600000"
}
}
});
};
Loading