Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9158f92

Browse files
authored
[Anomaly Detector] Enable CI and add tests (#23725)
* Enable CI * Add changelog * Fix format * Fix package pipeline name * Set correct version * Fix env variable name * Re-record
1 parent 526926a commit 9158f92

14 files changed

+1005
-39
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release History
2+
3+
## 1.0.0-beta.1 (2022-11-08)
4+
5+
- First release of package, see README.md for details.

sdk/anomalydetector/ai-anomaly-detector-rest/karma.conf.js

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require("dotenv").config();
77
const { relativeRecordingsPath } = require("@azure-tools/test-recorder");
88
process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath();
99

10-
module.exports = function(config) {
10+
module.exports = function (config) {
1111
config.set({
1212
// base path that will be used to resolve all patterns (eg. files, exclude)
1313
basePath: "./",
@@ -27,7 +27,7 @@ module.exports = function(config) {
2727
"karma-coverage",
2828
"karma-sourcemap-loader",
2929
"karma-junit-reporter",
30-
"karma-source-map-support"
30+
"karma-source-map-support",
3131
],
3232

3333
// list of files / patterns to load in the browser
@@ -37,8 +37,8 @@ module.exports = function(config) {
3737
pattern: "dist-test/index.browser.js.map",
3838
type: "html",
3939
included: false,
40-
served: true
41-
}
40+
served: true,
41+
},
4242
],
4343

4444
// list of files / patterns to exclude
@@ -47,19 +47,17 @@ module.exports = function(config) {
4747
// preprocess matching files before serving them to the browser
4848
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
4949
preprocessors: {
50-
"**/*.js": ["sourcemap", "env"]
50+
"**/*.js": ["sourcemap", "env"],
5151
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
5252
// Preprocess source file to calculate code coverage, however this will make source file unreadable
5353
// "dist-test/index.js": ["coverage"]
5454
},
5555

5656
envPreprocessor: [
5757
"TEST_MODE",
58-
"ENDPOINT",
59-
"AZURE_CLIENT_SECRET",
60-
"AZURE_CLIENT_ID",
61-
"AZURE_TENANT_ID",
62-
"SUBSCRIPTION_ID"
58+
"ANOMALY_DETECTOR_API_KEY",
59+
"ANOMALY_DETECTOR_ENDPOINT",
60+
"RECORDINGS_RELATIVE_PATH",
6361
],
6462

6563
// test results reporter to use
@@ -74,8 +72,8 @@ module.exports = function(config) {
7472
{ type: "json", subdir: ".", file: "coverage.json" },
7573
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
7674
{ type: "html", subdir: "html" },
77-
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" }
78-
]
75+
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" },
76+
],
7977
},
8078

8179
junitReporter: {
@@ -85,7 +83,7 @@ module.exports = function(config) {
8583
useBrowserName: false, // add browser name to report and classes names
8684
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
8785
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
88-
properties: {} // key value pair of properties to add to the <properties> section of the report
86+
properties: {}, // key value pair of properties to add to the <properties> section of the report
8987
},
9088

9189
// web server port
@@ -107,8 +105,8 @@ module.exports = function(config) {
107105
customLaunchers: {
108106
ChromeHeadlessNoSandbox: {
109107
base: "ChromeHeadless",
110-
flags: ["--no-sandbox", "--disable-web-security"]
111-
}
108+
flags: ["--no-sandbox", "--disable-web-security"],
109+
},
112110
},
113111

114112
// Continuous Integration mode
@@ -127,8 +125,8 @@ module.exports = function(config) {
127125
mocha: {
128126
// change Karma's debug.html to the mocha web reporter
129127
reporter: "html",
130-
timeout: "600000"
131-
}
132-
}
128+
timeout: "600000",
129+
},
130+
},
133131
});
134132
};

0 commit comments

Comments
 (0)