Skip to content

Commit 4b67fe0

Browse files
committed
deep revision of old failures
1 parent 2a811d4 commit 4b67fe0

File tree

7 files changed

+52
-34
lines changed

7 files changed

+52
-34
lines changed

.circle/tests.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ fi
1717
# They may need to be rebalanced in the future.
1818
case ${CIRCLE_NODE_INDEX} in
1919
0)
20-
docker run --rm -it -e FSL_COURSE_DATA="/data/examples/nipype-fsl_course_data" -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /src/nipype nipype/nipype:py27 /usr/bin/run_pytests.sh py27 && \
21-
docker run --rm -it -e FSL_COURSE_DATA="/data/examples/nipype-fsl_course_data" -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /src/nipype nipype/nipype:py35 /usr/bin/run_pytests.sh py35 && \
20+
docker run --rm -it -e FSL_COURSE_DATA="/data/examples/nipype-fsl_course_data" -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_pytests.sh && \
21+
docker run --rm -it -e FSL_COURSE_DATA="/data/examples/nipype-fsl_course_data" -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py27 /usr/bin/run_pytests.sh && \
2222
docker run --rm -it -v $WORKDIR:/work -w /src/nipype/doc nipype/nipype:py35 /usr/bin/run_builddocs.sh && \
2323
docker run --rm -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh test_spm Linear /data/examples/ workflow3d && \
2424
docker run --rm -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh test_spm Linear /data/examples/ workflow4d

.coveragerc

+21-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
[run]
22
branch = True
3-
include = */nipype/*
3+
source = nipype/
44
omit =
5-
*/nipype/external/*
6-
*/nipype/fixes/*
7-
*/setup.py
5+
external/*
6+
fixes/*
7+
*/tests/*
8+
9+
[report]
10+
exclude_lines =
11+
# Have to re-enable the standard pragma
12+
pragma: no cover
13+
14+
# Don't complain about missing debug-only code:
15+
def __repr__
16+
if self\.debug
17+
18+
# Don't complain if tests don't hit defensive assertion code:
19+
raise AssertionError
20+
raise NotImplementedError
21+
22+
# Don't complain if non-runnable code isn't run:
23+
if 0:
24+
if __name__ == .__main__.:

.dockerignore

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# python cache
2-
__pycache__/**/*
32
__pycache__
3+
**/__pycache__
4+
**/*.pyc
45
*.pyc
56

67
# python distribution
@@ -26,11 +27,10 @@ docs/
2627
.circle/**/*
2728
.circle/
2829
circle.yml
29-
.coverage
30-
.coveragerc
31-
codecov.yml
3230
rtd_requirements.txt
3331
Vagrantfile
3432
.travis.yml
35-
.noserc
33+
.mailmap
3634

35+
# Previous coverage results
36+
.coverage

codecov.yml

+4
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ coverage:
2222
threshold: 100
2323
flags:
2424
- "smoketests"
25+
ignore: # files and folders that will be removed during processing
26+
- "nipype/external/*"
27+
- "tools/*"
28+
- "doc/*"

docker/files/run_examples.sh

+7-15
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,15 @@ echo "log_to_file = true" >> ${HOME}/.nipype/nipype.cfg
1717
echo "log_directory = ${WORKDIR}/logs/example_${example_id}" >> ${HOME}/.nipype/nipype.cfg
1818

1919
# Set up coverage
20-
echo "[run]" >> .coveragerc
21-
echo "branch = True" >> .coveragerc
22-
echo "source = /src/nipype" >> .coveragerc
23-
echo "include = */nipype/*" >> .coveragerc
24-
echo "omit =" >> .coveragerc
25-
echo " */nipype/external/*" >> .coveragerc
26-
echo " */nipype/fixes/*" >> .coveragerc
27-
echo " */setup.py" >> .coveragerc
20+
sed -i -E "s/(source = ).*'/\1\/src\/nipype\/nipype/" /src/nipype/.coveragerc
2821

29-
30-
parallel=""
3122
if [ "$2" == "MultiProc" ]; then
32-
parallel="--concurrency=multiprocessing"
23+
echo "concurrency = multiprocessing" >> /src/nipype/.coveragerc
3324
fi
3425

35-
coverage run ${parallel} /src/nipype/tools/run_examples.py $@
36-
test_exit=$?
37-
coverage xml -o "${WORKDIR}/smoketest_${example_id}.xml"
26+
coverage run --rcfile=/src/nipype/.coveragerc /src/nipype/tools/run_examples.py $@
27+
exit_code=$?
28+
29+
coverage xml -o ${WORKDIR}/smoketest_${example_id}.xml || true
3830

39-
exit $test_exit
31+
exit $exit_code

docker/files/run_pytests.sh

+10-8
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,21 @@ if [[ "${PYTHON_VERSION}" -lt "30" ]]; then
2121
echo 'profile_runtime = true' >> ${HOME}/.nipype/nipype.cfg
2222
fi
2323

24-
cd /src/nipype/
25-
make clean
2624
# Run tests using pytest
27-
py.test -n ${CIRCLE_NCPUS:-4} --doctest-modules --junitxml=${WORKDIR}/pytests_py${PYTHON_VERSION}.xml --cov-report xml:${WORKDIR}/coverage_py${PYTHON_VERSION}.xml --cov=nipype nipype
28-
25+
py.test -n ${CIRCLE_NCPUS:-1} -v --junitxml=${WORKDIR}/pytests_py${PYTHON_VERSION}.xml --cov-config /src/nipype/.coveragerc --cov-report xml:${WORKDIR}/coverage_py${PYTHON_VERSION}.xml /src/nipype/
26+
exit_code=$?
2927

3028
# Workaround: run here the profiler tests in python 3
3129
if [[ "${PYTHON_VERSION}" -ge "30" ]]; then
3230
echo '[execution]' >> ${HOME}/.nipype/nipype.cfg
3331
echo 'profile_runtime = true' >> ${HOME}/.nipype/nipype.cfg
34-
py.test -n ${CIRCLE_NCPUS:-4} --junitxml=${WORKDIR}/pytests_py${PYTHON_VERSION}_profiler.xml --cov-report xml:${WORKDIR}/coverage_py${PYTHON_VERSION}_profiler.xml --cov=nipype nipype/interfaces/tests/test_runtime_profiler.py
35-
py.test -n ${CIRCLE_NCPUS:-4} --junitxml=${WORKDIR}/pytests_py${PYTHON_VERSION}_multiproc.xml --cov-report xml:${WORKDIR}/coverage_py${PYTHON_VERSION}_multiproc.xml --cov=nipype nipype/pipeline/plugins/tests/test_multiproc*.py
32+
py.test -n ${CIRCLE_NCPUS:-1} -v --junitxml=${WORKDIR}/pytests_py${PYTHON_VERSION}_profiler.xml --cov-report xml:${WORKDIR}/coverage_py${PYTHON_VERSION}_profiler.xml /src/nipype/nipype/interfaces/tests/test_runtime_profiler.py && \
33+
py.test -n ${CIRCLE_NCPUS:-1} -v --junitxml=${WORKDIR}/pytests_py${PYTHON_VERSION}_multiproc.xml --cov-report xml:${WORKDIR}/coverage_py${PYTHON_VERSION}_multiproc.xml /src/nipype/nipype/pipeline/plugins/tests/test_multiproc*.py
34+
exit_code = $(( $exit_code + $?))
3635
fi
3736

38-
# Copy crashfiles to scratch
39-
find /src/nipype/ -name "crash-*" -exec cp {} ${WORKDIR}/crashfiles/ \;
37+
find /src/nipype/ -name "crash-*" -exec mv {} ${WORKDIR}/crashfiles/ \;
38+
39+
# Just in case output xml files are misplaced,
40+
# then circle would not tell the tests failed otherwise
41+
exit $exit_code

pytest.ini

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pytest]
2+
norecursedirs = .git build dist doc nipype/external tools examples tools
3+
addopts = --doctest-modules

0 commit comments

Comments
 (0)