Skip to content

Commit

Permalink
[SPARK-22327][SPARKR][TEST][BACKPORT-2.0] check for version warning
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?

backporting to 2.0 (since it's the first branch "older than" 2.1.2)

## How was this patch tested?

manually
Jenkins, AppVeyor

Author: Felix Cheung <felixcheung_m@hotmail.com>

Closes #19550 from felixcheung/rcranversioncheck20.
  • Loading branch information
felixcheung authored and Felix Cheung committed Oct 31, 2017
1 parent 28c0151 commit 076c2f6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ FAILED=$((PIPESTATUS[0]||$FAILED))
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)"
HAS_PACKAGE_VERSION_WARN="$(grep -c "Insufficient package version" $CRAN_CHECK_LOG_FILE)"

if [[ $FAILED != 0 ]]; then
cat $LOGFILE
Expand All @@ -44,9 +45,10 @@ if [[ $FAILED != 0 ]]; then
echo -en "\033[0m" # No color
exit -1
else
# We have 2 existing NOTEs for new maintainer, attach()
# We have one more NOTE in Jenkins due to "No repository set"
if [[ $NUM_CRAN_WARNING != 0 || $NUM_CRAN_ERROR != 0 || $NUM_CRAN_NOTES -gt 3 ]]; then
# We have 2 NOTEs for RoxygenNote, attach(); and one in Jenkins only "No repository set"
# For non-latest version branches, one WARNING for package version
if [[ ($NUM_CRAN_WARNING != 0 || $NUM_CRAN_ERROR != 0 || $NUM_CRAN_NOTES -gt 3) &&
($HAS_PACKAGE_VERSION_WARN != 1 || $NUM_CRAN_WARNING != 1 || $NUM_CRAN_ERROR != 0 || $NUM_CRAN_NOTES -gt 2) ]]; then
cat $CRAN_CHECK_LOG_FILE
echo -en "\033[31m" # Red
echo "Had CRAN check errors; see logs."
Expand Down

0 comments on commit 076c2f6

Please sign in to comment.