提交 cf6cb877 编写于 作者: D Donald Stufft

Merge pull request #1910 from dstufft/ugh

Use diff-cover to show the change in coverage
...@@ -8,3 +8,4 @@ MANIFEST ...@@ -8,3 +8,4 @@ MANIFEST
*.py[cod] *.py[cod]
*~ *~
.coverage .coverage
coverage.xml
...@@ -6,4 +6,4 @@ git config --global user.email "pypa-dev@googlegroups.com" ...@@ -6,4 +6,4 @@ git config --global user.email "pypa-dev@googlegroups.com"
git config --global user.name "pip" git config --global user.name "pip"
pip install --upgrade setuptools pip install --upgrade setuptools
pip install tox pip install tox diff_cover
...@@ -7,7 +7,7 @@ set -x ...@@ -7,7 +7,7 @@ set -x
export LC_CTYPE=en_US.UTF-8 export LC_CTYPE=en_US.UTF-8
# Run the unit tests # Run the unit tests
tox -- -m unit tox -- -m unit --cov pip/ --cov-report xml
# Run our integration tests, typically with pytest-xdist to speed things up # Run our integration tests, typically with pytest-xdist to speed things up
# except on Python 3.2 where it doesn't work quite right. # except on Python 3.2 where it doesn't work quite right.
...@@ -19,3 +19,22 @@ case $TOXENV in ...@@ -19,3 +19,22 @@ case $TOXENV in
tox -- -m integration -n 8 tox -- -m integration -n 8
;; ;;
esac esac
if [[ $TRAVIS_PULL_REQUEST != "false" ]]
then
# If this is a pull request then run our diff-cover to get the difference
# in coverage that this PR introduces
if [ -f coverage.xml ]
then
git fetch origin $TRAVIS_BRANCH:refs/remotes/origin/$TRAVIS_BRANCH
diff-cover --compare-branch=origin/$TRAVIS_BRANCH coverage.xml
fi
else
# If this is not a PR, but is being run against a branch, then just report
# the coverage results for the entire code base.
if [ -f .coverage ]
then
coverage report -m
fi
fi
...@@ -13,7 +13,7 @@ deps = ...@@ -13,7 +13,7 @@ deps =
scripttest>=1.3 scripttest>=1.3
https://github.com/pypa/virtualenv/archive/develop.zip#egg=virtualenv https://github.com/pypa/virtualenv/archive/develop.zip#egg=virtualenv
commands = commands =
py.test --cov pip/ --cov-report term-missing --timeout 300 [] py.test --timeout 300 []
[testenv:docs] [testenv:docs]
deps = sphinx deps = sphinx
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册