From: Ricardo Dias Date: Fri, 26 Jan 2018 14:50:46 +0000 (+0000) Subject: mgr/dashboard_v2: add support for frontend CI coverage and unit testing X-Git-Tag: v13.0.2~84^2~128 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d57b092f28a8beffc5e5976f78d7aace594f91d7;p=ceph.git mgr/dashboard_v2: add support for frontend CI coverage and unit testing Signed-off-by: Ricardo Dias --- diff --git a/src/pybind/mgr/dashboard_v2/frontend/karma.conf.js b/src/pybind/mgr/dashboard_v2/frontend/karma.conf.js index af139fada363..95969e05ce41 100644 --- a/src/pybind/mgr/dashboard_v2/frontend/karma.conf.js +++ b/src/pybind/mgr/dashboard_v2/frontend/karma.conf.js @@ -10,19 +10,26 @@ module.exports = function (config) { require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), - require('@angular/cli/plugins/karma') + require('@angular/cli/plugins/karma'), + require('karma-phantomjs-launcher'), + require('karma-junit-reporter') ], client:{ clearContext: false // leave Jasmine Spec Runner output visible in browser }, coverageIstanbulReporter: { - reports: [ 'html', 'lcovonly' ], + reports: [ 'html', 'lcovonly', 'cobertura' ], fixWebpackSourcePaths: true }, angularCli: { environment: 'dev' }, - reporters: ['progress', 'kjhtml'], + reporters: ['progress', 'kjhtml', 'junit'], + junitReporter: { + 'outputFile': 'junit.frontend.xml', + 'suite': 'dashboard_v2', + 'useBrowserName': false + }, port: 9876, colors: true, logLevel: config.LOG_INFO, diff --git a/src/pybind/mgr/dashboard_v2/frontend/package.json b/src/pybind/mgr/dashboard_v2/frontend/package.json index 8a6ce84fd359..a4551e9fad3e 100644 --- a/src/pybind/mgr/dashboard_v2/frontend/package.json +++ b/src/pybind/mgr/dashboard_v2/frontend/package.json @@ -45,6 +45,8 @@ "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", + "karma-junit-reporter": "^1.2.0", + "karma-phantomjs-launcher": "^1.0.4", "protractor": "~5.1.2", "ts-node": "~3.2.0", "tslint": "~5.7.0", diff --git a/src/pybind/mgr/dashboard_v2/frontend/src/polyfills.ts b/src/pybind/mgr/dashboard_v2/frontend/src/polyfills.ts index 20d40751a6bc..8586e14afafb 100644 --- a/src/pybind/mgr/dashboard_v2/frontend/src/polyfills.ts +++ b/src/pybind/mgr/dashboard_v2/frontend/src/polyfills.ts @@ -19,20 +19,20 @@ */ /** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/weak-map'; -// import 'core-js/es6/set'; +import 'core-js/es6/symbol'; +import 'core-js/es6/object'; +import 'core-js/es6/function'; +import 'core-js/es6/parse-int'; +import 'core-js/es6/parse-float'; +import 'core-js/es6/number'; +import 'core-js/es6/math'; +import 'core-js/es6/string'; +import 'core-js/es6/date'; +import 'core-js/es6/array'; +import 'core-js/es6/regexp'; +import 'core-js/es6/map'; +import 'core-js/es6/weak-map'; +import 'core-js/es6/set'; /** IE10 and IE11 requires the following for NgClass support on SVG elements */ // import 'classlist.js'; // Run `npm install --save classlist.js`.