From b85d3c6920665a755fa0c7760cf73d0df44f750b Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Mon, 23 Jul 2018 14:00:06 +0100 Subject: [PATCH] mgr/dashboard: Remove karma packages Since we are no longer using karma for the frontend unit tests, we will remove all the related packages and configurations. This includes the removal of the phantomjs package. Signed-off-by: Tiago Melo --- .../mgr/dashboard/frontend/angular.json | 23 ----------- .../mgr/dashboard/frontend/karma.conf.js | 41 ------------------- .../mgr/dashboard/frontend/package.json | 8 ---- src/pybind/mgr/dashboard/frontend/src/test.ts | 33 --------------- 4 files changed, 105 deletions(-) delete mode 100644 src/pybind/mgr/dashboard/frontend/karma.conf.js delete mode 100644 src/pybind/mgr/dashboard/frontend/src/test.ts diff --git a/src/pybind/mgr/dashboard/frontend/angular.json b/src/pybind/mgr/dashboard/frontend/angular.json index 96a685f4e8a15..35d23369aa4d2 100644 --- a/src/pybind/mgr/dashboard/frontend/angular.json +++ b/src/pybind/mgr/dashboard/frontend/angular.json @@ -69,29 +69,6 @@ "browserTarget": "ceph-dashboard:build" } }, - "test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { - "main": "src/test.ts", - "karmaConfig": "./karma.conf.js", - "polyfills": "src/polyfills.ts", - "tsConfig": "src/tsconfig.spec.json", - "scripts": [ - "node_modules/chart.js/dist/Chart.bundle.js" - ], - "styles": [ - "node_modules/bootstrap/dist/css/bootstrap.css", - "node_modules/ng2-toastr/bundles/ng2-toastr.min.css", - "node_modules/fork-awesome/css/fork-awesome.css", - "node_modules/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css", - "src/styles.scss" - ], - "assets": [ - "src/assets", - "src/favicon.ico" - ] - } - }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { diff --git a/src/pybind/mgr/dashboard/frontend/karma.conf.js b/src/pybind/mgr/dashboard/frontend/karma.conf.js deleted file mode 100644 index 81e6bb5ec0964..0000000000000 --- a/src/pybind/mgr/dashboard/frontend/karma.conf.js +++ /dev/null @@ -1,41 +0,0 @@ -// Karma configuration file, see link for more information -// https://karma-runner.github.io/1.0/config/configuration-file.html - -module.exports = function (config) { - config.set({ - basePath: '', - frameworks: ['jasmine', '@angular-devkit/build-angular'], - plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage-istanbul-reporter'), - require('@angular-devkit/build-angular/plugins/karma'), - require('karma-phantomjs-launcher'), - require('karma-junit-reporter') - ], - client:{ - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - coverageIstanbulReporter: { - dir: require('path').join(__dirname, 'coverage'), - reports: ['html', 'lcovonly', 'cobertura'], - fixWebpackSourcePaths: true - }, - angularCli: { - environment: 'dev' - }, - reporters: ['progress', 'kjhtml', 'junit'], - junitReporter: { - 'outputFile': 'junit.frontend.xml', - 'suite': 'dashboard', - 'useBrowserName': false - }, - port: 9876, - colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, - browsers: ['Chrome'], - singleRun: false - }); -}; diff --git a/src/pybind/mgr/dashboard/frontend/package.json b/src/pybind/mgr/dashboard/frontend/package.json index 9975c6e9b6c8c..5bf91fd393cbd 100644 --- a/src/pybind/mgr/dashboard/frontend/package.json +++ b/src/pybind/mgr/dashboard/frontend/package.json @@ -76,14 +76,6 @@ "jest": "23.2.0", "jest-canvas-mock": "1.0.3", "jest-preset-angular": "5.2.3", - "karma": "2.0.4", - "karma-chrome-launcher": "2.2.0", - "karma-cli": "1.0.1", - "karma-coverage-istanbul-reporter": "2.0.1", - "karma-jasmine": "1.1.2", - "karma-jasmine-html-reporter": "1.1.0", - "karma-junit-reporter": "1.2.0", - "karma-phantomjs-launcher": "1.0.4", "prettier": "1.13.6", "pretty-quick": "1.6.0", "protractor": "5.3.2", diff --git a/src/pybind/mgr/dashboard/frontend/src/test.ts b/src/pybind/mgr/dashboard/frontend/src/test.ts deleted file mode 100644 index 19beece05c8cf..0000000000000 --- a/src/pybind/mgr/dashboard/frontend/src/test.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* tslint:disable:ordered-imports */ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/dist/long-stack-trace-zone'; -import 'zone.js/dist/proxy.js'; -import 'zone.js/dist/sync-test'; -import 'zone.js/dist/jasmine-patch'; -import 'zone.js/dist/async-test'; -import 'zone.js/dist/fake-async-test'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. -declare const __karma__: any; -declare const require: any; - -// Prevent Karma from running prematurely. -__karma__.loaded = function () {}; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); -// Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); -// And load the modules. -context.keys().map(context); -// Finally, start Karma to run the tests. -__karma__.start(); -- 2.39.5