Skip to content

Commit

Permalink
更新python单元测试流水线脚本逻辑,解决增量覆盖率检测问题 (baidubce#590)
Browse files Browse the repository at this point in the history
* 更新python单元测试流水线脚本逻辑,解决增量覆盖率检测问题

Co-authored-by: yinjiaqi <[email protected]>
  • Loading branch information
C9luster and yinjiaqi authored Nov 12, 2024
1 parent 4d1ea98 commit 1e09e10
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/tests/run_python_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ python_lib=$(python3 -m pip show appbuilder-sdk | grep Location | awk '{print $2
git_dir=$(pwd | sed 's/python\/tests//')
# 批量替换coverage.xml文件中的python_lib为git_dir,并将源文件备份一个orignal.xml后缀
python3 -u sed_str.py coverage.xml $python_lib $git_dir
sed -i 's|/appbuilder|python|g' coverage.xml
# 最后进行增量代码覆盖率测试
echo "增量代码覆盖率为:"
diff-cover coverage.xml --compare-branch=upstream/master --html-report coverage_diff.html --fail-under=90
cover_result=$?


echo "--------------------------"
echo "CI 流水线运行结果如下: "
echo "单测运行结果: $run_result"
Expand Down

0 comments on commit 1e09e10

Please sign in to comment.