[AAE-12242] Fix code coverage (#8404)

* fix code coverage
This commit is contained in:
Eugenio Romano 2023-03-21 14:57:40 +01:00 committed by GitHub
parent c884b0625b
commit 0c4cc37dd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 164 additions and 85 deletions

View File

@ -209,8 +209,10 @@ jobs:
exclude: "insights,core,extensions,process-services,process-services-cloud" exclude: "insights,core,extensions,process-services,process-services-cloud"
- name: core - name: core
exclude: "insights,content-services,process-services,process-services-cloud" exclude: "insights,content-services,process-services,process-services-cloud"
- name: insights and process-services - name: insights
exclude: "core,extensions,content-services,process-services-cloud" 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 - name: process-cloud
exclude: "insights,core,extensions,content-services,process-services" exclude: "insights,core,extensions,content-services,process-services"
steps: steps:

View File

@ -337,6 +337,7 @@
"tsConfig": "lib/core/tsconfig.spec.json", "tsConfig": "lib/core/tsconfig.spec.json",
"karmaConfig": "lib/core/karma.conf.js", "karmaConfig": "lib/core/karma.conf.js",
"sourceMap": true, "sourceMap": true,
"codeCoverage": true,
"styles": [ "styles": [
"demo-shell/src/assets/fonts/material-icons/material-icons.css" "demo-shell/src/assets/fonts/material-icons/material-icons.css"
] ]
@ -484,7 +485,8 @@
"main": "lib/content-services/src/test.ts", "main": "lib/content-services/src/test.ts",
"tsConfig": "lib/content-services/tsconfig.spec.json", "tsConfig": "lib/content-services/tsconfig.spec.json",
"karmaConfig": "lib/content-services/karma.conf.js", "karmaConfig": "lib/content-services/karma.conf.js",
"sourceMap": true "sourceMap": true,
"codeCoverage": true
} }
}, },
"lint": { "lint": {
@ -603,7 +605,8 @@
"main": "lib/process-services/src/test.ts", "main": "lib/process-services/src/test.ts",
"tsConfig": "lib/process-services/tsconfig.spec.json", "tsConfig": "lib/process-services/tsconfig.spec.json",
"karmaConfig": "lib/process-services/karma.conf.js", "karmaConfig": "lib/process-services/karma.conf.js",
"sourceMap": true "sourceMap": true,
"codeCoverage": true
} }
}, },
"lint": { "lint": {
@ -688,7 +691,8 @@
"main": "lib/process-services-cloud/src/test.ts", "main": "lib/process-services-cloud/src/test.ts",
"tsConfig": "lib/process-services-cloud/tsconfig.spec.json", "tsConfig": "lib/process-services-cloud/tsconfig.spec.json",
"karmaConfig": "lib/process-services-cloud/karma.conf.js", "karmaConfig": "lib/process-services-cloud/karma.conf.js",
"sourceMap": true "sourceMap": true,
"codeCoverage": true
} }
}, },
"lint": { "lint": {
@ -818,7 +822,8 @@
"main": "lib/insights/src/test.ts", "main": "lib/insights/src/test.ts",
"tsConfig": "lib/insights/tsconfig.spec.json", "tsConfig": "lib/insights/tsconfig.spec.json",
"karmaConfig": "lib/insights/karma.conf.js", "karmaConfig": "lib/insights/karma.conf.js",
"sourceMap": true "sourceMap": true,
"codeCoverage": true
} }
}, },
"lint": { "lint": {
@ -892,7 +897,8 @@
"main": "lib/extensions/src/test.ts", "main": "lib/extensions/src/test.ts",
"tsConfig": "lib/extensions/tsconfig.spec.json", "tsConfig": "lib/extensions/tsconfig.spec.json",
"karmaConfig": "lib/extensions/karma.conf.js", "karmaConfig": "lib/extensions/karma.conf.js",
"sourceMap": true "sourceMap": true,
"codeCoverage": true
} }
}, },
"lint": { "lint": {

View File

@ -1,5 +1,8 @@
// Karma configuration file, see link for more information // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html // https://karma-runner.github.io/1.0/config/configuration-file.html
const { join } = require('path');
const { constants } = require('karma');
module.exports = function (config) { module.exports = function (config) {
config.set({ config.set({
basePath: '../../', basePath: '../../',
@ -55,15 +58,23 @@ module.exports = function (config) {
} }
}, },
coverageIstanbulReporter: { jasmineHtmlReporter: {
dir: require('path').join(__dirname, '../coverage/content-services'), suppressAll: true, // removes the duplicated traces
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
}, },
browserDisconnectTimeout: 200000, coverageReporter: {
browserNoActivityTimeout: 2400000, dir: join(__dirname, './coverage/content-services'),
captureTimeout: 1200000, subdir: '.',
reporters: [{ type: 'html' }, { type: 'text-summary' }],
check: {
global: {
statements: 75,
branches: 67,
functions: 73,
lines: 75
}
}
},
customLaunchers: { customLaunchers: {
ChromeHeadless: { ChromeHeadless: {
@ -80,7 +91,7 @@ module.exports = function (config) {
reporters: ['mocha', 'kjhtml'], reporters: ['mocha', 'kjhtml'],
port: 9876, port: 9876,
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: constants.LOG_INFO,
autoWatch: true, autoWatch: true,
browsers: ['ChromeHeadless'], browsers: ['ChromeHeadless'],
singleRun: true singleRun: true

View File

@ -1,5 +1,8 @@
// Karma configuration file, see link for more information // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html // https://karma-runner.github.io/1.0/config/configuration-file.html
const { join } = require('path');
const { constants } = require('karma');
module.exports = function (config) { module.exports = function (config) {
config.set({ config.set({
basePath: '../../', basePath: '../../',
@ -74,15 +77,23 @@ module.exports = function (config) {
random: false random: false
} }
}, },
coverageIstanbulReporter: { jasmineHtmlReporter: {
dir: require('path').join(__dirname, '../coverage/core'), suppressAll: true, // removes the duplicated traces
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
}, },
browserDisconnectTimeout: 200000, coverageReporter: {
browserNoActivityTimeout: 2400000, dir: join(__dirname, './coverage/core'),
captureTimeout: 1200000, subdir: '.',
reporters: [{ type: 'html' }, { type: 'text-summary' }],
check: {
global: {
statements: 75,
branches: 67,
functions: 73,
lines: 75
}
}
},
customLaunchers: { customLaunchers: {
ChromeHeadless: { ChromeHeadless: {
@ -99,7 +110,7 @@ module.exports = function (config) {
reporters: ['mocha', 'kjhtml'], reporters: ['mocha', 'kjhtml'],
port: 9876, port: 9876,
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: constants.LOG_INFO,
autoWatch: true, autoWatch: true,
browsers: ['ChromeHeadless'], browsers: ['ChromeHeadless'],
singleRun: true singleRun: true

View File

@ -1,42 +1,57 @@
// Karma configuration file, see link for more information // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html // https://karma-runner.github.io/1.0/config/configuration-file.html
const {join} = require('path');
const {constants} = require('karma');
module.exports = function (config) { module.exports = function (config) {
config.set({ config.set({
basePath: '', basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'], frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [ plugins: [
require('karma-jasmine'), require('karma-jasmine'),
require('karma-chrome-launcher'), require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'), require('karma-jasmine-html-reporter'),
require('karma-coverage'), require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma'), require('@angular-devkit/build-angular/plugins/karma'),
require('karma-mocha-reporter') require('karma-mocha-reporter')
], ],
client: { client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser clearContext: false // leave Jasmine Spec Runner output visible in browser
}, },
coverageIstanbulReporter: { jasmineHtmlReporter: {
dir: require('path').join(__dirname, '../../coverage'), suppressAll: true, // removes the duplicated traces
reports: ['html', 'lcovonly'], },
fixWebpackSourcePaths: true
}, coverageReporter: {
reporters: ['mocha', 'kjhtml'], dir: join(__dirname, './coverage/extensions'),
port: 9876, subdir: '.',
colors: true, reporters: [{type: 'html'}, {type: 'text-summary'}],
logLevel: config.LOG_INFO, check: {
autoWatch: true, global: {
browsers: ['ChromeHeadless'], statements: 75,
customLaunchers: { branches: 67,
ChromeHeadless: { functions: 73,
base: 'Chrome', lines: 75
flags: [ }
'--no-sandbox', }
'--headless', },
'--disable-gpu', reporters: ['mocha', 'kjhtml'],
'--remote-debugging-port=9222' port: 9876,
] colors: true,
} logLevel: constants.LOG_INFO,
}, autoWatch: true,
singleRun: true browsers: ['ChromeHeadless'],
}); customLaunchers: {
ChromeHeadless: {
base: 'Chrome',
flags: [
'--no-sandbox',
'--headless',
'--disable-gpu',
'--remote-debugging-port=9222'
]
}
},
singleRun: true
});
}; };

View File

@ -1,5 +1,8 @@
// Karma configuration file, see link for more information // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html // https://karma-runner.github.io/1.0/config/configuration-file.html
const { join } = require('path');
const { constants } = require('karma');
module.exports = function (config) { module.exports = function (config) {
config.set({ config.set({
basePath: '../../', basePath: '../../',
@ -56,15 +59,24 @@ module.exports = function (config) {
random: false random: false
} }
}, },
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage/insights'), jasmineHtmlReporter: {
reports: ['html', 'lcovonly'], suppressAll: true, // removes the duplicated traces
fixWebpackSourcePaths: true
}, },
browserDisconnectTimeout: 200000, coverageReporter: {
browserNoActivityTimeout: 2400000, dir: join(__dirname, './coverage/insights'),
captureTimeout: 1200000, subdir: '.',
reporters: [{ type: 'html' }, { type: 'text-summary' }],
check: {
global: {
statements: 75,
branches: 50,
functions: 73,
lines: 75
}
}
},
customLaunchers: { customLaunchers: {
ChromeHeadless: { ChromeHeadless: {
@ -81,7 +93,7 @@ module.exports = function (config) {
reporters: ['mocha', 'kjhtml'], reporters: ['mocha', 'kjhtml'],
port: 9876, port: 9876,
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: constants.LOG_INFO,
autoWatch: true, autoWatch: true,
browsers: ['ChromeHeadless'], browsers: ['ChromeHeadless'],
singleRun: true singleRun: true

View File

@ -1,5 +1,8 @@
// Karma configuration file, see link for more information // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html // https://karma-runner.github.io/1.0/config/configuration-file.html
const { join } = require('path');
const { constants } = require('karma');
module.exports = function (config) { module.exports = function (config) {
config.set({ config.set({
basePath: '../../', basePath: '../../',
@ -54,15 +57,23 @@ module.exports = function (config) {
random: false random: false
} }
}, },
coverageIstanbulReporter: { jasmineHtmlReporter: {
dir: require('path').join(__dirname, '../coverage/process-services-cloud'), suppressAll: true, // removes the duplicated traces
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
}, },
browserDisconnectTimeout: 200000, coverageReporter: {
browserNoActivityTimeout: 2400000, dir: join(__dirname, './coverage/process-service-cloud'),
captureTimeout: 1200000, subdir: '.',
reporters: [{ type: 'html' }, { type: 'text-summary' }],
check: {
global: {
statements: 75,
branches: 67,
functions: 73,
lines: 75
}
}
},
customLaunchers: { customLaunchers: {
ChromeHeadless: { ChromeHeadless: {
@ -79,7 +90,7 @@ module.exports = function (config) {
reporters: ['mocha', 'kjhtml'], reporters: ['mocha', 'kjhtml'],
port: 9876, port: 9876,
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: constants.LOG_INFO,
autoWatch: true, autoWatch: true,
browsers: ['ChromeHeadless'], browsers: ['ChromeHeadless'],
singleRun: true singleRun: true

View File

@ -1,5 +1,8 @@
// Karma configuration file, see link for more information // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html // https://karma-runner.github.io/1.0/config/configuration-file.html
const { join } = require('path');
const { constants } = require('karma');
module.exports = function (config) { module.exports = function (config) {
config.set({ config.set({
basePath: '../../', basePath: '../../',
@ -50,15 +53,23 @@ module.exports = function (config) {
random: false random: false
} }
}, },
coverageIstanbulReporter: { jasmineHtmlReporter: {
dir: require('path').join(__dirname, '../coverage/process-services'), suppressAll: true, // removes the duplicated traces
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
}, },
browserDisconnectTimeout: 200000, coverageReporter: {
browserNoActivityTimeout: 2400000, dir: join(__dirname, './coverage/process-services'),
captureTimeout: 1200000, subdir: '.',
reporters: [{ type: 'html' }, { type: 'text-summary' }],
check: {
global: {
statements: 80,
branches: 67,
functions: 70,
lines: 75
}
}
},
customLaunchers: { customLaunchers: {
ChromeHeadless: { ChromeHeadless: {
@ -75,7 +86,7 @@ module.exports = function (config) {
reporters: ['mocha', 'kjhtml'], reporters: ['mocha', 'kjhtml'],
port: 9876, port: 9876,
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: constants.LOG_INFO,
autoWatch: true, autoWatch: true,
browsers: ['ChromeHeadless'], browsers: ['ChromeHeadless'],
singleRun: true singleRun: true