From 90f61fe87ba3dd592b242a6b18084fd35461297b Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sat, 22 Apr 2017 11:32:46 +0300 Subject: [PATCH] Update travis configuration to run tests in headless chrome --- .travis.yml | 27 ++++++++++++++++++++------- html4j/pom.xml | 27 +++++++++++++-------------- pom.xml | 27 +++++++++++++++++++++++++++ tests/pom.xml | 3 +-- 4 files changed, 61 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6297ab89d..b4a73c0f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,25 +4,38 @@ jdk: cache: directories: - $HOME/.m2 + - $HOME/.node_modules + - $HOME/.chromium_dist branches: only: - master - /^release-.+$/ - /^dev-.+/ before_install: + - CHROMIUM_BUILD=466537 + - mkdir -p $HOME/.chromium_dist/ + - wget -nc https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F$CHROMIUM_BUILD%2Fchrome-linux.zip?alt=media -O $HOME/.chromium_dist/chromium-$CHROMIUM_BUILD.zip + - unzip $HOME/.chromium_dist/chromium-$CHROMIUM_BUILD.zip - OLD_VERSION=`mvn help:evaluate -Dexpression=project.version 2>/dev/null | grep -Ev "(^\[|Download\w+:)"` - NEW_VERSION=${OLD_VERSION%-SNAPSHOT}-dev-`printf %d $TRAVIS_BUILD_NUMBER` - echo "Building version $NEW_VERSION" - mvn versions:set -DnewVersion=$NEW_VERSION install: - mvn install -Dteavm.build.all=false -P with-idea -DskipTests=true -Dmaven.javadoc.skip=true -B -V -script: > - mvn -e test \ - -Dteavm.junit.target=target/js-tests \ - -Dteavm.junit.js.runner=htmlunit \ - -Dteavm.junit.js.threads=1 \ - -Dteavm.junit.optimized=true \ - -Dteavm.junit.minified=true + - pushd tests/src/test/js + - npm install --prefix $HOME/.node_modules + - npm run build + - popd +script: + - mvn -e test -P noHtmlUnit + - BASE_PATH=`pwd` + - pushd tests/src/test/js + - chrome-linux/chrome --headless --remote-debugging-port=9222 --disable-gpu about:blank & + - CHROME_PID=$! + - node start.js $BASE_PATH/tests/target/js-tests + - node start.js $BASE_PATH/html4j/target/js-tests + - kill $CHROME_PID + - popd after_success: > if [[ "${TRAVIS_PULL_REQUEST:-unknown}" == "false" && $TRAVIS_BRANCH == dev-* ]] ; then export NEW_VERSION diff --git a/html4j/pom.xml b/html4j/pom.xml index 905bc6123..2d9bc4888 100644 --- a/html4j/pom.xml +++ b/html4j/pom.xml @@ -91,20 +91,19 @@ - - org.apache.maven.plugins - maven-surefire-plugin - 2.16 - - - ${project.build.directory}/js-tests - htmlunit - true - true - - -Xmx512m - - + + org.apache.maven.plugins + maven-surefire-plugin + 2.16 + + + ${project.build.directory}/js-tests + true + true + + -Xmx512m + + diff --git a/pom.xml b/pom.xml index f33a87a8e..f653a2187 100644 --- a/pom.xml +++ b/pom.xml @@ -287,6 +287,33 @@ + + noHtmlUnit + + true + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.16 + + + ${project.build.directory}/js-tests + htmlunit + true + true + + + + + + + + all-modules diff --git a/tests/pom.xml b/tests/pom.xml index b381c339a..594f0ee5c 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -86,13 +86,12 @@ maven-surefire-plugin 2.16 + -Xmx512m ${project.build.directory}/js-tests - htmlunit true true - -Xmx512m