diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2015-11-23 13:46:56 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2015-11-23 13:46:56 +0100 |
commit | dce4934698b5620387971589e40ace4ea84d63f8 (patch) | |
tree | ef9bbe3bd311bdd22196d44fdf0bb75bf1b3308b | |
parent | ecf051478e80ba4ce6e7c8a169feefa771cc8e17 (diff) | |
download | Kamon-dce4934698b5620387971589e40ace4ea84d63f8.tar.gz Kamon-dce4934698b5620387971589e40ace4ea84d63f8.tar.bz2 Kamon-dce4934698b5620387971589e40ace4ea84d63f8.zip |
! build: filter most of the output from sbt test.
Based on the work found here:
http://codecraft.vaamo.de/2014/08/22/less-is-more-when-it-comes-to-ci-logs.html
-rw-r--r-- | .travis.yml | 3 | ||||
-rw-r--r-- | project/Dependencies.scala | 2 | ||||
-rwxr-xr-x | travis-test.sh | 40 |
3 files changed, 42 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml index b5f3ffe5..c86459a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: scala script: - - sbt ++$TRAVIS_SCALA_VERSION 'set concurrentRestrictions in Global += Tags.limit(Tags.Compile, 2)' compile test:compile - - sbt ++$TRAVIS_SCALA_VERSION -Dakka.test.timefactor=1.5 'set concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)' test + - ./travis-test.sh scala: - 2.11.5 jdk: diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 394fb9f2..787c62ec 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -32,7 +32,7 @@ object Dependencies { val sprayJson = "io.spray" %% "spray-json" % "1.3.1" val sprayJsonLenses = "net.virtual-void" %% "json-lenses" % "0.6.0" - val scalatest = "org.scalatest" %% "scalatest" % "2.2.1" + val scalatest = "org.scalatest" %% "scalatest" % "2.2.4" val logback = "ch.qos.logback" % "logback-classic" % "1.0.13" val aspectJ = "org.aspectj" % "aspectjweaver" % aspectjVersion val newrelic = "com.newrelic.agent.java" % "newrelic-agent" % "3.11.0" diff --git a/travis-test.sh b/travis-test.sh new file mode 100755 index 00000000..f886933b --- /dev/null +++ b/travis-test.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# Licensed under the Apache License, Version 2.0 +# Adapted from https://github.com/paulp/psp-std/blob/master/bin/test + +runTests () { + sbt -Dakka.test.timefactor=1.5 \ + 'set concurrentRestrictions in Global += Tags.limit(Tags.Compile, 2)' \ + 'set testOptions in test in Global := Seq(Tests.Argument(TestFrameworks.ScalaTest, "-oUNCXHELPOQRM"))' \ + test || exit 1 + + echo "[info] $(date) - finished sbt test" +} + +stripTerminalEscapeCodes () { + sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGKM]//g" +} + +mkRegex () { ( IFS="|" && echo "$*" ); } + +filterOutput() { + while read line; do + if ! [[ $(echo $line | stripTerminalEscapeCodes) =~ $excludeRegex ]] ; then + echo $line + fi + done +} + +main() { + # sbt output filter + local excludeRegex=$(mkRegex \ + '\[info\] (Resolving|Loading|Updating|Packaging|Done updating)' \ + 're[-]run with [-]unchecked for details' \ + 'one warning found' + ) + + echo "[info] $(date) - starting sbt test" + (set -o pipefail && runTests |& filterOutput) +} + +main $@
\ No newline at end of file |