|
3 | 3 | set -x |
4 | 4 | set -u |
5 | 5 |
|
| 6 | +WORKDIR=${WORK:-/work} |
6 | 7 | PYTHON_VERSION=$( python -c "import sys; print('{}{}'.format(sys.version_info[0], sys.version_info[1]))" ) |
7 | 8 |
|
8 | 9 | # Create necessary directories |
9 | | -mkdir -p /scratch/crashfiles /scratch/logs/py${PYTHON_VERSION} |
| 10 | +mkdir -p ${WORKDIR}/crashfiles ${WORKDIR}/logs/py${PYTHON_VERSION} |
10 | 11 |
|
11 | 12 | # Create a nipype config file |
12 | | -mkdir -p /root/.nipype |
13 | | -echo '[logging]' > /root/.nipype/nipype.cfg |
14 | | -echo 'log_to_file = true' >> /root/.nipype/nipype.cfg |
15 | | -echo "log_directory = /scratch/logs/py${PYTHON_VERSION}" >> /root/.nipype/nipype.cfg |
| 13 | +mkdir -p ${HOME}/.nipype |
| 14 | +echo '[logging]' > ${HOME}/.nipype/nipype.cfg |
| 15 | +echo 'log_to_file = true' >> ${HOME}/.nipype/nipype.cfg |
| 16 | +echo "log_directory = ${WORKDIR}/logs/py${PYTHON_VERSION}" >> ${HOME}/.nipype/nipype.cfg |
16 | 17 |
|
17 | 18 | # Enable profile_runtime tests only for python 2.7 |
18 | 19 | if [[ "${PYTHON_VERSION}" -lt "30" ]]; then |
19 | | - echo '[execution]' >> /root/.nipype/nipype.cfg |
20 | | - echo 'profile_runtime = true' >> /root/.nipype/nipype.cfg |
| 20 | + echo '[execution]' >> ${HOME}/.nipype/nipype.cfg |
| 21 | + echo 'profile_runtime = true' >> ${HOME}/.nipype/nipype.cfg |
21 | 22 | fi |
22 | 23 |
|
23 | | -# Run tests using pytest |
24 | | -cd /root/src/nipype/ |
| 24 | +cd /src/nipype/ |
25 | 25 | make clean |
26 | | -py.test -n ${CIRCLE_NCPUS:-4} --doctest-modules --junitxml=/scratch/pytests_py${PYTHON_VERSION}.xml --cov-report xml:/scratch/coverage_py${PYTHON_VERSION}.xml --cov=nipype nipype |
| 26 | +# 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 |
27 | 28 |
|
28 | 29 |
|
29 | 30 | # Workaround: run here the profiler tests in python 3 |
30 | 31 | if [[ "${PYTHON_VERSION}" -ge "30" ]]; then |
31 | | - echo '[execution]' >> /root/.nipype/nipype.cfg |
32 | | - echo 'profile_runtime = true' >> /root/.nipype/nipype.cfg |
33 | | - py.test -n ${CIRCLE_NCPUS:-4} --junitxml=/scratch/pytests_py${PYTHON_VERSION}_profiler.xml --cov-report xml:/scratch/coverage_py${PYTHON_VERSION}_profiler.xml --cov=nipype nipype/interfaces/tests/test_runtime_profiler.py |
34 | | - py.test -n ${CIRCLE_NCPUS:-4} --junitxml=/scratch/pytests_py${PYTHON_VERSION}_multiproc.xml --cov-report xml:/scratch/coverage_py${PYTHON_VERSION}_multiproc.xml --cov=nipype nipype/pipeline/plugins/tests/test_multiproc*.py |
| 32 | + echo '[execution]' >> ${HOME}/.nipype/nipype.cfg |
| 33 | + 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 |
35 | 36 | fi |
36 | 37 |
|
37 | 38 | # Copy crashfiles to scratch |
38 | | -for i in $(find /root/src/nipype/ -name "crash-*" ); do cp $i /scratch/crashfiles/; done |
| 39 | +find /src/nipype/ -name "crash-*" -exec cp {} ${WORKDIR}/crashfiles/ \; |
0 commit comments