-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Recording and Download APIs (#18147)
* 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
1 parent
51aac4a
commit 5744997
Showing
42 changed files
with
2,597 additions
and
651 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
137
sdk/communication/communication-callingserver/karma.conf.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
.../communication-callingserver/recordings/browsers/download_content/recording_download.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
...llingserver/recordings/browsers/download_content/recording_download_with_redirection.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
...n-callingserver/recordings/browsers/download_content/recording_unauthorized_download.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.