mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-01 06:42:23 +08:00
@@ -1,7 +1,11 @@
|
||||
#!/bin/bash
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
run_path="$DIR/../tests/"
|
||||
export PYTEST_INI="$DIR/../tests/pytest.ini"
|
||||
export PYTEST_INI="$DIR/../tests/cov_pytest.ini"
|
||||
|
||||
export COVERAGE_FILE=${COVERAGE_FILE:-$DIR/../coveragedata/.coverage}
|
||||
export COVERAGE_RCFILE=${COVERAGE_RCFILE:-$DIR/../scripts/.coveragerc}
|
||||
export COVERAGE_PROCESS_START=${COVERAGE_PROCESS_START:-$DIR/../scripts/.coveragerc}
|
||||
cd "$run_path" || exit 1
|
||||
|
||||
failed_tests_file="failed_tests.log"
|
||||
@@ -46,7 +50,7 @@ done
|
||||
# 执行 pytest,每个文件单独跑
|
||||
##################################
|
||||
# 收集 pytest 文件
|
||||
TEST_FILES=$(python -m pytest --collect-only -q -c pytest.ini --disable-warnings | grep -Eo '^.*test_.*\.py' | sort | uniq)
|
||||
TEST_FILES=$(python -m pytest --collect-only -q -c ${PYTEST_INI} --disable-warnings | grep -Eo '^.*test_.*\.py' | sort | uniq)
|
||||
|
||||
|
||||
failed_pytest=0
|
||||
@@ -54,7 +58,7 @@ success_pytest=0
|
||||
|
||||
for file in $TEST_FILES; do
|
||||
echo "Running pytest file: $file"
|
||||
python -m coverage run --parallel-mode -m pytest "$file" -vv -s
|
||||
python -m pytest -c ${PYTEST_INI} --cov-config=${COVERAGE_RCFILE} "$file" -vv -s
|
||||
status=$?
|
||||
if [ "$status" -ne 0 ]; then
|
||||
echo "$file" >> "$failed_tests_file"
|
||||
|
Reference in New Issue
Block a user