test(project): remove legacy CI hacks

This commit is contained in:
Nico Rehwaldt 2020-03-12 11:29:03 +01:00 committed by fake-join[bot]
parent e4e789bd3e
commit a767fd9577
2 changed files with 15 additions and 61 deletions

View File

@ -2,28 +2,16 @@
// configures browsers to run test against // configures browsers to run test against
// any of [ 'ChromeHeadless', 'Chrome', 'Firefox', 'IE', 'PhantomJS' ] // any of [ 'ChromeHeadless', 'Chrome', 'Firefox', 'IE', 'PhantomJS' ]
var browsers = var browsers = (process.env.TEST_BROWSERS || 'PhantomJS').split(',');
(process.env.TEST_BROWSERS || 'PhantomJS')
.replace(/^\s+|\s+$/, '')
.split(/\s*,\s*/g)
.map(function(browser) {
if (browser === 'ChromeHeadless') {
process.env.CHROME_BIN = require('puppeteer').executablePath();
// workaround https://github.com/GoogleChrome/puppeteer/issues/290
if (process.platform === 'linux') {
return 'ChromeHeadless_Linux';
}
}
return browser;
});
// use puppeteer provided Chrome for testing
process.env.CHROME_BIN = require('puppeteer').executablePath();
var VARIANT = process.env.VARIANT; var VARIANT = process.env.VARIANT;
var NODE_ENV = process.env.NODE_ENV; var NODE_ENV = process.env.NODE_ENV;
module.exports = function(karma) { module.exports = function(karma) {
karma.set({ karma.set({
@ -46,18 +34,7 @@ module.exports = function(karma) {
reporters: [ 'progress' ], reporters: [ 'progress' ],
customLaunchers: { browsers,
ChromeHeadless_Linux: {
base: 'ChromeHeadless',
flags: [
'--no-sandbox',
'--disable-setuid-sandbox'
],
debug: true
}
},
browsers: browsers,
browserNoActivityTimeout: 30000, browserNoActivityTimeout: 30000,

View File

@ -1,31 +1,19 @@
var coverage = process.env.COVERAGE; /* global process */
var path = require('path'); var path = require('path');
var basePath = '../../'; var coverage = process.env.COVERAGE;
var absoluteBasePath = path.resolve(path.join(__dirname, basePath));
/* global process */
// configures browsers to run test against // configures browsers to run test against
// any of [ 'ChromeHeadless', 'Chrome', 'Firefox', 'IE', 'PhantomJS' ] // any of [ 'ChromeHeadless', 'Chrome', 'Firefox', 'IE', 'PhantomJS' ]
var browsers = var browsers = (process.env.TEST_BROWSERS || 'PhantomJS').split(',');
(process.env.TEST_BROWSERS || 'PhantomJS')
.replace(/^\s+|\s+$/, '')
.split(/\s*,\s*/g)
.map(function(browser) {
if (browser === 'ChromeHeadless') {
process.env.CHROME_BIN = require('puppeteer').executablePath();
// workaround https://github.com/GoogleChrome/puppeteer/issues/290 // use puppeteer provided Chrome for testing
if (process.platform === 'linux') { process.env.CHROME_BIN = require('puppeteer').executablePath();
return 'ChromeHeadless_Linux';
}
}
return browser; var basePath = '../..';
});
var absoluteBasePath = path.resolve(path.join(__dirname, basePath));
var suite = coverage ? 'test/coverageBundle.js' : 'test/testBundle.js'; var suite = coverage ? 'test/coverageBundle.js' : 'test/testBundle.js';
@ -33,7 +21,7 @@ var suite = coverage ? 'test/coverageBundle.js' : 'test/testBundle.js';
module.exports = function(karma) { module.exports = function(karma) {
karma.set({ karma.set({
basePath: basePath, basePath,
frameworks: [ frameworks: [
'mocha', 'mocha',
@ -50,24 +38,13 @@ module.exports = function(karma) {
reporters: [ 'progress' ].concat(coverage ? 'coverage' : []), reporters: [ 'progress' ].concat(coverage ? 'coverage' : []),
customLaunchers: {
ChromeHeadless_Linux: {
base: 'ChromeHeadless',
flags: [
'--no-sandbox',
'--disable-setuid-sandbox'
],
debug: true
}
},
coverageReporter: { coverageReporter: {
reporters: [ reporters: [
{ type: 'lcov', subdir: '.' } { type: 'lcov', subdir: '.' }
] ]
}, },
browsers: browsers, browsers,
browserNoActivityTimeout: 30000, browserNoActivityTimeout: 30000,