Skip to content

Commit 03d684e

Browse files
committed
CI: add in support for coverage via Codecov
Author: Jeff Reback <[email protected]> Closes #12632 from jreback/codecov and squashes the following commits: 47d7351 [Jeff Reback] CI: add codecov cf06455 [Jeff Reback] CI: remove BUILD_TYPE env variable
1 parent 80ef4e0 commit 03d684e

File tree

4 files changed

+24
-16
lines changed

4 files changed

+24
-16
lines changed

.travis.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,26 @@ matrix:
3636
- LOCALE_OVERRIDE="zh_CN.GB18030"
3737
- FULL_DEPS=true
3838
- JOB_TAG=_LOCALE
39-
- BUILD_TYPE=conda
4039
- python: 2.7
4140
env:
4241
- JOB_NAME: "27_nslow"
4342
- NOSE_ARGS="not slow and not disabled"
4443
- FULL_DEPS=true
4544
- CLIPBOARD_GUI=gtk2
45+
- LINT=true
4646
- python: 3.4
4747
env:
4848
- JOB_NAME: "34_nslow"
4949
- NOSE_ARGS="not slow and not disabled"
5050
- FULL_DEPS=true
5151
- CLIPBOARD=xsel
52-
- BUILD_TYPE=conda
5352
- python: 3.5
5453
env:
5554
- JOB_NAME: "35_nslow"
5655
- NOSE_ARGS="not slow and not network and not disabled"
5756
- FULL_DEPS=true
5857
- CLIPBOARD=xsel
58+
- COVERAGE=true
5959
- python: 2.7
6060
env:
6161
- JOB_NAME: "27_slow"
@@ -87,14 +87,12 @@ matrix:
8787
- JOB_NAME: "27_nslow_nnet_COMPAT"
8888
- NOSE_ARGS="not slow and not network and not disabled"
8989
- LOCALE_OVERRIDE="it_IT.UTF-8"
90-
- BUILD_TYPE=conda
9190
- INSTALL_TEST=true
9291
- JOB_TAG=_COMPAT
9392
- python: 2.7
9493
env:
9594
- JOB_NAME: "doc_build"
9695
- FULL_DEPS=true
97-
- BUILD_TYPE=conda
9896
- DOC_BUILD=true # if rst files were changed, build docs in parallel with tests
9997
- JOB_TAG=_DOC_BUILD
10098
allow_failures:
@@ -129,14 +127,12 @@ matrix:
129127
- JOB_NAME: "27_nslow_nnet_COMPAT"
130128
- NOSE_ARGS="not slow and not network and not disabled"
131129
- LOCALE_OVERRIDE="it_IT.UTF-8"
132-
- BUILD_TYPE=conda
133130
- INSTALL_TEST=true
134131
- JOB_TAG=_COMPAT
135132
- python: 2.7
136133
env:
137134
- JOB_NAME: "doc_build"
138135
- FULL_DEPS=true
139-
- BUILD_TYPE=conda
140136
- DOC_BUILD=true
141137
- JOB_TAG=_DOC_BUILD
142138

@@ -159,14 +155,17 @@ install:
159155
- ci/submit_ccache.sh
160156

161157
before_script:
158+
- source activate pandas && pip install codecov
162159
- ci/install_db.sh
163160

164161
script:
165162
- echo "script"
166163
- ci/run_build_docs.sh
167164
- ci/script.sh
168165
- ci/lint.sh
169-
# nothing here, or failed tests won't fail travis
166+
167+
after_success:
168+
- source activate pandas && codecov
170169

171170
after_script:
172171
- ci/install_test.sh

ci/install_travis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ conda info -a || exit 1
8585

8686
# build deps
8787
REQ="ci/requirements-${TRAVIS_PYTHON_VERSION}${JOB_TAG}.build"
88-
time conda create -n pandas python=$TRAVIS_PYTHON_VERSION nose flake8 || exit 1
88+
time conda create -n pandas python=$TRAVIS_PYTHON_VERSION nose coverage flake8 || exit 1
8989

9090
# may have additional installation instructions for this build
9191
INSTALL="ci/install-${TRAVIS_PYTHON_VERSION}${JOB_TAG}.sh"

ci/lint.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ echo "inside $0"
55
source activate pandas
66

77
RET=0
8-
for path in 'core' 'io' 'stats' 'compat' 'sparse' 'tools' 'tseries' 'tests' 'computation' 'util'
9-
do
10-
echo "linting -> pandas/$path"
11-
flake8 pandas/$path --filename '*.py'
12-
if [ $? -ne "0" ]; then
13-
RET=1
14-
fi
15-
done
8+
9+
if [ "$LINT" ]; then
10+
echo "Linting"
11+
for path in 'core' 'io' 'stats' 'compat' 'sparse' 'tools' 'tseries' 'tests' 'computation' 'util'
12+
do
13+
echo "linting -> pandas/$path"
14+
flake8 pandas/$path --filename '*.py'
15+
if [ $? -ne "0" ]; then
16+
RET=1
17+
fi
18+
done
19+
else
20+
echo "NOT Linting"
21+
fi
1622

1723
exit $RET

ci/script.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ fi
1919

2020
if [ "$BUILD_TEST" ]; then
2121
echo "We are not running nosetests as this is simply a build test."
22+
elif [ "$COVERAGE" ]; then
23+
echo nosetests --exe -A "$NOSE_ARGS" pandas --with-coverage --with-xunit --xunit-file=/tmp/nosetests.xml
24+
nosetests --exe -A "$NOSE_ARGS" pandas --with-coverage --cover-package=pandas --cover-tests --with-xunit --xunit-file=/tmp/nosetests.xml
2225
else
2326
echo nosetests --exe -A "$NOSE_ARGS" pandas --doctest-tests --with-xunit --xunit-file=/tmp/nosetests.xml
2427
nosetests --exe -A "$NOSE_ARGS" pandas --doctest-tests --with-xunit --xunit-file=/tmp/nosetests.xml

0 commit comments

Comments
 (0)