File tree Expand file tree Collapse file tree 4 files changed +19
-10
lines changed Expand file tree Collapse file tree 4 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,23 @@ set -e # Exit immediately if a command exits with a non-zero status.
9
9
set -u # Treat unset variables as an error when substituting.
10
10
set -x # Print command traces before executing command.
11
11
12
- mkdir -p ${CIRCLE_TEST_REPORTS} /unittests ${CIRCLE_TEST_REPORTS} /smoketest
13
- cp ${SCRATCH} /coverage* .xml ${CIRCLE_TEST_REPORTS} /unittests/
14
- cp ${SCRATCH} /smoketests* .xml ${CIRCLE_TEST_REPORTS} /smoketest/
12
+ # Place py.test reports in folders
13
+ for f in $( find $SCRATCH / -name " pytest*.xml" ) ; do
14
+ folder=$( basename ${f:: -4} )
15
+ mkdir -p ${CIRCLE_TEST_REPORTS} /$folder
16
+ cp $f ${CIRCLE_TEST_REPORTS} /$folder /pytest.xml
17
+ done
15
18
16
19
# Send coverage data to codecov.io
17
20
curl -so codecov.io https://codecov.io/bash
18
21
chmod 755 codecov.io
19
22
20
- find " ${CIRCLE_TEST_REPORTS} /unittests " -name ' *.xml' -print0 | \
23
+ find " ${SCRATCH} / " -name ' coverage *.xml' -maxdepth 1 -print0 | \
21
24
xargs -0 -I file ./codecov.io -f file -t " ${CODECOV_TOKEN} " -F unittests
22
- find " ${CIRCLE_TEST_REPORTS} /smoketest " -name ' *.xml' -print0 | \
25
+ find " ${SCRATCH} / " -name ' smoketest *.xml' -maxdepth 1 -print0 | \
23
26
xargs -0 -I file ./codecov.io -f file -t " ${CODECOV_TOKEN} " -F smoketests
27
+
28
+ # Place coverage in the correct folders
29
+ mkdir -p ${CIRCLE_TEST_REPORTS} /unittests ${CIRCLE_TEST_REPORTS} /smoketest
30
+ cp ${SCRATCH} /coverage* .xml ${CIRCLE_TEST_REPORTS} /unittests/ || true
31
+ cp ${SCRATCH} /smoketest* .xml ${CIRCLE_TEST_REPORTS} /smoketest/ || true
Original file line number Diff line number Diff line change @@ -14,4 +14,4 @@ echo 'log_directory = /scratch/logs/' >> /root/.nipype/nipype.cfg
14
14
coverage run /root/src/nipype/tools/run_examples.py $@
15
15
arr=$@
16
16
tmp_var=$( IFS=$' ' ; echo " ${arr[*]} " )
17
- coverage xml -o " /scratch/smoketest_${tmp_var// [^A-Za-z0-9_-]/ _} .xml"
17
+ coverage xml -o " /scratch/smoketest_${tmp_var// [^A-Za-z0-9_-]/ _} .xml"
Original file line number Diff line number Diff line change 6
6
PYTHON_VERSION=$( python -c " import sys; print('{}{}'.format(sys.version_info[0], sys.version_info[1]))" )
7
7
8
8
# Create necessary directories
9
- mkdir -p /scratch/pytest /scratch/ crashfiles /scratch/logs/py${PYTHON_VERSION}
9
+ mkdir -p /scratch/crashfiles /scratch/logs/py${PYTHON_VERSION}
10
10
11
11
# Create a nipype config file
12
12
mkdir -p /root/.nipype
23
23
# Run tests using pytest
24
24
cd /root/src/nipype/
25
25
make clean
26
- py.test -- doctest-modules --cov-report xml:/scratch/coverage_py${PYTHON_VERSION} .xml --cov=nipype nipype
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
27
27
28
28
29
29
# Workaround: run here the profiler tests in python 3
30
30
if [[ " ${PYTHON_VERSION} " -ge " 30" ]]; then
31
31
echo ' [execution]' >> /root/.nipype/nipype.cfg
32
32
echo ' profile_runtime = true' >> /root/.nipype/nipype.cfg
33
- py.test -- cov-report xml:/scratch/coverage_py${PYTHON_VERSION} _profiler.xml --cov=nipype nipype/interfaces/tests/test_runtime_profiler.py
34
- py.test -- cov-report xml:/scratch/coverage_py${PYTHON_VERSION} _multiproc.xml --cov=nipype nipype/pipeline/plugins/tests/test_multiproc* .py
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
35
35
fi
36
36
37
37
# Copy crashfiles to scratch
Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ def get_nipype_gitversion():
151
151
TESTS_REQUIRES = [
152
152
'pytest>=%s' % PYTEST_MIN_VERSION ,
153
153
'pytest-cov' ,
154
+ 'pytest-xdist' ,
154
155
'mock' ,
155
156
'codecov' ,
156
157
'dipy' ,
You can’t perform that action at this time.
0 commit comments