8000 codecov integration. scipy2018 sprint. · numpy/numpy@5eae3ec · GitHub
[go: up one dir, main page]

Skip to content

Commit 5eae3ec

Browse files
committed
codecov integration. scipy2018 sprint.
1 parent c8b246c commit 5eae3ec

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

.codecov.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
codecov:
2+
ci:
3+
- !appveyor
4+
coverage:
5+
status:
6+
project:
7+
default:
8+
# Require 1% coverage, i.e., always succeed
9+
target: 1
10+
comment: off

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ matrix:
5858
- python3-dev
5959
- python3-setuptools
6060
- python: 3.6
61-
env: USE_WHEEL=1 RUN_FULL_TESTS=1
61+
env: USE_WHEEL=1 RUN_FULL_TESTS=1 RUN_COVERAGE=1
6262
- python: 2.7
6363
env: USE_WHEEL=1 RUN_FULL_TESTS=1 PYTHON_OPTS="-3 -OO"
6464
- python: 3.6

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Travis](https://img.shields.io/travis/numpy/numpy/master.svg?label=Travis%20CI)](https://travis-ci.org/numpy/numpy)
44
[![AppVeyor](https://img.shields.io/appveyor/ci/charris/numpy/master.svg?label=AppVeyor)](https://ci.appveyor.com/project/charris/numpy)
5+
[![codecov](https://codecov.io/gh/numpy/numpy/branch/master/graph/badge.svg)](https://codecov.io/gh/numpy/numpy)
56

67
NumPy is the fundamental package needed for scientific computing with Python.
78

tools/test-installed-numpy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
print('NPY_RELAXED_STRIDES_CHECKING not set, but active.')
4747
sys.exit(1)
4848

49+
if options.coverage:
50+
# Produce code coverage XML report for codecov.io
51+
args += ["--cov-report=xml"]
52+
4953
result = numpy.test(options.mode,
5054
verbose=options.verbose,
5155
extra_argv=args,

tools/travis-test.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ run_test()
105105
export PYTHONPATH=$PWD
106106
fi
107107

108+
if [ -n "$RUN_COVERAGE" ]; then
109+
pip install pytest-cov
110+
COVERAGE_FLAG=--coverage
111+
fi
112+
108113
# We change directories to make sure that python won't find the copy
109114
# of numpy in the source directory.
110115
mkdir -p empty
@@ -113,10 +118,17 @@ run_test()
113118
"import os; import numpy; print(os.path.dirname(numpy.__file__))")
114119
export PYTHONWARNINGS=default
115120
if [ -n "$RUN_FULL_TESTS" ]; then
116-
$PYTHON ../tools/test-installed-numpy.py -v --mode=full
121+
export PYTHONWARNINGS="ignore::DeprecationWarning:virtualenv"
122+
$PYTHON ../tools/test-installed-numpy.py -v --mode=full $COVERAGE_FLAG
117123
else
118124
$PYTHON ../tools/test-installed-numpy.py -v
119125
fi
126+
127+
if [ -n "$RUN_COVERAGE" ]; then
128+
# Upload coverage files to codecov
129+
bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy
130+
fi
131+
120132
if [ -n "$USE_ASV" ]; then
121133
pushd ../benchmarks
122134
$PYTHON `which asv` machine --machine travis
@@ -181,4 +193,3 @@ else
181193
setup_base
182194
run_test
183195
fi
184-

0 commit comments

Comments
 (0)
0