diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 8f9523d762c..397ef5be8c8 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -209,8 +209,10 @@ jobs: exclude: "insights,core,extensions,process-services,process-services-cloud" - name: core exclude: "insights,content-services,process-services,process-services-cloud" - - name: insights and process-services - exclude: "core,extensions,content-services,process-services-cloud" + - name: insights + exclude: "core,extensions,content-services,process-services-cloud,process-services" + - name: process-services + exclude: "core,extensions,content-services,process-services-cloud,insights" - name: process-cloud exclude: "insights,core,extensions,content-services,process-services" steps: diff --git a/angular.json b/angular.json index 3d069417a49..8cfd609044b 100644 --- a/angular.json +++ b/angular.json @@ -337,6 +337,7 @@ "tsConfig": "lib/core/tsconfig.spec.json", "karmaConfig": "lib/core/karma.conf.js", "sourceMap": true, + "codeCoverage": true, "styles": [ "demo-shell/src/assets/fonts/material-icons/material-icons.css" ] @@ -484,7 +485,8 @@ "main": "lib/content-services/src/test.ts", "tsConfig": "lib/content-services/tsconfig.spec.json", "karmaConfig": "lib/content-services/karma.conf.js", - "sourceMap": true + "sourceMap": true, + "codeCoverage": true } }, "lint": { @@ -603,7 +605,8 @@ "main": "lib/process-services/src/test.ts", "tsConfig": "lib/process-services/tsconfig.spec.json", "karmaConfig": "lib/process-services/karma.conf.js", - "sourceMap": true + "sourceMap": true, + "codeCoverage": true } }, "lint": { @@ -688,7 +691,8 @@ "main": "lib/process-services-cloud/src/test.ts", "tsConfig": "lib/process-services-cloud/tsconfig.spec.json", "karmaConfig": "lib/process-services-cloud/karma.conf.js", - "sourceMap": true + "sourceMap": true, + "codeCoverage": true } }, "lint": { @@ -818,7 +822,8 @@ "main": "lib/insights/src/test.ts", "tsConfig": "lib/insights/tsconfig.spec.json", "karmaConfig": "lib/insights/karma.conf.js", - "sourceMap": true + "sourceMap": true, + "codeCoverage": true } }, "lint": { @@ -892,7 +897,8 @@ "main": "lib/extensions/src/test.ts", "tsConfig": "lib/extensions/tsconfig.spec.json", "karmaConfig": "lib/extensions/karma.conf.js", - "sourceMap": true + "sourceMap": true, + "codeCoverage": true } }, "lint": { diff --git a/lib/content-services/karma.conf.js b/lib/content-services/karma.conf.js index a90fcc3d1ec..38be541c583 100644 --- a/lib/content-services/karma.conf.js +++ b/lib/content-services/karma.conf.js @@ -1,5 +1,8 @@ // Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html +const { join } = require('path'); +const { constants } = require('karma'); + module.exports = function (config) { config.set({ basePath: '../../', @@ -55,15 +58,23 @@ module.exports = function (config) { } }, - coverageIstanbulReporter: { - dir: require('path').join(__dirname, '../coverage/content-services'), - reports: ['html', 'lcovonly'], - fixWebpackSourcePaths: true + jasmineHtmlReporter: { + suppressAll: true, // removes the duplicated traces }, - browserDisconnectTimeout: 200000, - browserNoActivityTimeout: 2400000, - captureTimeout: 1200000, + coverageReporter: { + dir: join(__dirname, './coverage/content-services'), + subdir: '.', + reporters: [{ type: 'html' }, { type: 'text-summary' }], + check: { + global: { + statements: 75, + branches: 67, + functions: 73, + lines: 75 + } + } + }, customLaunchers: { ChromeHeadless: { @@ -80,7 +91,7 @@ module.exports = function (config) { reporters: ['mocha', 'kjhtml'], port: 9876, colors: true, - logLevel: config.LOG_INFO, + logLevel: constants.LOG_INFO, autoWatch: true, browsers: ['ChromeHeadless'], singleRun: true diff --git a/lib/core/karma.conf.js b/lib/core/karma.conf.js index 8a2435ab02d..4c1aab8ba43 100644 --- a/lib/core/karma.conf.js +++ b/lib/core/karma.conf.js @@ -1,5 +1,8 @@ // Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html +const { join } = require('path'); +const { constants } = require('karma'); + module.exports = function (config) { config.set({ basePath: '../../', @@ -74,15 +77,23 @@ module.exports = function (config) { random: false } }, - coverageIstanbulReporter: { - dir: require('path').join(__dirname, '../coverage/core'), - reports: ['html', 'lcovonly'], - fixWebpackSourcePaths: true + jasmineHtmlReporter: { + suppressAll: true, // removes the duplicated traces }, - browserDisconnectTimeout: 200000, - browserNoActivityTimeout: 2400000, - captureTimeout: 1200000, + coverageReporter: { + dir: join(__dirname, './coverage/core'), + subdir: '.', + reporters: [{ type: 'html' }, { type: 'text-summary' }], + check: { + global: { + statements: 75, + branches: 67, + functions: 73, + lines: 75 + } + } + }, customLaunchers: { ChromeHeadless: { @@ -99,7 +110,7 @@ module.exports = function (config) { reporters: ['mocha', 'kjhtml'], port: 9876, colors: true, - logLevel: config.LOG_INFO, + logLevel: constants.LOG_INFO, autoWatch: true, browsers: ['ChromeHeadless'], singleRun: true diff --git a/lib/extensions/karma.conf.js b/lib/extensions/karma.conf.js index 4f187b9a431..8cb2dc7013a 100644 --- a/lib/extensions/karma.conf.js +++ b/lib/extensions/karma.conf.js @@ -1,42 +1,57 @@ // Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html +const {join} = require('path'); +const {constants} = require('karma'); + 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'), - require('@angular-devkit/build-angular/plugins/karma'), - require('karma-mocha-reporter') - ], - client: { - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - coverageIstanbulReporter: { - dir: require('path').join(__dirname, '../../coverage'), - reports: ['html', 'lcovonly'], - fixWebpackSourcePaths: true - }, - reporters: ['mocha', 'kjhtml'], - port: 9876, - colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, - browsers: ['ChromeHeadless'], - customLaunchers: { - ChromeHeadless: { - base: 'Chrome', - flags: [ - '--no-sandbox', - '--headless', - '--disable-gpu', - '--remote-debugging-port=9222' - ] - } - }, - singleRun: true - }); + 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'), + require('@angular-devkit/build-angular/plugins/karma'), + require('karma-mocha-reporter') + ], + client: { + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + jasmineHtmlReporter: { + suppressAll: true, // removes the duplicated traces + }, + + coverageReporter: { + dir: join(__dirname, './coverage/extensions'), + subdir: '.', + reporters: [{type: 'html'}, {type: 'text-summary'}], + check: { + global: { + statements: 75, + branches: 67, + functions: 73, + lines: 75 + } + } + }, + reporters: ['mocha', 'kjhtml'], + port: 9876, + colors: true, + logLevel: constants.LOG_INFO, + autoWatch: true, + browsers: ['ChromeHeadless'], + customLaunchers: { + ChromeHeadless: { + base: 'Chrome', + flags: [ + '--no-sandbox', + '--headless', + '--disable-gpu', + '--remote-debugging-port=9222' + ] + } + }, + singleRun: true + }); }; diff --git a/lib/insights/karma.conf.js b/lib/insights/karma.conf.js index 5e76cd4efde..bab28e75468 100644 --- a/lib/insights/karma.conf.js +++ b/lib/insights/karma.conf.js @@ -1,5 +1,8 @@ // Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html +const { join } = require('path'); +const { constants } = require('karma'); + module.exports = function (config) { config.set({ basePath: '../../', @@ -56,15 +59,24 @@ module.exports = function (config) { random: false } }, - coverageIstanbulReporter: { - dir: require('path').join(__dirname, '../coverage/insights'), - reports: ['html', 'lcovonly'], - fixWebpackSourcePaths: true + + jasmineHtmlReporter: { + suppressAll: true, // removes the duplicated traces }, - browserDisconnectTimeout: 200000, - browserNoActivityTimeout: 2400000, - captureTimeout: 1200000, + coverageReporter: { + dir: join(__dirname, './coverage/insights'), + subdir: '.', + reporters: [{ type: 'html' }, { type: 'text-summary' }], + check: { + global: { + statements: 75, + branches: 50, + functions: 73, + lines: 75 + } + } + }, customLaunchers: { ChromeHeadless: { @@ -81,7 +93,7 @@ module.exports = function (config) { reporters: ['mocha', 'kjhtml'], port: 9876, colors: true, - logLevel: config.LOG_INFO, + logLevel: constants.LOG_INFO, autoWatch: true, browsers: ['ChromeHeadless'], singleRun: true diff --git a/lib/process-services-cloud/karma.conf.js b/lib/process-services-cloud/karma.conf.js index 190945f0a5a..f72cd47e977 100644 --- a/lib/process-services-cloud/karma.conf.js +++ b/lib/process-services-cloud/karma.conf.js @@ -1,5 +1,8 @@ // Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html +const { join } = require('path'); +const { constants } = require('karma'); + module.exports = function (config) { config.set({ basePath: '../../', @@ -54,15 +57,23 @@ module.exports = function (config) { random: false } }, - coverageIstanbulReporter: { - dir: require('path').join(__dirname, '../coverage/process-services-cloud'), - reports: ['html', 'lcovonly'], - fixWebpackSourcePaths: true + jasmineHtmlReporter: { + suppressAll: true, // removes the duplicated traces }, - browserDisconnectTimeout: 200000, - browserNoActivityTimeout: 2400000, - captureTimeout: 1200000, + coverageReporter: { + dir: join(__dirname, './coverage/process-service-cloud'), + subdir: '.', + reporters: [{ type: 'html' }, { type: 'text-summary' }], + check: { + global: { + statements: 75, + branches: 67, + functions: 73, + lines: 75 + } + } + }, customLaunchers: { ChromeHeadless: { @@ -79,7 +90,7 @@ module.exports = function (config) { reporters: ['mocha', 'kjhtml'], port: 9876, colors: true, - logLevel: config.LOG_INFO, + logLevel: constants.LOG_INFO, autoWatch: true, browsers: ['ChromeHeadless'], singleRun: true diff --git a/lib/process-services/karma.conf.js b/lib/process-services/karma.conf.js index 834d5b1a726..603188ec7e9 100644 --- a/lib/process-services/karma.conf.js +++ b/lib/process-services/karma.conf.js @@ -1,5 +1,8 @@ // Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html +const { join } = require('path'); +const { constants } = require('karma'); + module.exports = function (config) { config.set({ basePath: '../../', @@ -50,15 +53,23 @@ module.exports = function (config) { random: false } }, - coverageIstanbulReporter: { - dir: require('path').join(__dirname, '../coverage/process-services'), - reports: ['html', 'lcovonly'], - fixWebpackSourcePaths: true + jasmineHtmlReporter: { + suppressAll: true, // removes the duplicated traces }, - browserDisconnectTimeout: 200000, - browserNoActivityTimeout: 2400000, - captureTimeout: 1200000, + coverageReporter: { + dir: join(__dirname, './coverage/process-services'), + subdir: '.', + reporters: [{ type: 'html' }, { type: 'text-summary' }], + check: { + global: { + statements: 80, + branches: 67, + functions: 70, + lines: 75 + } + } + }, customLaunchers: { ChromeHeadless: { @@ -75,7 +86,7 @@ module.exports = function (config) { reporters: ['mocha', 'kjhtml'], port: 9876, colors: true, - logLevel: config.LOG_INFO, + logLevel: constants.LOG_INFO, autoWatch: true, browsers: ['ChromeHeadless'], singleRun: true