logstash/ci/unit_tests.sh
Andrew Cholakian 4f5b703244 Enable TEST_DEBUG on CI servers
Some tests are impossible to debug since log messages are not echoed without this,
including fatal/error messages. This makes output more verbose, but actually debuggable.

We should really delete this 'functionality' from https://github.com/elastic/logstash-devutils/blob/master/lib/logstash/devutils/rspec/spec_helper.rb#L36
since it does more harm than good.

Fixes #9629
2018-05-22 14:50:34 +00:00

32 lines
1.1 KiB
Bash
Executable file

#!/bin/bash -ie
#Note - ensure that the -e flag is set to properly set the $? status if any command fails
# Since we are using the system jruby, we need to make sure our jvm process
# uses at least 1g of memory, If we don't do this we can get OOM issues when
# installing gems. See https://github.com/elastic/logstash/issues/5179
export JRUBY_OPTS="-J-Xmx1g"
export GRADLE_OPTS="-Xmx2g -Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info"
export SPEC_OPTS="--order rand --format documentation"
export CI=true
export OSS=true
export TEST_DEBUG=true
SELECTED_TEST_SUITE=$1
if [[ $SELECTED_TEST_SUITE == $"core-fail-fast" ]]; then
echo "Running Java and Ruby unit tests, but will fail fast"
echo "Running test:install-core"
rake test:install-core
echo "Running test:core-fail-fast"
rake test:core-fail-fast
elif [[ $SELECTED_TEST_SUITE == $"java" ]]; then
echo "Running Java Tests"
./gradlew javaTests --console=plain
elif [[ $SELECTED_TEST_SUITE == $"ruby" ]]; then
echo "Running Ruby unit tests"
./gradlew rubyTests --console=plain
else
echo "Running Java and Ruby unit tests"
./gradlew test --console=plain
fi