2019-12-22 10:56:05 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Cause the script to exit if a single command fails.
|
|
|
|
set -e
|
|
|
|
# Show explicitly which commands are currently running.
|
|
|
|
set -x
|
|
|
|
|
|
|
|
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
|
|
|
|
|
2020-12-29 10:36:16 +08:00
|
|
|
pushd "$ROOT_DIR"
|
|
|
|
echo "Check java code format."
|
|
|
|
# check google java style
|
|
|
|
mvn -T16 spotless:check
|
|
|
|
# check naming and others
|
|
|
|
mvn -T16 checkstyle:check
|
|
|
|
popd
|
|
|
|
|
2019-12-22 10:56:05 +08:00
|
|
|
echo "build ray streaming"
|
|
|
|
bazel build //streaming/java:all
|
|
|
|
|
2020-02-20 19:31:16 +08:00
|
|
|
# Check that ray libstreaming_java doesn't include symbols from ray by accident.
|
|
|
|
# Otherwise the symbols may conflict.
|
|
|
|
symbols_conflict=$(nm bazel-bin/streaming/libstreaming_java.so | grep TaskFinisherInterface || true)
|
|
|
|
if [ -n "${symbols_conflict}" ]; then
|
|
|
|
echo "streaming should not include symbols from ray: ${symbols_conflict}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-12-22 10:56:05 +08:00
|
|
|
echo "Running streaming tests."
|
2020-02-20 19:31:16 +08:00
|
|
|
java -cp "$ROOT_DIR"/../../bazel-bin/streaming/java/all_streaming_tests_deploy.jar\
|
2020-04-29 13:42:08 +08:00
|
|
|
org.testng.TestNG -d /tmp/ray_streaming_java_test_output "$ROOT_DIR"/testng.xml ||
|
2020-04-26 20:56:58 +08:00
|
|
|
exit_code=$?
|
2020-04-29 13:42:08 +08:00
|
|
|
if [ -z ${exit_code+x} ]; then
|
|
|
|
exit_code=0
|
|
|
|
fi
|
2019-12-22 10:56:05 +08:00
|
|
|
echo "Streaming TestNG results"
|
2020-04-26 20:56:58 +08:00
|
|
|
if [ -f "/tmp/ray_streaming_java_test_output/testng-results.xml" ] ; then
|
|
|
|
cat /tmp/ray_streaming_java_test_output/testng-results.xml
|
|
|
|
else
|
|
|
|
echo "Test result file doesn't exist"
|
|
|
|
fi
|
|
|
|
|
2020-02-20 19:31:16 +08:00
|
|
|
# exit_code == 2 means there are skipped tests.
|
|
|
|
if [ $exit_code -ne 2 ] && [ $exit_code -ne 0 ] ; then
|
2020-05-27 11:04:08 +08:00
|
|
|
if [ -d "/tmp/ray_streaming_java_test_output/" ] ; then
|
|
|
|
echo "all test output"
|
2020-06-18 15:11:07 +08:00
|
|
|
for f in /tmp/ray_streaming_java_test_output/*.{log,xml}; do
|
2020-05-27 11:04:08 +08:00
|
|
|
if [ -f "$f" ]; then
|
|
|
|
echo "Cat file $f"
|
|
|
|
cat "$f"
|
|
|
|
elif [[ -d $f ]]; then
|
|
|
|
echo "$f is a directory"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
for f in /home/travis/build/ray-project/ray/hs_err*log; do
|
|
|
|
if [ -f "$f" ]; then
|
|
|
|
echo "Cat file $f"
|
|
|
|
cat "$f"
|
|
|
|
fi
|
|
|
|
done
|
2020-02-20 19:31:16 +08:00
|
|
|
exit $exit_code
|
|
|
|
fi
|
2019-12-22 10:56:05 +08:00
|
|
|
|
|
|
|
echo "Testing maven install."
|
2020-02-20 19:31:16 +08:00
|
|
|
cd "$ROOT_DIR"/../../java
|
2019-12-22 10:56:05 +08:00
|
|
|
echo "build ray maven deps"
|
|
|
|
bazel build gen_maven_deps
|
|
|
|
echo "maven install ray"
|
2020-12-29 10:36:16 +08:00
|
|
|
mvn -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN clean install -DskipTests -Dcheckstyle.skip
|
2020-02-20 19:31:16 +08:00
|
|
|
cd "$ROOT_DIR"
|
2019-12-22 10:56:05 +08:00
|
|
|
echo "maven install ray streaming"
|
2020-12-29 10:36:16 +08:00
|
|
|
mvn -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN clean install -DskipTests -Dcheckstyle.skip
|