Skip to content

Commit

Permalink
Adding Recording and Download APIs (#18147)
Browse files Browse the repository at this point in the history
* Initial API changes for Node JS SDK for calling server

* First test case

* Adding live testing?

* ServerCall Recording test

* Adding recording to the live testing

* Recording live testing completed

* Refactored Live Testing

* Download part 1

* First download test working!

* First download test working!

* First test complete complete

* Adding new test for download

* Fixing tests

* Call recording APIs initial check in

* Fixes based on E2E validation from samples and API document update

* Misc

* Added startRecording attributes

* CHanging test to be a group call

* Live test fixed

* Finalized testing

* Adding redirection test case

* Fixing communication-common lint errors

* Fixing ContentDownloader lint issues

* Lint autofix

* Remove getCall method

* Fixing CallingServerClient lint issues

* Fixing models lint issues

* Fix RetriableReadableStream lint issues

* Fixing specs lint issues

* Fixing testUtils lint issues

* Ran rushx format

* Run rushx format in communication-common

* Adding Changelog file

* Running api-extractor

* Formatting

* Adding review folder

* Api extractor after merge

* Rebuilding

* Attempting to make readable to work

* Fixing Readable issue

* Fixed one browser test

* Removing things from karma

* Browser test #1

* Fixed testing

* Fixing format

* Removing comments

* Running API_EXTRACTOR

* Changing api file

Co-authored-by: Ravi Thanneeru <v-ratann@microsoft.com>
  • Loading branch information
cochi2 and ravithanneeru authored Oct 15, 2021
1 parent 51aac4a commit 5744997
Show file tree
Hide file tree
Showing 42 changed files with 2,597 additions and 651 deletions.
1,177 changes: 586 additions & 591 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion sdk/communication/communication-callingserver/.nycrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"include": ["dist-esm/src/**/*.js"],
"exclude": ["**/*.d.ts", "dist-esm/src/generated/*"],
"exclude": [
"**/*.d.ts",
"dist-esm/src/generated/*",
"dist-esm/src/RepeatableContentDownloadResponse.browser.js"
],
"reporter": ["text-summary", "html", "cobertura"],
"exclude-after-remap": false,
"sourceMap": true,
Expand Down
9 changes: 9 additions & 0 deletions sdk/communication/communication-callingserver/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Release History
## 1.0.0-beta.1 (2021-12-15)

The first preview of the Azure Communication CallingServer Client has the following features:

- create/get/update/delete a call
- add participants
- start/stop/pause/resume a recording of the call
- download the recording content
137 changes: 137 additions & 0 deletions sdk/communication/communication-callingserver/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
// 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");

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-to-file-reporter",
"karma-json-preprocessor"
],

// list of files / patterns to load in the browser
files: ["dist-test/index.browser.js"].concat(
isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : []
),

// 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"],
"recordings/browsers/**/*.json": ["json"]
// 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_MODE", "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING", "BASE_URL"],

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

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
},

jsonToFileReporter: {
filter: jsonRecordingFilterFunction,
outputPath: "."
},

// web server port
port: 9876,

// 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'
browsers: ["HeadlessChrome"],

customLaunchers: {
HeadlessChrome: {
base: "ChromeHeadless",
flags: ["--no-sandbox", "--disable-web-security"]
}
},

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

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

browserNoActivityTimeout: 600000,
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 3,
browserConsoleLogOptions: {
terminal: !isRecordMode()
},

client: {
mocha: {
// change Karma's debug.html to the mocha web reporter
reporter: "html",
timeout: "600000"
}
}
});
};
12 changes: 9 additions & 3 deletions sdk/communication/communication-callingserver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"module": "dist-esm/src/index.js",
"browser": {
"stream": "./node_modules/stream-browserify/index.js",
"./dist-esm/src/credentials/cryptoUtils.js": "./dist-esm/src/credentials/cryptoUtils.browser.js"
"./dist-esm/src/credentials/cryptoUtils.js": "./dist-esm/src/credentials/cryptoUtils.browser.js",
"./dist-esm/src/RepeatableContentDownloadResponse.js": "./dist-esm/src/RepeatableContentDownloadResponse.browser.js",
"./dist-esm/test/public/utils/index.js": "./dist-esm/test/public/utils/index.browser.js"
},
"types": "types/communication-callingserver.d.ts",
"scripts": {
Expand Down Expand Up @@ -72,7 +74,8 @@
"@azure/core-tracing": "1.0.0-preview.13",
"@azure/logger": "^1.0.0",
"events": "^3.0.0",
"tslib": "^2.2.0"
"tslib": "^2.2.0",
"uuid": "^8.3.0"
},
"devDependencies": {
"@azure/dev-tool": "^1.0.0",
Expand All @@ -90,7 +93,9 @@
"@types/chai": "^4.1.6",
"@types/mocha": "^7.0.2",
"@types/node": "^12.0.0",
"@types/node-fetch": "^2.5.0",
"@types/sinon": "^9.0.4",
"@types/uuid": "^8.0.0",
"assert": "^1.4.1",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
Expand Down Expand Up @@ -121,7 +126,8 @@
"sinon": "^9.0.2",
"typescript": "~4.2.0",
"util": "^0.12.1",
"typedoc": "0.15.2"
"typedoc": "0.15.2",
"tslib": "^2.2.0"
},
"//metadata": {
"constantPaths": [
Expand Down

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

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

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

Loading

0 comments on commit 5744997

Please sign in to comment.