diff --git a/run-fe-ut.sh b/run-fe-ut.sh index 35d470753c3184..8fec64df4487d6 100755 --- a/run-fe-ut.sh +++ b/run-fe-ut.sh @@ -31,9 +31,14 @@ Usage: $0 Optional options: --coverage build and run coverage statistic --run build and run ut + -j build parallel, num is the number of threads, default 1 + -p unit test parallel, num is the number of forked JVMs, default 1 Eg. $0 build and run ut + $0 -j 4 build with 4 threads and run ut + $0 -p 3 run unit tests with 3 forked JVMs + $0 -j 4 -p 3 build with 4 threads and run unit tests with 3 forked JVMs $0 --coverage build and run coverage statistic $0 --run org.apache.doris.utframe.Demo build and run the test named Demo $0 --run org.apache.doris.utframe.Demo#testCreateDbAndTable+test2 build and run testCreateDbAndTable in Demo test @@ -44,7 +49,7 @@ Usage: $0 if ! OPTS="$(getopt \ -n "$0" \ - -o '' \ + -o 'j:p:' \ -l 'coverage' \ -l 'run' \ -- "$@")"; then @@ -55,8 +60,9 @@ eval set -- "${OPTS}" RUN=0 COVERAGE=0 +BUILD_PARALLEL=1 +UT_PARALLEL=1 if [[ "$#" == 1 ]]; then - #default RUN=0 COVERAGE=0 else @@ -72,6 +78,14 @@ else RUN=1 shift ;; + -j) + BUILD_PARALLEL="$2" + shift 2 + ;; + -p) + UT_PARALLEL="$2" + shift 2 + ;; --) shift break @@ -102,27 +116,23 @@ cd "${DORIS_HOME}/fe" mkdir -p build/compile if [[ -z "${FE_UT_PARALLEL}" ]]; then - # the default fe unit test parallel is 1 - export FE_UT_PARALLEL=1 + export FE_UT_PARALLEL="${UT_PARALLEL}" fi +echo "Build parallel is: ${BUILD_PARALLEL}" echo "Unit test parallel is: ${FE_UT_PARALLEL}" if [[ "${RUN}" -eq 1 ]]; then echo "Run the specified class: $1" - # eg: - # sh run-fe-ut.sh --run org.apache.doris.utframe.DemoTest - # sh run-fe-ut.sh --run org.apache.doris.utframe.DemoTest#testCreateDbAndTable+test2 - if [[ "${COVERAGE}" -eq 1 ]]; then - "${MVN_CMD}" -Pcoverage test jacoco:report -DfailIfNoTests=false -Dtest="$1" + "${MVN_CMD}" -T "${BUILD_PARALLEL}" -Pcoverage test jacoco:report -DfailIfNoTests=false -Dtest="$1" else - "${MVN_CMD}" test -Dcheckstyle.skip=true -DfailIfNoTests=false -Dmaven.build.cache.enabled=false -Dtest="$1" + "${MVN_CMD}" -T "${BUILD_PARALLEL}" test -Dcheckstyle.skip=true -DfailIfNoTests=false -Dmaven.build.cache.enabled=false -Dtest="$1" fi else echo "Run Frontend UT" if [[ "${COVERAGE}" -eq 1 ]]; then - "${MVN_CMD}" -Pcoverage test jacoco:report -DfailIfNoTests=false -Dmaven.test.failure.ignore=true + "${MVN_CMD}" -T "${BUILD_PARALLEL}" -Pcoverage test jacoco:report -DfailIfNoTests=false -Dmaven.test.failure.ignore=true else - "${MVN_CMD}" test -Dcheckstyle.skip=true -DfailIfNoTests=false -Dmaven.build.cache.enabled=false + "${MVN_CMD}" -T "${BUILD_PARALLEL}" test -Dcheckstyle.skip=true -DfailIfNoTests=false -Dmaven.build.cache.enabled=false fi fi