8000 TST: Integrate codecov testing by alyssaq · Pull Request #11567 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

TST: Integrate codecov testing #11567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
codecov:
ci:
- !appveyor
coverage:
status:
project:
default:
# Require 1% coverage, i.e., always succeed
target: 1
comment: off
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ matrix:
- python3-dev
- python3-setuptools
- python: 3.6
env: USE_WHEEL=1 RUN_FULL_TESTS=1
env: USE_WHEEL=1 RUN_FULL_TESTS=1 RUN_COVERAGE=1
- python: 2.7
env: USE_WHEEL=1 RUN_FULL_TESTS=1 PYTHON_OPTS="-3 -OO"
- python: 3.6
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Travis](https://img.shields.io/travis/numpy/numpy/master.svg?label=Travis%20CI)](https://travis-ci.org/numpy/numpy)
[![AppVeyor](https://img.shields.io/appveyor/ci/charris/numpy/master.svg?label=AppVeyor)](https://ci.appveyor.com/project/charris/numpy)
[![codecov](https://codecov.io/gh/numpy/numpy/branch/master/graph/badg 10000 e.svg)](https://codecov.io/gh/numpy/numpy)

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

Expand Down
4 changes: 4 additions & 0 deletions tools/test-installed-numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
print('NPY_RELAXED_STRIDES_CHECKING not set, but active.')
sys.exit(1)

if options.coverage:
# Produce code coverage XML report for codecov.io
args += ["--cov-report=xml"]

result = numpy.test(options.mode,
verbose=options.verbose,
extra_argv=args,
Expand Down
15 changes: 13 additions & 2 deletions tools/travis-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ run_test()
export PYTHONPATH=$PWD
fi

if [ -n "$RUN_COVERAGE" ]; then
pip install pytest-cov
COVERAGE_FLAG=--coverage
fi

# We change directories to make sure that python won't find the copy
# of numpy in the source directory.
mkdir -p empty
Expand All @@ -113,10 +118,17 @@ run_test()
"import os; import numpy; print(os.path.dirname(numpy.__file__))")
export PYTHONWARNINGS=default
if [ -n "$RUN_FULL_TESTS" ]; then
$PYTHON ../tools/test-installed-numpy.py -v --mode=full
export PYTHONWARNINGS="ignore::DeprecationWarning:virtualenv"
$PYTHON ../tools/test-installed-numpy.py -v --mode=full $COVERAGE_FLAG
else
$PYTHON ../tools/test-installed-numpy.py -v
fi

if [ -n "$RUN_COVERAGE" ]; then
# Upload coverage files to codecov
bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tylerjereddy Is this preferred over installing codecov from pip?

fi

if [ -n "$USE_ASV" ]; then
pushd ../benchmarks
$PYTHON `which asv` machine --machine travis
Expand Down Expand Up @@ -181,4 +193,3 @@ else
setup_base
run_test
fi

0