From 1fec20bfc91547906021d24c3aa84f03dedf560c Mon Sep 17 00:00:00 2001 From: Hynek Mlnarik Date: Tue, 18 Jun 2019 08:24:34 +0200 Subject: [PATCH] KEYCLOAK-10672 Travis folding --- .travis.yml | 3 +++ travis-run-tests.sh | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 326395793f..8e1aa61311 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,9 @@ before_install: - "if [ $(phantomjs --version) != '$PHANTOMJS_VERSION' ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi" - "phantomjs --version" +before_script: + - export -f travis_fold + script: - ./travis-run-tests.sh $TESTS diff --git a/travis-run-tests.sh b/travis-run-tests.sh index ec3c0d34fc..da6dfb2a16 100755 --- a/travis-run-tests.sh +++ b/travis-run-tests.sh @@ -9,9 +9,11 @@ function run-server-tests() { exit ${PIPESTATUS[0]} } +travis_fold start source_checkout # The following lines are due to travis internals. See https://github.com/travis-ci/travis-ci/issues/6069#issuecomment-319710346 git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" git fetch +travis_fold end source_checkout function should-tests-run() { # If this is not a pull request, it is build as a branch update. In that case test everything @@ -47,7 +49,17 @@ if declare -f "should-tests-run-$1" > /dev/null && ! eval "should-tests-run-$1"; exit 0 fi -mvn install -B -nsu -Pdistribution -DskipTests -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn +travis_fold start compile_keycloak +echo Compiling Keycloak +( while : ; do echo "Compiling, please wait..." ; sleep 50 ; done ) & +COMPILING_PID=$! +TMPFILE=`mktemp` +if ! mvn install -B -nsu -Pdistribution -DskipTests -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn &> "$TMPFILE"; then + cat "$TMPFILE" + exit 1 +fi +kill $COMPILING_PID +travis_fold end compile_keycloak if [ $1 == "unit" ]; then mvn -B test -DskipTestsuite