From: Tianqi Chen Date: Fri, 22 May 2020 01:37:58 +0000 (-0700) Subject: [CI] Add log check to the sphinx gallery docs (#5643) X-Git-Tag: upstream/0.7.0~682 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c365c2aa874c02b82cea89b9c9c2b8bb9d4a5083;p=platform%2Fupstream%2Ftvm.git [CI] Add log check to the sphinx gallery docs (#5643) * [CI] Add log check to the sphinx gallery docs This PR add log check to sphinx gallery tutorials to prevent the case when sphinx failed to capture the error in tutorials. * Fix the status --- diff --git a/tests/scripts/task_python_docs.sh b/tests/scripts/task_python_docs.sh index eaa705d..be2d792 100755 --- a/tests/scripts/task_python_docs.sh +++ b/tests/scripts/task_python_docs.sh @@ -20,6 +20,13 @@ set -e set -u source tests/scripts/setup-pytest-env.sh + +cleanup() +{ + rm -rf /tmp/$$.log.txt +} +trap cleanup 0 + # cleanup old states rm -rf docs/_build mkdir -p docs/_build/html @@ -36,7 +43,12 @@ find . -type f -path "*.pyc" | xargs rm -f make cython3 cd docs -PYTHONPATH=`pwd`/../python make html +PYTHONPATH=`pwd`/../python make html 2>/tmp/$$.log.txt +if grep -E "failed to execute" < /tmp/$$.log.txt; then + echo "Some of sphinx-gallery item example failed to execute." + cat /tmp/$$.log.txt + exit 1 +fi cd .. # C++ doc