From 4a76e858e1bbec5934203e377f64839618d6ca6c Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Mon, 3 Dec 2018 18:42:33 +0000 Subject: [PATCH 1/3] Making ci/run_tests.sh fail if one of the steps fail --- ci/run_tests.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 77efc60a8cf97..1deefee1c8f69 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + if [ "$DOC" ]; then echo "We are not running pytest as this is a doc-build" exit 0 From 0a673100eabf93a2a690552d2406892ffc114a1c Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Mon, 3 Dec 2018 21:41:39 +0000 Subject: [PATCH 2/3] Fixing the pytest error when no tests are found for single and slow --- ci/run_tests.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 1deefee1c8f69..82e3da9f233a8 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -45,10 +45,15 @@ do NUM_JOBS=2 fi - pytest -m "$TYPE_PATTERN$PATTERN" -n $NUM_JOBS -s --strict --durations=10 --junitxml=test-data-$TYPE.xml $TEST_ARGS $COVERAGE pandas + PYTEST_CMD="pytest -m \"$TYPE_PATTERN$PATTERN\" -n $NUM_JOBS -s --strict --durations=10 --junitxml=test-data-$TYPE.xml $TEST_ARGS $COVERAGE pandas" + echo $PYTEST_CMD + # if no tests are found (the case of "single and slow"), pytest exits with code 5, and would make the script fail, if not for the below code + sh -c "$PYTEST_CMD; ret=\$?; [ \$ret = 5 ] && exit 0 || exit \$ret" if [[ "$COVERAGE" && $? == 0 ]]; then echo "uploading coverage for $TYPE tests" - bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME + COVERAGE_CMD="bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME" + echo $COVERAGE_CMD + $COVERAGE_CMD fi done From 07375c7e8007bf0796cd8f1f137f7b35e7d5dc7f Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Mon, 3 Dec 2018 22:15:33 +0000 Subject: [PATCH 3/3] Fixing error when uploading the coverage --- ci/run_tests.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 82e3da9f233a8..ee46da9f52eab 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -52,8 +52,7 @@ do if [[ "$COVERAGE" && $? == 0 ]]; then echo "uploading coverage for $TYPE tests" - COVERAGE_CMD="bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME" - echo $COVERAGE_CMD - $COVERAGE_CMD + echo "bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME" + bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME fi done