Skip to content

Commit ad0b13f

Browse files
authored
Merge pull request #722 from nipy/ci/max_coverage
CI: Run coverage on as many tests as possible
2 parents 5537931 + bc0f6e7 commit ad0b13f

File tree

3 files changed

+25
-60
lines changed

3 files changed

+25
-60
lines changed

.travis.yml

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ matrix:
3030
- python: 3.4
3131
dist: trusty
3232
sudo: false
33-
- python: 2.7
34-
env:
35-
- COVERAGE=1
36-
- python: 3.5
37-
env:
38-
- COVERAGE=1
3933
# Absolute minimum dependencies
4034
- python: 2.7
4135
env:
@@ -99,25 +93,20 @@ matrix:
9993
env:
10094
- OPTIONAL_DEPENDS="indexed_gzip"
10195
before_install:
102-
- source tools/travis_tools.sh
103-
- python -m pip install --upgrade pip
104-
- pip install --upgrade virtualenv
96+
- travis_retry python -m pip install --upgrade pip
97+
- travis_retry pip install --upgrade virtualenv
10598
- virtualenv --python=python venv
10699
- source venv/bin/activate
107100
- python --version # just to check
108-
- pip install -U pip setuptools>=27.0 wheel
101+
- travis_retry pip install -U pip setuptools>=27.0 wheel
102+
- travis_retry pip install coverage
109103
- if [ "${CHECK_TYPE}" == "test" ]; then
110-
retry pip install nose mock;
104+
travis_retry pip install nose mock;
111105
fi
112106
- if [ "${CHECK_TYPE}" == "style" ]; then
113-
retry pip install flake8;
114-
fi
115-
- pip install $EXTRA_PIP_FLAGS $DEPENDS $OPTIONAL_DEPENDS
116-
- if [ "${COVERAGE}" == "1" ]; then
117-
pip install coverage;
118-
pip install coveralls;
119-
pip install codecov;
107+
travis_retry pip install flake8;
120108
fi
109+
- travis_retry pip install $EXTRA_PIP_FLAGS $DEPENDS $OPTIONAL_DEPENDS
121110
# command to install dependencies
122111
install:
123112
- |
@@ -128,7 +117,6 @@ install:
128117
python setup_egg.py sdist
129118
pip install $EXTRA_PIP_FLAGS dist/*.tar.gz
130119
elif [ "$INSTALL_TYPE" == "wheel" ]; then
131-
pip install wheel
132120
python setup_egg.py bdist_wheel
133121
pip install $EXTRA_PIP_FLAGS dist/*.whl
134122
elif [ "$INSTALL_TYPE" == "requirements" ]; then
@@ -146,7 +134,9 @@ script:
146134
elif [ "${CHECK_TYPE}" == "import" ]; then
147135
# Import nibabel without attempting to test
148136
# Allows us to check missing dependencies masked by testing libraries
149-
python -c 'import nibabel; print(nibabel.__version__)'
137+
printf 'import nibabel\nprint(nibabel.__version__)\n' > import_only.py
138+
cat import_only.py
139+
coverage run import_only.py
150140
elif [ "${CHECK_TYPE}" == "doc_doctests" ]; then
151141
cd doc
152142
pip install -r ../doc-requirements.txt
@@ -156,16 +146,18 @@ script:
156146
# Change into an innocuous directory and find tests from installation
157147
mkdir for_testing
158148
cd for_testing
159-
if [ "${COVERAGE}" == "1" ]; then
160-
cp ../.coveragerc .;
161-
COVER_ARGS="--with-coverage --cover-package nibabel";
162-
fi
163-
nosetests --with-doctest $COVER_ARGS nibabel;
149+
cp ../.coveragerc .
150+
nosetests --with-doctest --with-coverage --cover-package nibabel nibabel
164151
else
165152
false
166153
fi
167154
after_success:
168-
- if [ "${COVERAGE}" == "1" ]; then coveralls; codecov; fi
155+
- |
156+
if [ "${CHECK_TYPE}" == "test" ]; then
157+
travis_retry pip install coveralls codecov
158+
coveralls
159+
codecov
160+
fi
169161
170162
notifications:
171163
webhooks: http://nipy.bic.berkeley.edu:54856/travis

appveyor.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ install:
2323

2424
# Install the dependencies of the project.
2525
- python -m pip install --upgrade pip setuptools wheel
26-
- pip install numpy scipy matplotlib nose h5py mock pydicom
26+
- pip install numpy scipy matplotlib h5py pydicom
27+
- pip install nose mock coverage codecov
2728
- pip install .
2829
- SET NIBABEL_DATA_DIR=%CD%\nibabel-data
2930

@@ -33,4 +34,8 @@ test_script:
3334
# Change into an innocuous directory and find tests from installation
3435
- mkdir for_testing
3536
- cd for_testing
36-
- nosetests --with-doctest nibabel
37+
- cp ../.coveragerc .
38+
- nosetests --with-doctest --with-coverage --cover-package nibabel nibabel
39+
40+
after_test:
41+
- codecov

tools/travis_tools.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)