You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by pd...@apache.org on 2020/08/28 11:52:49 UTC

[zeppelin] 11/13: Try fixing selenium tests

This is an automated email from the ASF dual-hosted git repository.

pdallig pushed a commit to branch test_refactoring
in repository https://gitbox.apache.org/repos/asf/zeppelin.git

commit 3b9d2b1d43fa60ae86befc90a7cf61387d1c66fc
Author: Philipp Dallig <ph...@gmail.com>
AuthorDate: Fri Aug 28 11:39:24 2020 +0200

    Try fixing selenium tests
---
 .travis.yml | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 52b8016..b773086 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -104,12 +104,23 @@ jobs:
       dist: xenial
       addons:
         firefox: "31.0"
-      env: BUILD_PLUGINS="true" PYTHON="2" R="true" SCALA_VER="2.11" SPARK_VER="2.3.2" HADOOP_VER="2.6" PROFILE="-Pspark-2.3 -Phadoop2 -Phelium-dev -Pexamples -Pintegration -Pspark-scala-2.11" BUILD_FLAG="clean install -DskipTests -DskipRat -pl ${INTERPRETERS}" TEST_FLAG="verify -DskipRat" TEST_PROJECTS="-pl zeppelin-integration -DfailIfNoTests=false"
+      env: BUILD_PLUGINS="true" CI="true" PYTHON="2" R="true" SCALA_VER="2.11" SPARK_VER="2.3.2" HADOOP_VER="2.6" PROFILE="-Pspark-2.3 -Phadoop2 -Phelium-dev -Pexamples -Pintegration -Pspark-scala-2.11" BUILD_FLAG="clean install -DskipTests -DskipRat -pl ${INTERPRETERS}" TEST_FLAG="verify -DskipRat" TEST_PROJECTS="-pl zeppelin-integration -DfailIfNoTests=false"
       before_install:
-        - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1600x1024x16"
+        # check files included in commit range, clear bower_components if a bower.json file has changed.
+        # bower cache clearing can also be forced by putting "bower clear" or "clear bower" in a commit message
+        - changedfiles=$(git diff --name-only $TRAVIS_COMMIT_RANGE 2>/dev/null) || changedfiles=""
+        - echo $changedfiles
+        - hasbowerchanged=$(echo $changedfiles | grep -c "bower.json" || true);
+        - gitlog=$(git log $TRAVIS_COMMIT_RANGE 2>/dev/null) || gitlog=""
+        - clearcache=$(echo $gitlog | grep -c -E "clear bower|bower clear" || true)
+        - if [ "$hasbowerchanged" -gt 0 ] || [ "$clearcache" -gt 0 ]; then echo "Clearing bower_components cache"; rm -r zeppelin-web/bower_components; npm cache verify; else echo "Using cached bower_components."; fi
         - echo "MAVEN_OPTS='-Xms1024M -Xmx2048M -XX:MaxMetaspaceSize=1024m -XX:-UseGCOverheadLimit -Dorg.slf4j.simpleLogger.defaultLogLevel=warn'" >> ~/.mavenrc
-        - "./testing/install_R.sh"
-        - "R=true PYTHON=2 bash -x ./testing/install_external_dependencies.sh"
+        - if [[ -n $R ]]; then ./testing/install_R.sh; fi
+        - bash -x ./testing/install_external_dependencies.sh
+        - ls -la .spark-dist ${HOME}/.m2/repository/.cache/maven-download-plugin || true
+        - ls .node_modules && cp -r .node_modules zeppelin-web/node_modules || echo "node_modules are not cached"
+        - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1600x1024x16"
+        #- ./dev/change_scala_version.sh $SCALA_VER
         - source ~/.environ
 
     - name: "Test interpreter modules"
@@ -239,6 +250,8 @@ before_script:
   - echo "export SPARK_PRINT_LAUNCH_COMMAND=true" >> conf/zeppelin-env.sh
   - export SPARK_PRINT_LAUNCH_COMMAND=true
   - tail conf/zeppelin-env.sh
+  # https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
+  - if [[ -n $TEST_MODULES ]]; then export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start; sleep 3; fi
   # display info log for debugging
   - if [[ -n $TEST_MODULES ]]; then echo "MAVEN_OPTS='-Xms1024M -Xmx2048M -XX:MaxMetaspaceSize=1024m -XX:-UseGCOverheadLimit -Dorg.slf4j.simpleLogger.defaultLogLevel=info'" > ~/.mavenrc; fi