diff --git a/hadoop-ozone/dev-support/checks/_post_process.sh b/hadoop-ozone/dev-support/checks/_post_process.sh index ac05e2c00043..7501050f34f8 100644 --- a/hadoop-ozone/dev-support/checks/_post_process.sh +++ b/hadoop-ozone/dev-support/checks/_post_process.sh @@ -26,13 +26,13 @@ # - $REPORT_FILE should be defined # - Maven output should be saved in $REPORT_DIR/output.log -# script failed, but report file is empty (does not reflect failure) -if [[ ${rc} -ne 0 ]] && [[ ! -s "${REPORT_FILE}" ]]; then - # do we know what to look for? +if [[ ! -s "${REPORT_FILE}" ]]; then + # check if there are errors in the log if [[ -n "${ERROR_PATTERN:-}" ]]; then grep -m25 "${ERROR_PATTERN}" "${REPORT_DIR}/output.log" > "${REPORT_FILE}" fi - if [[ ! -s "${REPORT_FILE}" ]]; then + # script failed, but report file is empty (does not reflect failure) + if [[ ${rc} -ne 0 ]] && [[ ! -s "${REPORT_FILE}" ]]; then echo "Unknown failure, check output.log" > "${REPORT_FILE}" fi fi diff --git a/hadoop-ozone/dev-support/checks/junit.sh b/hadoop-ozone/dev-support/checks/junit.sh index 46f1fd77f2b1..7c25293c5d74 100755 --- a/hadoop-ozone/dev-support/checks/junit.sh +++ b/hadoop-ozone/dev-support/checks/junit.sh @@ -40,7 +40,7 @@ fi if [[ "${FAIL_FAST}" == "true" ]]; then MAVEN_OPTIONS="${MAVEN_OPTIONS} --fail-fast -Dsurefire.skipAfterFailureCount=1" else - MAVEN_OPTIONS="${MAVEN_OPTIONS} --fail-at-end" + MAVEN_OPTIONS="${MAVEN_OPTIONS} --fail-never" fi # apply module access args (for Java 9+) @@ -50,8 +50,10 @@ if [[ -f hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh ]]; then ozone_java_setup fi +mvn ${MAVEN_OPTIONS} clean + if [[ ${ITERATIONS} -gt 1 ]] && [[ ${OZONE_REPO_CACHED} == "false" ]]; then - mvn ${MAVEN_OPTIONS} -DskipTests clean install + mvn ${MAVEN_OPTIONS} -DskipTests install fi REPORT_DIR=${OUTPUT_DIR:-"$DIR/../../../target/${CHECK}"} @@ -105,5 +107,5 @@ if [[ "${OZONE_WITH_COVERAGE}" == "true" ]]; then mvn -B -N jacoco:merge -Djacoco.destFile=$REPORT_DIR/jacoco-combined.exec -Dscan=false fi -ERROR_PATTERN="\[ERROR\]" +ERROR_PATTERN="BUILD FAILURE" source "${DIR}/_post_process.sh"