浏览代码

Try and use the exit value and the output of go test

Ben Hood 11 年之前
父节点
当前提交
4cf08d0882
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      integration.sh

+ 5 - 2
integration.sh

@@ -21,7 +21,9 @@ function run_tests() {
 		proto=1
 	fi
 
-	go test -timeout 3m -tags integration -cover -v -runssl -proto=$proto -rf=3 -cluster=$(ccm liveset) -clusterSize=$clusterSize -autowait=2000ms ./... | tee results.txt || {
+	go test -timeout 5m -tags integration -cover -v -runssl -proto=$proto -rf=3 -cluster=$(ccm liveset) -clusterSize=$clusterSize -autowait=2000ms ./... | tee results.txt
+
+	if [ ${PIPESTATUS[0]} -ne 0 ]; then 
 		echo "--- FAIL: ccm status follows:"
 		ccm status
 		ccm node1 nodetool status
@@ -29,9 +31,10 @@ function run_tests() {
 		cat status.log
 		echo "--- FAIL: Received a non-zero exit code from the go test execution, please investigate this"
 		exit 1
-	}
+	fi
 
 	cover=`cat results.txt | grep coverage: | grep -o "[0-9]\{1,3\}" | head -n 1`
+
 	if [[ $cover -lt "60" ]]; then
 		echo "--- FAIL: expected coverage of at least 60 %, but coverage was $cover %"
 		exit 1