Skip to content

Commit 2a4f157

Browse files
committed
split codecov and test reports, keep crashfiles as artifacts
1 parent e903dfe commit 2a4f157

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

.circle/codecov.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,3 @@ find "${WORKDIR}/tests/" -name 'coverage*.xml' -maxdepth 1 -print0 | \
1818
find "${WORKDIR}/tests/" -name 'smoketest*.xml' -maxdepth 1 -print0 | \
1919
xargs -0 -I file ./codecov.io -f file -t "${CODECOV_TOKEN}" -F smoketests
2020

21-
# Place test and coverage in the tests folder
22-
mkdir -p ${CIRCLE_TEST_REPORTS}/tests/
23-
cp ${WORKDIR}/tests/*.xml ${CIRCLE_TEST_REPORTS}/tests/
24-

circle.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ test:
4949
timeout: 7200
5050
parallel: true
5151
post:
52+
# Place reports in the appropriate folder
53+
- mkdir -p ${CIRCLE_TEST_REPORTS}/tests/ && cp ${WORKDIR}/tests/*.xml ${CIRCLE_TEST_REPORTS}/tests/
5254
# Send coverage data to codecov.io
5355
- bash .circle/codecov.sh
5456

@@ -57,6 +59,7 @@ general:
5759
- "~/work/docs"
5860
- "~/work/logs"
5961
- "~/work/tests"
62+
- "~/work/crashfiles"
6063

6164
deployment:
6265
production:

docker/files/run_examples.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ arr=$@
88
tmp_var=$( IFS=$' '; echo "${arr[*]}" )
99
example_id=${tmp_var//[^A-Za-z0-9_-]/_}
1010

11-
mkdir -p ${HOME}/.nipype ${WORKDIR}/logs/example_${example_id} ${WORKDIR}/tests
11+
mkdir -p ${HOME}/.nipype ${WORKDIR}/logs/example_${example_id} ${WORKDIR}/tests ${WORKDIR}/crashfiles
1212
echo "[logging]" > ${HOME}/.nipype/nipype.cfg
1313
echo "workflow_level = DEBUG" >> ${HOME}/.nipype/nipype.cfg
1414
echo "interface_level = DEBUG" >> ${HOME}/.nipype/nipype.cfg
@@ -17,16 +17,16 @@ 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-
export COVERAGE_FILE=${WORKDIR}/tests/.coverage_${example_id}
21-
#sed -i -E "s/(source = ).*'/\1\/src\/nipype\/nipype/" /src/nipype/.coveragerc
22-
20+
export COVERAGE_FILE=${WORKDIR}/tests/.coverage.${example_id}
2321
if [ "$2" == "MultiProc" ]; then
2422
echo "concurrency = multiprocessing" >> /src/nipype/.coveragerc
2523
fi
2624

2725
coverage run /src/nipype/tools/run_examples.py $@
2826
exit_code=$?
2927

28+
# Collect crashfiles and generate xml report
3029
coverage xml -o ${WORKDIR}/tests/smoketest_${example_id}.xml
30+
find /work -name "crash-*" -maxdepth 1 -exec mv {} ${WORKDIR}/crashfiles/ \;
3131
exit $exit_code
3232

docker/files/run_pytests.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ if [[ "${PYTHON_VERSION}" -lt "30" ]]; then
2424
fi
2525

2626
# Run tests using pytest
27-
export COVERAGE_FILE=${WORKDIR}/tests/.coverage_py${PYTHON_VERSION}
27+
export COVERAGE_FILE=${WORKDIR}/tests/.coverage.py${PYTHON_VERSION}
2828
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}
2929
exit_code=$?
3030

3131
# Workaround: run here the profiler tests in python 3
3232
if [[ "${PYTHON_VERSION}" -ge "30" ]]; then
3333
echo '[execution]' >> ${HOME}/.nipype/nipype.cfg
3434
echo 'profile_runtime = true' >> ${HOME}/.nipype/nipype.cfg
35-
export COVERAGE_FILE=${WORKDIR}/tests/.coverage_py${PYTHON_VERSION}_extra
35+
export COVERAGE_FILE=${WORKDIR}/tests/.coverage.py${PYTHON_VERSION}_extra
3636
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
3737
exit_code=$(( $exit_code + $? ))
3838
fi
3939

40-
find /src/nipype/ -name "crash-*" -exec mv {} ${WORKDIR}/crashfiles/ \;
40+
find /work -name "crash-*" -maxdepth 1 -exec mv {} ${WORKDIR}/crashfiles/ \;
4141

4242
# Just in case output xml files are misplaced,
4343
# then circle would not tell the tests failed otherwise

0 commit comments

Comments
 (0)