From ece9a3b31d1fa086411a5c8e39a3143e3573394f Mon Sep 17 00:00:00 2001 From: spalger Date: Sat, 15 Jun 2019 12:27:06 -0700 Subject: [PATCH] [percy] only execute percy setup when necessary --- src/dev/ci_setup/setup.sh | 14 -------------- src/dev/ci_setup/setup_percy.sh | 17 +++++++++++++++++ test/scripts/jenkins_visual_regression.sh | 2 ++ test/scripts/jenkins_xpack_visual_regression.sh | 2 ++ 4 files changed, 21 insertions(+), 14 deletions(-) create mode 100755 src/dev/ci_setup/setup_percy.sh diff --git a/src/dev/ci_setup/setup.sh b/src/dev/ci_setup/setup.sh index 9f3c279b477de..1d9ed703fe94d 100755 --- a/src/dev/ci_setup/setup.sh +++ b/src/dev/ci_setup/setup.sh @@ -149,13 +149,6 @@ else echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" fi -### -### skip chomium download, use the system chrome install -### -export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true -PUPPETEER_EXECUTABLE_PATH="$(command -v google-chrome-stable)" -export PUPPETEER_EXECUTABLE_PATH - ### ### install dependencies ### @@ -172,13 +165,6 @@ if [ "$GIT_CHANGES" ]; then exit 1 fi -### -### Set Percy parallel build support environment vars -### -eval "$(node ./src/dev/ci_setup/get_percy_env)" -echo " -- PERCY_PARALLEL_NONCE='$PERCY_PARALLEL_NONCE'" -echo " -- PERCY_PARALLEL_TOTAL='$PERCY_PARALLEL_TOTAL'" - ### ### rebuild kbn-pm distributable to ensure it's not out of date ### diff --git a/src/dev/ci_setup/setup_percy.sh b/src/dev/ci_setup/setup_percy.sh new file mode 100755 index 0000000000000..c008dc1d5cdbd --- /dev/null +++ b/src/dev/ci_setup/setup_percy.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e + +### +### skip chomium download, use the system chrome install +### +export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true +PUPPETEER_EXECUTABLE_PATH="$(command -v google-chrome-stable)" +export PUPPETEER_EXECUTABLE_PATH + +### +### Set Percy parallel build support environment vars +### +eval "$(node ./src/dev/ci_setup/get_percy_env)" +echo " -- PERCY_PARALLEL_NONCE='$PERCY_PARALLEL_NONCE'" +echo " -- PERCY_PARALLEL_TOTAL='$PERCY_PARALLEL_TOTAL'" diff --git a/test/scripts/jenkins_visual_regression.sh b/test/scripts/jenkins_visual_regression.sh index c6bb148eccbfa..5411faeb10dab 100755 --- a/test/scripts/jenkins_visual_regression.sh +++ b/test/scripts/jenkins_visual_regression.sh @@ -3,6 +3,8 @@ set -e trap 'node "$KIBANA_DIR/src/dev/failed_tests/cli"' EXIT +source "$KIBANA_DIR/src/dev/ci_setup/setup_percy.sh" + node scripts/build --debug --oss; linuxBuild="$(find "$KIBANA_DIR/target" -name 'kibana-oss-*-linux-x86_64.tar.gz')" installDir="$PARENT_DIR/install/kibana" diff --git a/test/scripts/jenkins_xpack_visual_regression.sh b/test/scripts/jenkins_xpack_visual_regression.sh index 9f8fdce6ec220..5f27bf66ffced 100755 --- a/test/scripts/jenkins_xpack_visual_regression.sh +++ b/test/scripts/jenkins_xpack_visual_regression.sh @@ -3,6 +3,8 @@ set -e trap 'node "$KIBANA_DIR/src/dev/failed_tests/cli"' EXIT +source "$KIBANA_DIR/src/dev/ci_setup/setup_percy.sh" + node scripts/build --debug --no-oss; linuxBuild="$(find "$KIBANA_DIR/target" -name 'kibana-*-linux-x86_64.tar.gz')" installDir="$PARENT_DIR/install/kibana"