* Replace xvfb with headless browser * Update karma to run in headless chrome Update Karma tests for an option to run chrome in headless. * Fix lint issues * Fix spaces
This commit is contained in:
parent
650b64c562
commit
9d95015741
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { resolve, dirname } from 'path';
|
import { resolve, dirname } from 'path';
|
||||||
import { platform as getOsPlatform } from 'os';
|
|
||||||
import { times } from 'lodash';
|
import { times } from 'lodash';
|
||||||
|
|
||||||
const TOTAL_CI_SHARDS = 4;
|
const TOTAL_CI_SHARDS = 4;
|
||||||
|
@ -29,13 +28,10 @@ module.exports = function (grunt) {
|
||||||
if (grunt.option('browser')) {
|
if (grunt.option('browser')) {
|
||||||
return grunt.option('browser');
|
return grunt.option('browser');
|
||||||
}
|
}
|
||||||
|
if (process.env.TEST_BROWSER_HEADLESS) {
|
||||||
switch (getOsPlatform()) {
|
return 'Chrome_Headless';
|
||||||
case 'win32':
|
|
||||||
return 'Chrome';
|
|
||||||
default:
|
|
||||||
return 'Chrome';
|
|
||||||
}
|
}
|
||||||
|
return 'Chrome';
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
|
@ -51,6 +47,16 @@ module.exports = function (grunt) {
|
||||||
logLevel: grunt.option('debug') || grunt.option('verbose') ? 'DEBUG' : 'INFO',
|
logLevel: grunt.option('debug') || grunt.option('verbose') ? 'DEBUG' : 'INFO',
|
||||||
autoWatch: false,
|
autoWatch: false,
|
||||||
browsers: [pickBrowser()],
|
browsers: [pickBrowser()],
|
||||||
|
customLaunchers: {
|
||||||
|
Chrome_Headless: {
|
||||||
|
base: 'Chrome',
|
||||||
|
flags: [
|
||||||
|
'--headless',
|
||||||
|
'--disable-gpu',
|
||||||
|
'--remote-debugging-port=9222',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
||||||
reporters: process.env.CI ? ['dots', 'junit'] : ['progress'],
|
reporters: process.env.CI ? ['dots', 'junit'] : ['progress'],
|
||||||
|
|
|
@ -22,4 +22,5 @@ set -e
|
||||||
|
|
||||||
source "$(dirname $0)/../../src/dev/ci_setup/setup.sh"
|
source "$(dirname $0)/../../src/dev/ci_setup/setup.sh"
|
||||||
|
|
||||||
xvfb-run node scripts/functional_test_runner --debug --exclude-tag skipCloud $@
|
TEST_BROWSER_HEADLESS=1
|
||||||
|
node scripts/functional_test_runner --debug --exclude-tag skipCloud $@
|
||||||
|
|
|
@ -7,5 +7,6 @@ source "$(dirname $0)/../../src/dev/ci_setup/java_setup.sh"
|
||||||
|
|
||||||
node scripts/build --release --debug --oss;
|
node scripts/build --release --debug --oss;
|
||||||
|
|
||||||
|
export TEST_BROWSER_HEADLESS=1
|
||||||
export TEST_ES_FROM=${TEST_ES_FROM:-source}
|
export TEST_ES_FROM=${TEST_ES_FROM:-source}
|
||||||
xvfb-run "$(FORCE_COLOR=0 yarn bin)/grunt" jenkins:selenium --from=source;
|
"$(FORCE_COLOR=0 yarn bin)/grunt" jenkins:selenium --from=source;
|
||||||
|
|
|
@ -5,5 +5,6 @@ source "$(dirname $0)/../../src/dev/ci_setup/setup.sh"
|
||||||
source "$(dirname $0)/../../src/dev/ci_setup/git_setup.sh"
|
source "$(dirname $0)/../../src/dev/ci_setup/git_setup.sh"
|
||||||
source "$(dirname $0)/../../src/dev/ci_setup/java_setup.sh"
|
source "$(dirname $0)/../../src/dev/ci_setup/java_setup.sh"
|
||||||
|
|
||||||
|
export TEST_BROWSER_HEADLESS=1
|
||||||
export TEST_ES_FROM=${TEST_ES_FROM:-source}
|
export TEST_ES_FROM=${TEST_ES_FROM:-source}
|
||||||
xvfb-run "$(FORCE_COLOR=0 yarn bin)/grunt" jenkins:unit --from=source;
|
"$(FORCE_COLOR=0 yarn bin)/grunt" jenkins:unit --from=source;
|
||||||
|
|
|
@ -7,14 +7,14 @@ source "$(dirname $0)/../../src/dev/ci_setup/setup.sh"
|
||||||
source "$(dirname $0)/../../src/dev/ci_setup/git_setup.sh"
|
source "$(dirname $0)/../../src/dev/ci_setup/git_setup.sh"
|
||||||
source "$(dirname $0)/../../src/dev/ci_setup/java_setup.sh"
|
source "$(dirname $0)/../../src/dev/ci_setup/java_setup.sh"
|
||||||
|
|
||||||
|
export TEST_BROWSER_HEADLESS=1
|
||||||
export XPACK_DIR="$(cd "$(dirname "$0")/../../x-pack"; pwd)"
|
export XPACK_DIR="$(cd "$(dirname "$0")/../../x-pack"; pwd)"
|
||||||
echo "-> XPACK_DIR ${XPACK_DIR}"
|
echo "-> XPACK_DIR ${XPACK_DIR}"
|
||||||
|
|
||||||
|
|
||||||
echo " -> Running mocha tests"
|
echo " -> Running mocha tests"
|
||||||
cd "$XPACK_DIR"
|
cd "$XPACK_DIR"
|
||||||
xvfb-run yarn test
|
yarn test
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
@ -37,6 +37,6 @@ tar -xzf "$linuxBuild" -C "$installDir" --strip=1
|
||||||
export TEST_ES_FROM=${TEST_ES_FROM:-source}
|
export TEST_ES_FROM=${TEST_ES_FROM:-source}
|
||||||
echo " -> Running functional and api tests"
|
echo " -> Running functional and api tests"
|
||||||
cd "$XPACK_DIR"
|
cd "$XPACK_DIR"
|
||||||
xvfb-run node scripts/functional_tests --debug --bail --kibana-install-dir "$installDir"
|
node scripts/functional_tests --debug --bail --kibana-install-dir "$installDir"
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
|
|
Loading…
Reference in a new issue