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