From 2a811d48e57ed6add0502d27f1f4d3dcb8be9823 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 16 Mar 2017 09:01:56 -0700 Subject: [PATCH 01/11] protect replacement of imglob with __main__ --- .noserc | 11 ----- nipype/external/fsl_imglob.py | 93 ++++++++++++++++++----------------- 2 files changed, 49 insertions(+), 55 deletions(-) delete mode 100644 .noserc diff --git a/.noserc b/.noserc deleted file mode 100644 index d8c30da437..0000000000 --- a/.noserc +++ /dev/null @@ -1,11 +0,0 @@ -[nosetests] -verbosity=3 -logging-level=DEBUG -with-doctest=1 -with-doctest-ignore-unicode=1 - -with-xunit=1 -with-coverage=1 -cover-branches=1 -cover-xml=1 -cover-min-percentage=50 diff --git a/nipype/external/fsl_imglob.py b/nipype/external/fsl_imglob.py index ca15f70108..f77041c575 100755 --- a/nipype/external/fsl_imglob.py +++ b/nipype/external/fsl_imglob.py @@ -65,15 +65,8 @@ # innovation@isis.ox.ac.uk quoting reference DE/9564. from __future__ import print_function import sys -import os import glob - -setAvailable = True -if sys.version_info < (2, 4): - import sets - from sets import Set - setAvailable = False - +from builtins import range def usage(): print("Usage: $0 [-extension/extensions] ") @@ -94,45 +87,57 @@ def isImage(input, allExtensions): def removeImageExtension(input, allExtensions): return isImage(input, allExtensions)[1] -if len(sys.argv) <= 1: - usage() -deleteExtensions = True -primaryExtensions = ['.nii.gz', '.nii', '.hdr.gz', '.hdr'] -secondaryExtensions = ['.img.gz', '.img'] -allExtensions = primaryExtensions+secondaryExtensions -validExtensions = primaryExtensions -startingArg = 1 +def main(): + if len(sys.argv) <= 1: + usage() + + if sys.version_info < (2, 4): + import sets + from sets import Set + setAvailable = False + else: + setAvailable = True + + deleteExtensions = True + primaryExtensions = ['.nii.gz', '.nii', '.hdr.gz', '.hdr'] + secondaryExtensions = ['.img.gz', '.img'] + allExtensions = primaryExtensions+secondaryExtensions + validExtensions = primaryExtensions + startingArg = 1 + + if sys.argv[1] == "-extensions": + validExtensions = allExtensions + deleteExtensions = False + startingArg = 2 + if sys.argv[1] == "-extension": + deleteExtensions = False + startingArg = 2 -if sys.argv[1] == "-extensions": - validExtensions = allExtensions - deleteExtensions = False - startingArg = 2 -if sys.argv[1] == "-extension": - deleteExtensions = False - startingArg = 2 + filelist = [] + for arg in range(startingArg, len(sys.argv)): + # if isImage(sys.argv[arg],allExtensions)[0]: #These enable a "pedantic" style mode currently not used + # filelist.extend(glob.glob(sys.argv[arg])) + # else: + # for currentExtension in validExtensions: + # filelist.extend(glob.glob(sys.argv[arg]+currentExtension)) + for currentExtension in validExtensions: + filelist.extend( + glob.glob(removeImageExtension(sys.argv[arg], allExtensions)+currentExtension)) -filelist = [] -for arg in range(startingArg, len(sys.argv)): - # if isImage(sys.argv[arg],allExtensions)[0]: #These enable a "pedantic" style mode currently not used - # filelist.extend(glob.glob(sys.argv[arg])) - # else: - # for currentExtension in validExtensions: - # filelist.extend(glob.glob(sys.argv[arg]+currentExtension)) - for currentExtension in validExtensions: - filelist.extend( - glob.glob(removeImageExtension(sys.argv[arg], allExtensions)+currentExtension)) + if deleteExtensions: + for file in range(0, len(filelist)): + filelist[file] = removeImageExtension(filelist[file], allExtensions) + if setAvailable: + filelist = list(set(filelist)) + else: + filelist = list(Set(filelist)) + filelist.sort() -if deleteExtensions: for file in range(0, len(filelist)): - filelist[file] = removeImageExtension(filelist[file], allExtensions) -if setAvailable: - filelist = list(set(filelist)) -else: - filelist = list(Set(filelist)) -filelist.sort() + print(filelist[file], end=' ') + if file < len(filelist)-1: + print(" ", end=' ') -for file in range(0, len(filelist)): - print(filelist[file], end=' ') - if file < len(filelist)-1: - print(" ", end=' ') +if __name__ == "__main__": + main() From 4b67fe03c3eef825215540f6e16660e6948ea464 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 16 Mar 2017 10:06:24 -0700 Subject: [PATCH 02/11] deep revision of old failures --- .circle/tests.sh | 4 ++-- .coveragerc | 25 +++++++++++++++++++++---- .dockerignore | 10 +++++----- codecov.yml | 4 ++++ docker/files/run_examples.sh | 22 +++++++--------------- docker/files/run_pytests.sh | 18 ++++++++++-------- pytest.ini | 3 +++ 7 files changed, 52 insertions(+), 34 deletions(-) create mode 100644 pytest.ini diff --git a/.circle/tests.sh b/.circle/tests.sh index 51a7957259..bcdbd5eadb 100644 --- a/.circle/tests.sh +++ b/.circle/tests.sh @@ -17,8 +17,8 @@ fi # They may need to be rebalanced in the future. case ${CIRCLE_NODE_INDEX} in 0) - 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 && \ - 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 && \ + 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 && \ + 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 && \ docker run --rm -it -v $WORKDIR:/work -w /src/nipype/doc nipype/nipype:py35 /usr/bin/run_builddocs.sh && \ 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 && \ 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 diff --git a/.coveragerc b/.coveragerc index 80af6f0119..87c2c53b02 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,7 +1,24 @@ [run] branch = True -include = */nipype/* +source = nipype/ omit = - */nipype/external/* - */nipype/fixes/* - */setup.py + external/* + fixes/* + */tests/* + +[report] +exclude_lines = + # Have to re-enable the standard pragma + pragma: no cover + + # Don't complain about missing debug-only code: + def __repr__ + if self\.debug + + # Don't complain if tests don't hit defensive assertion code: + raise AssertionError + raise NotImplementedError + + # Don't complain if non-runnable code isn't run: + if 0: + if __name__ == .__main__.: \ No newline at end of file diff --git a/.dockerignore b/.dockerignore index 2140bfcb66..35daadb7e1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,7 @@ # python cache -__pycache__/**/* __pycache__ +**/__pycache__ +**/*.pyc *.pyc # python distribution @@ -26,11 +27,10 @@ docs/ .circle/**/* .circle/ circle.yml -.coverage -.coveragerc -codecov.yml rtd_requirements.txt Vagrantfile .travis.yml -.noserc +.mailmap +# Previous coverage results +.coverage \ No newline at end of file diff --git a/codecov.yml b/codecov.yml index e2fbd5b0b0..2724855129 100644 --- a/codecov.yml +++ b/codecov.yml @@ -22,3 +22,7 @@ coverage: threshold: 100 flags: - "smoketests" + ignore: # files and folders that will be removed during processing + - "nipype/external/*" + - "tools/*" + - "doc/*" \ No newline at end of file diff --git a/docker/files/run_examples.sh b/docker/files/run_examples.sh index e30ca221c6..bc2c4583c3 100644 --- a/docker/files/run_examples.sh +++ b/docker/files/run_examples.sh @@ -17,23 +17,15 @@ echo "log_to_file = true" >> ${HOME}/.nipype/nipype.cfg echo "log_directory = ${WORKDIR}/logs/example_${example_id}" >> ${HOME}/.nipype/nipype.cfg # Set up coverage -echo "[run]" >> .coveragerc -echo "branch = True" >> .coveragerc -echo "source = /src/nipype" >> .coveragerc -echo "include = */nipype/*" >> .coveragerc -echo "omit =" >> .coveragerc -echo " */nipype/external/*" >> .coveragerc -echo " */nipype/fixes/*" >> .coveragerc -echo " */setup.py" >> .coveragerc +sed -i -E "s/(source = ).*'/\1\/src\/nipype\/nipype/" /src/nipype/.coveragerc - -parallel="" if [ "$2" == "MultiProc" ]; then - parallel="--concurrency=multiprocessing" + echo "concurrency = multiprocessing" >> /src/nipype/.coveragerc fi -coverage run ${parallel} /src/nipype/tools/run_examples.py $@ -test_exit=$? -coverage xml -o "${WORKDIR}/smoketest_${example_id}.xml" +coverage run --rcfile=/src/nipype/.coveragerc /src/nipype/tools/run_examples.py $@ +exit_code=$? + +coverage xml -o ${WORKDIR}/smoketest_${example_id}.xml || true -exit $test_exit \ No newline at end of file +exit $exit_code diff --git a/docker/files/run_pytests.sh b/docker/files/run_pytests.sh index 3b4b99786f..d3640a5898 100644 --- a/docker/files/run_pytests.sh +++ b/docker/files/run_pytests.sh @@ -21,19 +21,21 @@ if [[ "${PYTHON_VERSION}" -lt "30" ]]; then echo 'profile_runtime = true' >> ${HOME}/.nipype/nipype.cfg fi -cd /src/nipype/ -make clean # Run tests using pytest -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 - +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/ +exit_code=$? # Workaround: run here the profiler tests in python 3 if [[ "${PYTHON_VERSION}" -ge "30" ]]; then echo '[execution]' >> ${HOME}/.nipype/nipype.cfg echo 'profile_runtime = true' >> ${HOME}/.nipype/nipype.cfg - 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 - 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 + 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 && \ + 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 + exit_code = $(( $exit_code + $?)) fi -# Copy crashfiles to scratch -find /src/nipype/ -name "crash-*" -exec cp {} ${WORKDIR}/crashfiles/ \; +find /src/nipype/ -name "crash-*" -exec mv {} ${WORKDIR}/crashfiles/ \; + +# Just in case output xml files are misplaced, +# then circle would not tell the tests failed otherwise +exit $exit_code diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000000..0f91b25324 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +norecursedirs = .git build dist doc nipype/external tools examples tools +addopts = --doctest-modules \ No newline at end of file From 1357579cf514b841a98c37372e1d88515519a8b3 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 16 Mar 2017 11:27:48 -0700 Subject: [PATCH 03/11] fix failing tests --- .coveragerc | 1 + docker/files/run_examples.sh | 4 +++- nipype/utils/tests/test_cmd.py | 21 +++------------------ 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/.coveragerc b/.coveragerc index 87c2c53b02..35c3eccee6 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,6 @@ [run] branch = True +data_file = .coverage source = nipype/ omit = external/* diff --git a/docker/files/run_examples.sh b/docker/files/run_examples.sh index bc2c4583c3..063b35e7d2 100644 --- a/docker/files/run_examples.sh +++ b/docker/files/run_examples.sh @@ -17,7 +17,9 @@ echo "log_to_file = true" >> ${HOME}/.nipype/nipype.cfg echo "log_directory = ${WORKDIR}/logs/example_${example_id}" >> ${HOME}/.nipype/nipype.cfg # Set up coverage +export COVERAGE_PROCESS_START=/src/nipype/.coveragerc sed -i -E "s/(source = ).*'/\1\/src\/nipype\/nipype/" /src/nipype/.coveragerc +sed -i -E "s/(data_file = ).*'/\1\/\/work\/.coverage/" /src/nipype/.coveragerc if [ "$2" == "MultiProc" ]; then echo "concurrency = multiprocessing" >> /src/nipype/.coveragerc @@ -26,6 +28,6 @@ fi coverage run --rcfile=/src/nipype/.coveragerc /src/nipype/tools/run_examples.py $@ exit_code=$? -coverage xml -o ${WORKDIR}/smoketest_${example_id}.xml || true +coverage xml --rcfile=/src/nipype/.coveragerc -o ${WORKDIR}/smoketest_${example_id}.xml || true exit $exit_code diff --git a/nipype/utils/tests/test_cmd.py b/nipype/utils/tests/test_cmd.py index e6aad61b28..fc182f1f9f 100644 --- a/nipype/utils/tests/test_cmd.py +++ b/nipype/utils/tests/test_cmd.py @@ -12,7 +12,6 @@ from ...utils import nipype_cmd PY3 = sys.version_info[0] >= 3 -PY2 = sys.version_info[0] < 2 @contextmanager def capture_sys_output(): @@ -35,20 +34,11 @@ def test_main_returns_2_on_empty(self): exit_exception = cm.value assert exit_exception.code == 2 - - if PY2: - assert stderr.getvalue() == \ - """usage: nipype_cmd [-h] module interface + assert stderr.getvalue() == \ + """usage: nipype_cmd [-h] module interface nipype_cmd: error: too few arguments -""" - elif PY3: - assert stderr.getvalue() == \ - """usage: nipype_cmd [-h] module interface -nipype_cmd: error: the following arguments are required: module, interface """ - assert stdout.getvalue() == '' - def test_main_returns_0_on_help(self): with pytest.raises(SystemExit) as cm: with capture_sys_output() as (stdout, stderr): @@ -115,12 +105,7 @@ def test_run_4d_realign_without_arguments(self): in_file [in_file ...] tr""" - if PY3: - error_message += """ -nipype_cmd nipype.interfaces.nipy FmriRealign4d: error: the following arguments are required: in_file, tr -""" - else: - error_message += """ + error_message += """ nipype_cmd nipype.interfaces.nipy FmriRealign4d: error: too few arguments """ From 7b6791141f61d80af6b0811eba6e3dca3e4ad794 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 16 Mar 2017 12:06:42 -0700 Subject: [PATCH 04/11] fix error in run_pytests, trying to get coverage to track examples --- .coveragerc | 9 ++++++--- docker/files/run_pytests.sh | 4 ++-- pytest.ini | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.coveragerc b/.coveragerc index 35c3eccee6..90a812a425 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,11 +1,14 @@ [run] branch = True data_file = .coverage -source = nipype/ +source = . omit = - external/* - fixes/* + nipype/external/* + nipype/fixes/* + tools/* */tests/* +include = + tools/run_exaples.py [report] exclude_lines = diff --git a/docker/files/run_pytests.sh b/docker/files/run_pytests.sh index d3640a5898..5ff6f910f4 100644 --- a/docker/files/run_pytests.sh +++ b/docker/files/run_pytests.sh @@ -31,11 +31,11 @@ if [[ "${PYTHON_VERSION}" -ge "30" ]]; then echo 'profile_runtime = true' >> ${HOME}/.nipype/nipype.cfg 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 && \ 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 - exit_code = $(( $exit_code + $?)) + exit_code=$(( $exit_code + $?)) fi find /src/nipype/ -name "crash-*" -exec mv {} ${WORKDIR}/crashfiles/ \; # Just in case output xml files are misplaced, # then circle would not tell the tests failed otherwise -exit $exit_code +exit ${exit_code} diff --git a/pytest.ini b/pytest.ini index 0f91b25324..46148ace22 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,3 @@ [pytest] -norecursedirs = .git build dist doc nipype/external tools examples tools +norecursedirs = .git build dist doc nipype/external tools examples tools src addopts = --doctest-modules \ No newline at end of file From 00095c4cc9ab2cce33c59784c7b97ac3f2768b1c Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 16 Mar 2017 15:37:47 -0700 Subject: [PATCH 05/11] fix typo in .coveragerc --- .coveragerc | 3 ++- docker/files/run_pytests.sh | 2 +- pytest.ini | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.coveragerc b/.coveragerc index 90a812a425..86848c0d61 100644 --- a/.coveragerc +++ b/.coveragerc @@ -6,9 +6,10 @@ omit = nipype/external/* nipype/fixes/* tools/* + doc/* */tests/* include = - tools/run_exaples.py + tools/run_examples.py [report] exclude_lines = diff --git a/docker/files/run_pytests.sh b/docker/files/run_pytests.sh index 5ff6f910f4..bbcf2734db 100644 --- a/docker/files/run_pytests.sh +++ b/docker/files/run_pytests.sh @@ -31,7 +31,7 @@ if [[ "${PYTHON_VERSION}" -ge "30" ]]; then echo 'profile_runtime = true' >> ${HOME}/.nipype/nipype.cfg 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 && \ 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 - exit_code=$(( $exit_code + $?)) + exit_code=$(( $exit_code + $? )) fi find /src/nipype/ -name "crash-*" -exec mv {} ${WORKDIR}/crashfiles/ \; diff --git a/pytest.ini b/pytest.ini index 46148ace22..6247b04cca 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,3 @@ [pytest] -norecursedirs = .git build dist doc nipype/external tools examples tools src +norecursedirs = .git build dist doc nipype/external tools examples src addopts = --doctest-modules \ No newline at end of file From ea6bdc312c68fc680fb805b66100dab18e7e63ad Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 16 Mar 2017 17:46:35 -0700 Subject: [PATCH 06/11] hopefully, final fix to the circle deployment * fixed nipypecmd tests * removed -n from py.test, which was making py.test think all tests passed (when some were failing) * fixed the coverage collection when running the examples --- .coveragerc | 27 --------------------------- docker/files/run_examples.sh | 9 ++++----- docker/files/run_pytests.sh | 9 ++++++--- nipype/info.py | 1 - nipype/utils/tests/test_cmd.py | 20 ++++++++++++++++---- 5 files changed, 26 insertions(+), 40 deletions(-) diff --git a/.coveragerc b/.coveragerc index 86848c0d61..398ff08afa 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,29 +1,2 @@ [run] branch = True -data_file = .coverage -source = . -omit = - nipype/external/* - nipype/fixes/* - tools/* - doc/* - */tests/* -include = - tools/run_examples.py - -[report] -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - - # Don't complain about missing debug-only code: - def __repr__ - if self\.debug - - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplementedError - - # Don't complain if non-runnable code isn't run: - if 0: - if __name__ == .__main__.: \ No newline at end of file diff --git a/docker/files/run_examples.sh b/docker/files/run_examples.sh index 063b35e7d2..0018c2b5b0 100644 --- a/docker/files/run_examples.sh +++ b/docker/files/run_examples.sh @@ -17,17 +17,16 @@ echo "log_to_file = true" >> ${HOME}/.nipype/nipype.cfg echo "log_directory = ${WORKDIR}/logs/example_${example_id}" >> ${HOME}/.nipype/nipype.cfg # Set up coverage -export COVERAGE_PROCESS_START=/src/nipype/.coveragerc -sed -i -E "s/(source = ).*'/\1\/src\/nipype\/nipype/" /src/nipype/.coveragerc -sed -i -E "s/(data_file = ).*'/\1\/\/work\/.coverage/" /src/nipype/.coveragerc +export COVERAGE_FILE=${WORKDIR}/.coverage_${example_id} +#sed -i -E "s/(source = ).*'/\1\/src\/nipype\/nipype/" /src/nipype/.coveragerc if [ "$2" == "MultiProc" ]; then echo "concurrency = multiprocessing" >> /src/nipype/.coveragerc fi -coverage run --rcfile=/src/nipype/.coveragerc /src/nipype/tools/run_examples.py $@ +coverage run /src/nipype/tools/run_examples.py $@ exit_code=$? -coverage xml --rcfile=/src/nipype/.coveragerc -o ${WORKDIR}/smoketest_${example_id}.xml || true +coverage xml -o ${WORKDIR}/smoketest_${example_id}.xml || true exit $exit_code diff --git a/docker/files/run_pytests.sh b/docker/files/run_pytests.sh index bbcf2734db..1c88a6594a 100644 --- a/docker/files/run_pytests.sh +++ b/docker/files/run_pytests.sh @@ -3,6 +3,8 @@ set -e set -x set -u + +TESTPATH=${1:-/src/nipype/} WORKDIR=${WORK:-/work} PYTHON_VERSION=$( python -c "import sys; print('{}{}'.format(sys.version_info[0], sys.version_info[1]))" ) @@ -22,15 +24,16 @@ if [[ "${PYTHON_VERSION}" -lt "30" ]]; then fi # Run tests using pytest -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/ +export COVERAGE_FILE=${WORKDIR}/.coverage_py${PYTHON_VERSION} +py.test -v --junitxml=${WORKDIR}/pytests_py${PYTHON_VERSION}.xml --cov nipype --cov-config /src/nipype/.coveragerc --cov-report xml:${WORKDIR}/coverage_py${PYTHON_VERSION}.xml ${TESTPATH} exit_code=$? # Workaround: run here the profiler tests in python 3 if [[ "${PYTHON_VERSION}" -ge "30" ]]; then echo '[execution]' >> ${HOME}/.nipype/nipype.cfg echo 'profile_runtime = true' >> ${HOME}/.nipype/nipype.cfg - 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 && \ - 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 + export COVERAGE_FILE=${WORKDIR}/.coverage_py${PYTHON_VERSION}_extra + py.test -v --junitxml=${WORKDIR}/pytests_py${PYTHON_VERSION}_extra.xml --cov nipype --cov-report xml:${WORKDIR}/coverage_py${PYTHON_VERSION}_extra.xml /src/nipype/nipype/interfaces/tests/test_runtime_profiler.py /src/nipype/nipype/pipeline/plugins/tests/test_multiproc*.py exit_code=$(( $exit_code + $? )) fi diff --git a/nipype/info.py b/nipype/info.py index c170d3800c..81a8adce0a 100644 --- a/nipype/info.py +++ b/nipype/info.py @@ -144,7 +144,6 @@ def get_nipype_gitversion(): TESTS_REQUIRES = [ 'pytest>=%s' % PYTEST_MIN_VERSION, 'pytest-cov', - 'pytest-xdist', 'mock', 'codecov', 'dipy', diff --git a/nipype/utils/tests/test_cmd.py b/nipype/utils/tests/test_cmd.py index fc182f1f9f..315d55441f 100644 --- a/nipype/utils/tests/test_cmd.py +++ b/nipype/utils/tests/test_cmd.py @@ -11,7 +11,7 @@ from io import StringIO from ...utils import nipype_cmd -PY3 = sys.version_info[0] >= 3 +PY2 = sys.version_info[0] < 3 @contextmanager def capture_sys_output(): @@ -34,10 +34,17 @@ def test_main_returns_2_on_empty(self): exit_exception = cm.value assert exit_exception.code == 2 - assert stderr.getvalue() == \ - """usage: nipype_cmd [-h] module interface + + msg = """usage: nipype_cmd [-h] module interface +nipype_cmd: error: the following arguments are required: module, interface +""" + + if PY2: + msg = """usage: nipype_cmd [-h] module interface nipype_cmd: error: too few arguments """ + assert stderr.getvalue() == msg + assert stdout.getvalue() == '' def test_main_returns_0_on_help(self): with pytest.raises(SystemExit) as cm: @@ -105,7 +112,12 @@ def test_run_4d_realign_without_arguments(self): in_file [in_file ...] tr""" - error_message += """ + if not PY2: + error_message += """ +nipype_cmd nipype.interfaces.nipy FmriRealign4d: error: the following arguments are required: in_file, tr +""" + else: + error_message += """ nipype_cmd nipype.interfaces.nipy FmriRealign4d: error: too few arguments """ From 0041e6bea6d34903a49b2bb41ae999c6bb007d90 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 16 Mar 2017 18:35:24 -0700 Subject: [PATCH 07/11] add -v flag in travis (after the segfault) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 64b7fea960..84973174db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,7 @@ before_install: install: - travis_retry pip install -e .[$NIPYPE_EXTRAS] script: -- py.test --doctest-modules nipype +- py.test -v --doctest-modules . deploy: provider: pypi user: satra From e70181176bf8564380d7867de20551e9ad499c83 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 16 Mar 2017 18:35:44 -0700 Subject: [PATCH 08/11] add .cache to dockerignore --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index 35daadb7e1..c44710d14e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -24,6 +24,7 @@ src/ # other docs/**/* docs/ +.cache/ .circle/**/* .circle/ circle.yml From bca19820518e13d23f17023a24924839ea4e85f1 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 16 Mar 2017 18:56:34 -0700 Subject: [PATCH 09/11] add --rm=false in docker run commands --- .circle/tests.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.circle/tests.sh b/.circle/tests.sh index bcdbd5eadb..ad7aed6d9f 100644 --- a/.circle/tests.sh +++ b/.circle/tests.sh @@ -17,23 +17,23 @@ fi # They may need to be rebalanced in the future. case ${CIRCLE_NODE_INDEX} in 0) - 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 && \ - 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 && \ - docker run --rm -it -v $WORKDIR:/work -w /src/nipype/doc nipype/nipype:py35 /usr/bin/run_builddocs.sh && \ - 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 && \ - 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 + docker run --rm=false -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 && \ + docker run --rm=false -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 && \ + docker run --rm=false -it -v $WORKDIR:/work -w /src/nipype/doc nipype/nipype:py35 /usr/bin/run_builddocs.sh && \ + docker run --rm=false -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 && \ + docker run --rm=false -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 ;; 1) - docker run --rm -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /data/examples/ level1 && \ - docker run --rm -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /data/examples/ l2pipeline + docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /data/examples/ level1 && \ + docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /data/examples/ l2pipeline ;; 2) - docker run --rm -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py27 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ level1 && \ - docker run --rm -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ l2pipeline + docker run --rm=false -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py27 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ level1 && \ + docker run --rm=false -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ l2pipeline ;; 3) - docker run --rm -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ level1 && \ - docker run --rm -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_fsl_feeds Linear /data/examples/ l1pipeline && \ - docker run --rm -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_fsl_reuse Linear /data/examples/ level1_workflow + docker run --rm=false -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ level1 && \ + docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_fsl_feeds Linear /data/examples/ l1pipeline && \ + docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_fsl_reuse Linear /data/examples/ level1_workflow ;; esac From e903dfe1c27609aad600d6a024902b34d0cb8e3e Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 16 Mar 2017 20:56:42 -0700 Subject: [PATCH 10/11] fix travis, keep coverage reports in artifacts --- .circle/codecov.sh | 9 ++++----- .travis.yml | 2 +- circle.yml | 1 + docker/files/run_examples.sh | 8 ++++---- docker/files/run_pytests.sh | 10 +++++----- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.circle/codecov.sh b/.circle/codecov.sh index 84df39c1c2..d7c0156372 100644 --- a/.circle/codecov.sh +++ b/.circle/codecov.sh @@ -13,13 +13,12 @@ set -x # Print command traces before executing command. curl -so codecov.io https://codecov.io/bash chmod 755 codecov.io -find "${WORKDIR}/" -name 'coverage*.xml' -maxdepth 1 -print0 | \ +find "${WORKDIR}/tests/" -name 'coverage*.xml' -maxdepth 1 -print0 | \ xargs -0 -I file ./codecov.io -f file -t "${CODECOV_TOKEN}" -F unittests -find "${WORKDIR}/" -name 'smoketest*.xml' -maxdepth 1 -print0 | \ +find "${WORKDIR}/tests/" -name 'smoketest*.xml' -maxdepth 1 -print0 | \ xargs -0 -I file ./codecov.io -f file -t "${CODECOV_TOKEN}" -F smoketests # Place test and coverage in the tests folder mkdir -p ${CIRCLE_TEST_REPORTS}/tests/ -cp ${WORKDIR}/pytest*.xml ${CIRCLE_TEST_REPORTS}/tests/ || true -cp ${WORKDIR}/coverage*.xml ${CIRCLE_TEST_REPORTS}/tests/ || true -cp ${WORKDIR}/smoketest*.xml ${CIRCLE_TEST_REPORTS}/tests/ || true +cp ${WORKDIR}/tests/*.xml ${CIRCLE_TEST_REPORTS}/tests/ + diff --git a/.travis.yml b/.travis.yml index 84973174db..bef97b9b59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,7 @@ before_install: install: - travis_retry pip install -e .[$NIPYPE_EXTRAS] script: -- py.test -v --doctest-modules . +- py.test -v --doctest-modules nipype deploy: provider: pypi user: satra diff --git a/circle.yml b/circle.yml index 24eaed8e2d..a8b9baf7d6 100644 --- a/circle.yml +++ b/circle.yml @@ -56,6 +56,7 @@ general: artifacts: - "~/work/docs" - "~/work/logs" + - "~/work/tests" deployment: production: diff --git a/docker/files/run_examples.sh b/docker/files/run_examples.sh index 0018c2b5b0..a384eb60bf 100644 --- a/docker/files/run_examples.sh +++ b/docker/files/run_examples.sh @@ -8,7 +8,7 @@ arr=$@ tmp_var=$( IFS=$' '; echo "${arr[*]}" ) example_id=${tmp_var//[^A-Za-z0-9_-]/_} -mkdir -p ${HOME}/.nipype ${WORKDIR}/logs/example_${example_id} +mkdir -p ${HOME}/.nipype ${WORKDIR}/logs/example_${example_id} ${WORKDIR}/tests echo "[logging]" > ${HOME}/.nipype/nipype.cfg echo "workflow_level = DEBUG" >> ${HOME}/.nipype/nipype.cfg echo "interface_level = DEBUG" >> ${HOME}/.nipype/nipype.cfg @@ -17,7 +17,7 @@ echo "log_to_file = true" >> ${HOME}/.nipype/nipype.cfg echo "log_directory = ${WORKDIR}/logs/example_${example_id}" >> ${HOME}/.nipype/nipype.cfg # Set up coverage -export COVERAGE_FILE=${WORKDIR}/.coverage_${example_id} +export COVERAGE_FILE=${WORKDIR}/tests/.coverage_${example_id} #sed -i -E "s/(source = ).*'/\1\/src\/nipype\/nipype/" /src/nipype/.coveragerc if [ "$2" == "MultiProc" ]; then @@ -27,6 +27,6 @@ fi coverage run /src/nipype/tools/run_examples.py $@ exit_code=$? -coverage xml -o ${WORKDIR}/smoketest_${example_id}.xml || true - +coverage xml -o ${WORKDIR}/tests/smoketest_${example_id}.xml exit $exit_code + diff --git a/docker/files/run_pytests.sh b/docker/files/run_pytests.sh index 1c88a6594a..b6d7f49383 100644 --- a/docker/files/run_pytests.sh +++ b/docker/files/run_pytests.sh @@ -9,7 +9,7 @@ WORKDIR=${WORK:-/work} PYTHON_VERSION=$( python -c "import sys; print('{}{}'.format(sys.version_info[0], sys.version_info[1]))" ) # Create necessary directories -mkdir -p ${WORKDIR}/crashfiles ${WORKDIR}/logs/py${PYTHON_VERSION} +mkdir -p ${WORKDIR}/tests ${WORKDIR}/crashfiles ${WORKDIR}/logs/py${PYTHON_VERSION} # Create a nipype config file mkdir -p ${HOME}/.nipype @@ -24,16 +24,16 @@ if [[ "${PYTHON_VERSION}" -lt "30" ]]; then fi # Run tests using pytest -export COVERAGE_FILE=${WORKDIR}/.coverage_py${PYTHON_VERSION} -py.test -v --junitxml=${WORKDIR}/pytests_py${PYTHON_VERSION}.xml --cov nipype --cov-config /src/nipype/.coveragerc --cov-report xml:${WORKDIR}/coverage_py${PYTHON_VERSION}.xml ${TESTPATH} +export COVERAGE_FILE=${WORKDIR}/tests/.coverage_py${PYTHON_VERSION} +py.test -v --junitxml=${WORKDIR}/tests/pytests_py${PYTHON_VERSION}.xml --cov nipype --cov-config /src/nipype/.coveragerc --cov-report xml:${WORKDIR}/tests/coverage_py${PYTHON_VERSION}.xml ${TESTPATH} exit_code=$? # Workaround: run here the profiler tests in python 3 if [[ "${PYTHON_VERSION}" -ge "30" ]]; then echo '[execution]' >> ${HOME}/.nipype/nipype.cfg echo 'profile_runtime = true' >> ${HOME}/.nipype/nipype.cfg - export COVERAGE_FILE=${WORKDIR}/.coverage_py${PYTHON_VERSION}_extra - py.test -v --junitxml=${WORKDIR}/pytests_py${PYTHON_VERSION}_extra.xml --cov nipype --cov-report xml:${WORKDIR}/coverage_py${PYTHON_VERSION}_extra.xml /src/nipype/nipype/interfaces/tests/test_runtime_profiler.py /src/nipype/nipype/pipeline/plugins/tests/test_multiproc*.py + export COVERAGE_FILE=${WORKDIR}/tests/.coverage_py${PYTHON_VERSION}_extra + py.test -v --junitxml=${WORKDIR}/tests/pytests_py${PYTHON_VERSION}_extra.xml --cov nipype --cov-report xml:${WORKDIR}/tests/coverage_py${PYTHON_VERSION}_extra.xml /src/nipype/nipype/interfaces/tests/test_runtime_profiler.py /src/nipype/nipype/pipeline/plugins/tests/test_multiproc*.py exit_code=$(( $exit_code + $? )) fi From 2a4f1570d64ae06d662f25179effbcc86809c6e6 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 16 Mar 2017 21:41:03 -0700 Subject: [PATCH 11/11] split codecov and test reports, keep crashfiles as artifacts --- .circle/codecov.sh | 4 ---- circle.yml | 3 +++ docker/files/run_examples.sh | 8 ++++---- docker/files/run_pytests.sh | 6 +++--- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.circle/codecov.sh b/.circle/codecov.sh index d7c0156372..2e895dfea8 100644 --- a/.circle/codecov.sh +++ b/.circle/codecov.sh @@ -18,7 +18,3 @@ find "${WORKDIR}/tests/" -name 'coverage*.xml' -maxdepth 1 -print0 | \ find "${WORKDIR}/tests/" -name 'smoketest*.xml' -maxdepth 1 -print0 | \ xargs -0 -I file ./codecov.io -f file -t "${CODECOV_TOKEN}" -F smoketests -# Place test and coverage in the tests folder -mkdir -p ${CIRCLE_TEST_REPORTS}/tests/ -cp ${WORKDIR}/tests/*.xml ${CIRCLE_TEST_REPORTS}/tests/ - diff --git a/circle.yml b/circle.yml index a8b9baf7d6..6a75f29446 100644 --- a/circle.yml +++ b/circle.yml @@ -49,6 +49,8 @@ test: timeout: 7200 parallel: true post: + # Place reports in the appropriate folder + - mkdir -p ${CIRCLE_TEST_REPORTS}/tests/ && cp ${WORKDIR}/tests/*.xml ${CIRCLE_TEST_REPORTS}/tests/ # Send coverage data to codecov.io - bash .circle/codecov.sh @@ -57,6 +59,7 @@ general: - "~/work/docs" - "~/work/logs" - "~/work/tests" + - "~/work/crashfiles" deployment: production: diff --git a/docker/files/run_examples.sh b/docker/files/run_examples.sh index a384eb60bf..a23c27e76b 100644 --- a/docker/files/run_examples.sh +++ b/docker/files/run_examples.sh @@ -8,7 +8,7 @@ arr=$@ tmp_var=$( IFS=$' '; echo "${arr[*]}" ) example_id=${tmp_var//[^A-Za-z0-9_-]/_} -mkdir -p ${HOME}/.nipype ${WORKDIR}/logs/example_${example_id} ${WORKDIR}/tests +mkdir -p ${HOME}/.nipype ${WORKDIR}/logs/example_${example_id} ${WORKDIR}/tests ${WORKDIR}/crashfiles echo "[logging]" > ${HOME}/.nipype/nipype.cfg echo "workflow_level = DEBUG" >> ${HOME}/.nipype/nipype.cfg echo "interface_level = DEBUG" >> ${HOME}/.nipype/nipype.cfg @@ -17,9 +17,7 @@ echo "log_to_file = true" >> ${HOME}/.nipype/nipype.cfg echo "log_directory = ${WORKDIR}/logs/example_${example_id}" >> ${HOME}/.nipype/nipype.cfg # Set up coverage -export COVERAGE_FILE=${WORKDIR}/tests/.coverage_${example_id} -#sed -i -E "s/(source = ).*'/\1\/src\/nipype\/nipype/" /src/nipype/.coveragerc - +export COVERAGE_FILE=${WORKDIR}/tests/.coverage.${example_id} if [ "$2" == "MultiProc" ]; then echo "concurrency = multiprocessing" >> /src/nipype/.coveragerc fi @@ -27,6 +25,8 @@ fi coverage run /src/nipype/tools/run_examples.py $@ exit_code=$? +# Collect crashfiles and generate xml report coverage xml -o ${WORKDIR}/tests/smoketest_${example_id}.xml +find /work -name "crash-*" -maxdepth 1 -exec mv {} ${WORKDIR}/crashfiles/ \; exit $exit_code diff --git a/docker/files/run_pytests.sh b/docker/files/run_pytests.sh index b6d7f49383..a0e6424950 100644 --- a/docker/files/run_pytests.sh +++ b/docker/files/run_pytests.sh @@ -24,7 +24,7 @@ if [[ "${PYTHON_VERSION}" -lt "30" ]]; then fi # Run tests using pytest -export COVERAGE_FILE=${WORKDIR}/tests/.coverage_py${PYTHON_VERSION} +export COVERAGE_FILE=${WORKDIR}/tests/.coverage.py${PYTHON_VERSION} py.test -v --junitxml=${WORKDIR}/tests/pytests_py${PYTHON_VERSION}.xml --cov nipype --cov-config /src/nipype/.coveragerc --cov-report xml:${WORKDIR}/tests/coverage_py${PYTHON_VERSION}.xml ${TESTPATH} exit_code=$? @@ -32,12 +32,12 @@ exit_code=$? if [[ "${PYTHON_VERSION}" -ge "30" ]]; then echo '[execution]' >> ${HOME}/.nipype/nipype.cfg echo 'profile_runtime = true' >> ${HOME}/.nipype/nipype.cfg - export COVERAGE_FILE=${WORKDIR}/tests/.coverage_py${PYTHON_VERSION}_extra + export COVERAGE_FILE=${WORKDIR}/tests/.coverage.py${PYTHON_VERSION}_extra py.test -v --junitxml=${WORKDIR}/tests/pytests_py${PYTHON_VERSION}_extra.xml --cov nipype --cov-report xml:${WORKDIR}/tests/coverage_py${PYTHON_VERSION}_extra.xml /src/nipype/nipype/interfaces/tests/test_runtime_profiler.py /src/nipype/nipype/pipeline/plugins/tests/test_multiproc*.py exit_code=$(( $exit_code + $? )) fi -find /src/nipype/ -name "crash-*" -exec mv {} ${WORKDIR}/crashfiles/ \; +find /work -name "crash-*" -maxdepth 1 -exec mv {} ${WORKDIR}/crashfiles/ \; # Just in case output xml files are misplaced, # then circle would not tell the tests failed otherwise