mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* 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
5 changed files with 22 additions and 13 deletions
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
|
||||
import { resolve, dirname } from 'path';
|
||||
import { platform as getOsPlatform } from 'os';
|
||||
import { times } from 'lodash';
|
||||
|
||||
const TOTAL_CI_SHARDS = 4;
|
||||
|
@ -29,13 +28,10 @@ module.exports = function (grunt) {
|
|||
if (grunt.option('browser')) {
|
||||
return grunt.option('browser');
|
||||
}
|
||||
|
||||
switch (getOsPlatform()) {
|
||||
case 'win32':
|
||||
return 'Chrome';
|
||||
default:
|
||||
return 'Chrome';
|
||||
if (process.env.TEST_BROWSER_HEADLESS) {
|
||||
return 'Chrome_Headless';
|
||||
}
|
||||
return 'Chrome';
|
||||
}
|
||||
|
||||
const config = {
|
||||
|
@ -51,6 +47,16 @@ module.exports = function (grunt) {
|
|||
logLevel: grunt.option('debug') || grunt.option('verbose') ? 'DEBUG' : 'INFO',
|
||||
autoWatch: false,
|
||||
browsers: [pickBrowser()],
|
||||
customLaunchers: {
|
||||
Chrome_Headless: {
|
||||
base: 'Chrome',
|
||||
flags: [
|
||||
'--headless',
|
||||
'--disable-gpu',
|
||||
'--remote-debugging-port=9222',
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
||||
reporters: process.env.CI ? ['dots', 'junit'] : ['progress'],
|
||||
|
|
|
@ -22,4 +22,5 @@ set -e
|
|||
|
||||
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;
|
||||
|
||||
export TEST_BROWSER_HEADLESS=1
|
||||
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/java_setup.sh"
|
||||
|
||||
export TEST_BROWSER_HEADLESS=1
|
||||
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/java_setup.sh"
|
||||
|
||||
|
||||
export TEST_BROWSER_HEADLESS=1
|
||||
export XPACK_DIR="$(cd "$(dirname "$0")/../../x-pack"; pwd)"
|
||||
echo "-> XPACK_DIR ${XPACK_DIR}"
|
||||
|
||||
|
||||
echo " -> Running mocha tests"
|
||||
cd "$XPACK_DIR"
|
||||
xvfb-run yarn test
|
||||
yarn test
|
||||
echo ""
|
||||
echo ""
|
||||
|
||||
|
@ -37,6 +37,6 @@ tar -xzf "$linuxBuild" -C "$installDir" --strip=1
|
|||
export TEST_ES_FROM=${TEST_ES_FROM:-source}
|
||||
echo " -> Running functional and api tests"
|
||||
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 ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue