Unit testing Azure管道Junit报告上的角度单元测试不总是生成
我为相同的代码库(意味着相同的分支)运行了Azure CI/CD管道,但有时它成功地创建了Unit testing Azure管道Junit报告上的角度单元测试不总是生成,unit-testing,junit,karma-jasmine,Unit Testing,Junit,Karma Jasmine,我为相同的代码库(意味着相同的分支)运行了Azure CI/CD管道,但有时它成功地创建了Junit报告,但有时它无法生成报告,并且在控制台中没有错误。注意,它总是生成cobertura coverage报告,因此我很难找到实际问题 karma.conf.js // Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-f
Junit
报告,但有时它无法生成报告,并且在控制台中没有错误。注意,它总是生成cobertura coverage
报告,因此我很难找到实际问题
karma.conf.js
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
const { join } = require('path');
module.exports = function (config) {
const puppeteer = require('puppeteer');
process.env.CHROME_BIN = puppeteer.executablePath();
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('karma-junit-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
random: false,
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
files: [
// Include a Material theme in the test suite.
{ pattern: './node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, watched: true }
],
coverageIstanbulReporter: {
dir: 'coverage',
reports: ['lcovonly', 'text', 'cobertura'],
fixWebpackSourcePaths: true
},
junitReporter: {
outputDir: join(__dirname, 'testresults'),
outputFile: 'unit-test-result.xml',
useBrowserName: false
},
reporters: ['progress', 'kjhtml', 'junit'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: [
'--no-sandbox',
'--disable-web-security',
'--disable-gpu']
}
},
singleRun: false,
captureTimeout: 190000, // default: 60000
browserDisconnectTimeout: 190000,
retryLimit: 4,
browserDisconnectTolerance: 6,
browserNoActivityTimeout: 190000,// default: 10000
});
};