flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ches...@apache.org
Subject flink git commit: [FLINK-7176] [travis] Improve error handling
Date Thu, 20 Jul 2017 17:31:19 GMT
Repository: flink
Updated Branches:
  refs/heads/master 3a503cd30 -> b3b35dbf5


[FLINK-7176] [travis] Improve error handling

This closes #4330.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/b3b35dbf
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/b3b35dbf
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/b3b35dbf

Branch: refs/heads/master
Commit: b3b35dbf5271dc8a64b06a575d3a8ed37df4ef35
Parents: 3a503cd
Author: zentol <chesnay@apache.org>
Authored: Thu Jul 13 17:53:40 2017 +0200
Committer: zentol <chesnay@apache.org>
Committed: Thu Jul 20 17:06:15 2017 +0200

----------------------------------------------------------------------
 tools/travis_mvn_watchdog.sh | 55 +++++++++++++++++++++++++--------------
 1 file changed, 35 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/b3b35dbf/tools/travis_mvn_watchdog.sh
----------------------------------------------------------------------
diff --git a/tools/travis_mvn_watchdog.sh b/tools/travis_mvn_watchdog.sh
index 6d98790..1c1172e 100755
--- a/tools/travis_mvn_watchdog.sh
+++ b/tools/travis_mvn_watchdog.sh
@@ -272,7 +272,7 @@ check_shaded_artifacts() {
 		echo "=============================================================================="
 		echo "Detected $ASM asm dependencies in fat jar"
 		echo "=============================================================================="
-		exit 1
+		return 1
 	fi
 	 
 	GUAVA=`cat allClasses | grep '^com/google/common' | wc -l`
@@ -280,7 +280,7 @@ check_shaded_artifacts() {
 		echo "=============================================================================="
 		echo "Detected $GUAVA guava dependencies in fat jar"
 		echo "=============================================================================="
-		exit 1
+		return 1
 	fi
 
 	SNAPPY=`cat allClasses | grep '^org/xerial/snappy' | wc -l`
@@ -288,8 +288,9 @@ check_shaded_artifacts() {
 		echo "=============================================================================="
 		echo "Missing snappy dependencies in fat jar"
 		echo "=============================================================================="
-		exit 1
+		return 1
 	fi
+	return 0
 }
 
 # =============================================================================
@@ -346,38 +347,52 @@ echo "MVN exited with EXIT CODE: ${EXIT_CODE}."
 rm $MVN_PID
 rm $MVN_EXIT
 
-# Run tests
+# Run tests if compilation was successful
+if [ $EXIT_CODE == 0 ]; then
 
-echo "RUNNING '${MVN_TEST}'."
+	echo "RUNNING '${MVN_TEST}'."
 
-# Run $MVN_TEST and pipe output to $MVN_OUT for the watchdog. The PID is written to $MVN_PID
to
-# allow the watchdog to kill $MVN if it is not producing any output anymore. $MVN_EXIT contains
-# the exit code. This is important for Travis' build life-cycle (success/failure).
-( $MVN_TEST & PID=$! ; echo $PID >&3 ; wait $PID ; echo $? >&4 ) 3>$MVN_PID
4>$MVN_EXIT | tee $MVN_OUT
+	# Run $MVN_TEST and pipe output to $MVN_OUT for the watchdog. The PID is written to $MVN_PID
to
+	# allow the watchdog to kill $MVN if it is not producing any output anymore. $MVN_EXIT contains
+	# the exit code. This is important for Travis' build life-cycle (success/failure).
+	( $MVN_TEST & PID=$! ; echo $PID >&3 ; wait $PID ; echo $? >&4 ) 3>$MVN_PID
4>$MVN_EXIT | tee $MVN_OUT
 
-echo "Trying to KILL watchdog (${WD_PID})."
+	echo "Trying to KILL watchdog (${WD_PID})."
 
-# Make sure to kill the watchdog in any case after $MVN has completed
-( kill $WD_PID 2>&1 ) > /dev/null
+	# Make sure to kill the watchdog in any case after $MVN has completed
+	( kill $WD_PID 2>&1 ) > /dev/null
 
-EXIT_CODE=$(<$MVN_EXIT)
+	EXIT_CODE=$(<$MVN_EXIT)
 
-echo "MVN exited with EXIT CODE: ${EXIT_CODE}."
+	echo "MVN exited with EXIT CODE: ${EXIT_CODE}."
 
-rm $MVN_PID
-rm $MVN_EXIT
+	rm $MVN_PID
+	rm $MVN_EXIT
+else
+	echo "=============================================================================="
+	echo "Compilation failure detected, skipping test execution."
+	echo "=============================================================================="
+fi
 
 # Post
 
-# only misc builds flink-dist
+# only misc builds flink-dist and flink-yarn-tests
 case $TEST in
 	(misc)
-		check_shaded_artifacts
+		put_yarn_logs_to_artifacts
+
+		if [ $EXIT_CODE == 0 ]; then
+			check_shaded_artifacts
+			EXIT_CODE=$?
+		else
+			echo "=============================================================================="
+			echo "Compilation/test failure detected, skipping shaded dependency check."
+			echo "=============================================================================="
+		fi
+
 	;;
 esac
 
-put_yarn_logs_to_artifacts
-
 upload_artifacts_s3
 
 # since we are in flink/tools/artifacts


Mime
View raw message