Repository: spark
Updated Branches:
  refs/heads/master b3b4b9542 -> 4efdc764e


[SPARK-17674][SPARKR] check for warning in test output

## What changes were proposed in this pull request?

testthat library we are using for testing R is redirecting warning (and 
disabling `options("warn" = 2)`), we need to have a way to detect any new 
warning and fail

## How was this patch tested?

manual testing, Jenkins

Author: Felix Cheung <felixcheun...@hotmail.com>

Closes #15576 from felixcheung/rtestwarning.


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

Branch: refs/heads/master
Commit: 4efdc764edfbc4971f0e863947258482ca2017df
Parents: b3b4b95
Author: Felix Cheung <felixcheun...@hotmail.com>
Authored: Fri Oct 21 12:34:14 2016 -0700
Committer: Felix Cheung <felixche...@apache.org>
Committed: Fri Oct 21 12:34:14 2016 -0700

----------------------------------------------------------------------
 R/run-tests.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/4efdc764/R/run-tests.sh
----------------------------------------------------------------------
diff --git a/R/run-tests.sh b/R/run-tests.sh
index 1a1e8ab..5e4dafa 100755
--- a/R/run-tests.sh
+++ b/R/run-tests.sh
@@ -26,6 +26,8 @@ rm -f $LOGFILE
 SPARK_TESTING=1 $FWDIR/../bin/spark-submit --driver-java-options 
"-Dlog4j.configuration=file:$FWDIR/log4j.properties" --conf 
spark.hadoop.fs.default.name="file:///" $FWDIR/pkg/tests/run-all.R 2>&1 | tee 
-a $LOGFILE
 FAILED=$((PIPESTATUS[0]||$FAILED))
 
+NUM_TEST_WARNING="$(grep -c -e 'Warnings ----------------' $LOGFILE)"
+
 # Also run the documentation tests for CRAN
 CRAN_CHECK_LOG_FILE=$FWDIR/cran-check.out
 rm -f $CRAN_CHECK_LOG_FILE
@@ -37,10 +39,10 @@ NUM_CRAN_WARNING="$(grep -c WARNING$ $CRAN_CHECK_LOG_FILE)"
 NUM_CRAN_ERROR="$(grep -c ERROR$ $CRAN_CHECK_LOG_FILE)"
 NUM_CRAN_NOTES="$(grep -c NOTE$ $CRAN_CHECK_LOG_FILE)"
 
-if [[ $FAILED != 0 ]]; then
+if [[ $FAILED != 0 || $NUM_TEST_WARNING != 0 ]]; then
     cat $LOGFILE
     echo -en "\033[31m"  # Red
-    echo "Had test failures; see logs."
+    echo "Had test warnings or failures; see logs."
     echo -en "\033[0m"  # No color
     exit -1
 else


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to