From 9f0411f1258d5ced675a59bf42e7f20006f7fa85 Mon Sep 17 00:00:00 2001 From: YUNSHEN XIE <1084314248@qq.com> Date: Thu, 8 Jul 2021 18:55:17 +0800 Subject: [PATCH] fix for no python coverage found (#33848) * fix error for no python coverage data --- tools/coverage/paddle_coverage.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/coverage/paddle_coverage.sh b/tools/coverage/paddle_coverage.sh index 7fb32040e7..c89926ebf9 100644 --- a/tools/coverage/paddle_coverage.sh +++ b/tools/coverage/paddle_coverage.sh @@ -119,13 +119,11 @@ gen_diff_html_report || true export COVERAGE_FILE=/paddle/build/python-coverage.data -set +x -coverage combine `ls python-coverage.data.*` -set -x +coverage combine `$(ls python-coverage.data.*)` || NO_PYTHON_COVERAGE_DATA=1 -coverage xml -i -o python-coverage.xml +`$(coverage xml -i -o python-coverage.xml)` || [[ "${NO_PYTHON_COVERAGE_DATA}" == "1" ]] -python3.7 ${PADDLE_ROOT}/tools/coverage/python_coverage.py > python-coverage.info +`$(python3.7 ${PADDLE_ROOT}/tools/coverage/python_coverage.py > python-coverage.info)` || [[ "${NO_PYTHON_COVERAGE_DATA}" == "1" ]] # python full html report # @@ -186,7 +184,9 @@ echo "Assert Python Diff Coverage" if [ ${WITH_XPU:-OFF} == "ON" ]; then echo "XPU has no python coverage!" else - python3.7 ${PADDLE_ROOT}/tools/coverage/coverage_lines.py python-coverage-diff.info 0.9 || PYTHON_COVERAGE_LINES_ASSERT=1 + if [[ "${NO_PYTHON_COVERAGE_DATA}" != "1" ]];then + python3.7 ${PADDLE_ROOT}/tools/coverage/coverage_lines.py python-coverage-diff.info 0.9 || PYTHON_COVERAGE_LINES_ASSERT=1 + fi fi if [ "$COVERAGE_LINES_ASSERT" = "1" ] || [ "$PYTHON_COVERAGE_LINES_ASSERT" = "1" ]; then -- GitLab