提交 fe149853 编写于 作者: oldratlee's avatar oldratlee 🔥

add integration-test.sh

上级 ecc4bc31
#!/bin/bash
set -e
set -o pipefail
set -e
# https://stackoverflow.com/questions/64786/error-handling-in-bash
error() {
local parent_lineno="$1"
local message="$2"
local code="${3:-1}"
if [[ -n "$message" ]] ; then
redEcho "Error on or near line $(caller): ${message}; exiting with status ${code}"
else
redEcho "Error on or near line $(caller); exiting with status ${code}"
fi
exit "${code}"
}
trap 'error ${LINENO}' ERR
################################################################################
# util functions
......@@ -29,7 +42,7 @@ yellowEcho() {
}
runCmd() {
redEcho "Run under work directory $PWD :$nl$@"
colorEcho "36" "Run under work directory $PWD :$nl$@"
"$@"
}
......@@ -38,6 +51,13 @@ fatal() {
exit 1
}
headInfo() {
colorEcho "0;34;46" ================================================================================
echo "$@"
colorEcho "0;34;46" ================================================================================
echo
}
################################################################################
# auto adjust pwd to project dir, and set project to BASE var
################################################################################
......
#!/bin/bash
source ./common.sh skipClean
# set multi-version java home env
# - JAVA8_HOME
# - JAVA6_HOME
# - JAVA7_HOME
# - JAVA9_HOME
# - JAVA10_HOME
# Java 8
if [ -n "$JAVA8_HOME" ]; then
export JAVA_HOME="${JAVA8_HOME}"
else
current_java_version=$(./mvn -v | awk -F'[ ,]' '/^Java version/{print $3}')
if [[ default_java_version != "1.8."* ]]; then
echo "Fail to get java 8 home!"
exit 1
fi
fi
headInfo "test with Java 8"
./mvnw clean install --batch-mode
./scritps/run-agent-test.sh
# Java 6
if [ -n "$JAVA6_HOME" ]; then
headInfo "test with Java 6"
./scritps/run-junit.sh skipClean
./scritps/run-agent-test.sh skipClean
else
headInfo "skip Java 6 test"
fi
# Java 7
if [ -n "$JAVA7_HOME" ]; then
headInfo "test with Java 7"
./scritps/run-junit.sh skipClean
./scritps/run-agent-test.sh skipClean
else
headInfo "skip Java 7 test"
fi
# Java 9
if [ -n "$JAVA9_HOME" ]; then
headInfo "test with Java 9"
./scritps/run-junit.sh skipClean
./scritps/run-agent-test.sh skipClean
else
headInfo "skip Java 9 test"
fi
# Java 10
if [ -n "$JAVA10_HOME" ]; then
headInfo "test with Java 10"
./scritps/run-junit.sh skipClean
./scritps/run-agent-test.sh skipClean
else
headInfo "skip Java 10 test"
fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册