Skip to content

Commit 067aa55

Browse files
datapythonistaPingviinituutti
authored andcommitted
CI/TST: Making ci/run_tests.sh fail if one of the steps fail (pandas-dev#24075)
* Making ci/run_tests.sh fail if one of the steps fail * Fixing the pytest error when no tests are found for single and slow * Fixing error when uploading the coverage
1 parent 894af82 commit 067aa55

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ci/run_tests.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
set -e
4+
35
if [ "$DOC" ]; then
46
echo "We are not running pytest as this is a doc-build"
57
exit 0
@@ -43,10 +45,14 @@ do
4345
NUM_JOBS=2
4446
fi
4547

46-
pytest -m "$TYPE_PATTERN$PATTERN" -n $NUM_JOBS -s --strict --durations=10 --junitxml=test-data-$TYPE.xml $TEST_ARGS $COVERAGE pandas
48+
PYTEST_CMD="pytest -m \"$TYPE_PATTERN$PATTERN\" -n $NUM_JOBS -s --strict --durations=10 --junitxml=test-data-$TYPE.xml $TEST_ARGS $COVERAGE pandas"
49+
echo $PYTEST_CMD
50+
# 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
51+
sh -c "$PYTEST_CMD; ret=\$?; [ \$ret = 5 ] && exit 0 || exit \$ret"
4752

4853
if [[ "$COVERAGE" && $? == 0 ]]; then
4954
echo "uploading coverage for $TYPE tests"
50-
bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME
55+
echo "bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME"
56+
bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME
5157
fi
5258
done

0 commit comments

Comments
 (0)