Skip to content

Commit e903dfe

Browse files
committed
fix travis, keep coverage reports in artifacts
1 parent bca1982 commit e903dfe

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

.circle/codecov.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ set -x # Print command traces before executing command.
1313
curl -so codecov.io https://codecov.io/bash
1414
chmod 755 codecov.io
1515

16-
find "${WORKDIR}/" -name 'coverage*.xml' -maxdepth 1 -print0 | \
16+
find "${WORKDIR}/tests/" -name 'coverage*.xml' -maxdepth 1 -print0 | \
1717
xargs -0 -I file ./codecov.io -f file -t "${CODECOV_TOKEN}" -F unittests
18-
find "${WORKDIR}/" -name 'smoketest*.xml' -maxdepth 1 -print0 | \
18+
find "${WORKDIR}/tests/" -name 'smoketest*.xml' -maxdepth 1 -print0 | \
1919
xargs -0 -I file ./codecov.io -f file -t "${CODECOV_TOKEN}" -F smoketests
2020

2121
# Place test and coverage in the tests folder
2222
mkdir -p ${CIRCLE_TEST_REPORTS}/tests/
23-
cp ${WORKDIR}/pytest*.xml ${CIRCLE_TEST_REPORTS}/tests/ || true
24-
cp ${WORKDIR}/coverage*.xml ${CIRCLE_TEST_REPORTS}/tests/ || true
25-
cp ${WORKDIR}/smoketest*.xml ${CIRCLE_TEST_REPORTS}/tests/ || true
23+
cp ${WORKDIR}/tests/*.xml ${CIRCLE_TEST_REPORTS}/tests/
24+

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ before_install:
4242
install:
4343
- travis_retry pip install -e .[$NIPYPE_EXTRAS]
4444
script:
45-
- py.test -v --doctest-modules .
45+
- py.test -v --doctest-modules nipype
4646
deploy:
4747
provider: pypi
4848
user: satra

circle.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ general:
5656
artifacts:
5757
- "~/work/docs"
5858
- "~/work/logs"
59+
- "~/work/tests"
5960

6061
deployment:
6162
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}
11+
mkdir -p ${HOME}/.nipype ${WORKDIR}/logs/example_${example_id} ${WORKDIR}/tests
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,7 +17,7 @@ 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}/.coverage_${example_id}
20+
export COVERAGE_FILE=${WORKDIR}/tests/.coverage_${example_id}
2121
#sed -i -E "s/(source = ).*'/\1\/src\/nipype\/nipype/" /src/nipype/.coveragerc
2222

2323
if [ "$2" == "MultiProc" ]; then
@@ -27,6 +27,6 @@ fi
2727
coverage run /src/nipype/tools/run_examples.py $@
2828
exit_code=$?
2929

30-
coverage xml -o ${WORKDIR}/smoketest_${example_id}.xml || true
31-
30+
coverage xml -o ${WORKDIR}/tests/smoketest_${example_id}.xml
3231
exit $exit_code
32+

docker/files/run_pytests.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ WORKDIR=${WORK:-/work}
99
PYTHON_VERSION=$( python -c "import sys; print('{}{}'.format(sys.version_info[0], sys.version_info[1]))" )
1010

1111
# Create necessary directories
12-
mkdir -p ${WORKDIR}/crashfiles ${WORKDIR}/logs/py${PYTHON_VERSION}
12+
mkdir -p ${WORKDIR}/tests ${WORKDIR}/crashfiles ${WORKDIR}/logs/py${PYTHON_VERSION}
1313

1414
# Create a nipype config file
1515
mkdir -p ${HOME}/.nipype
@@ -24,16 +24,16 @@ if [[ "${PYTHON_VERSION}" -lt "30" ]]; then
2424
fi
2525

2626
# Run tests using pytest
27-
export COVERAGE_FILE=${WORKDIR}/.coverage_py${PYTHON_VERSION}
28-
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}
27+
export COVERAGE_FILE=${WORKDIR}/tests/.coverage_py${PYTHON_VERSION}
28+
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}/.coverage_py${PYTHON_VERSION}_extra
36-
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
35+
export COVERAGE_FILE=${WORKDIR}/tests/.coverage_py${PYTHON_VERSION}_extra
36+
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

0 commit comments

Comments
 (0)