|
| 1 | +#!/bin/bash |
| 2 | +# |
| 3 | +# Balance nipype testing workflows across CircleCI build nodes |
| 4 | +# |
| 5 | + |
| 6 | +# Setting # $ help set |
| 7 | +set -e # Exit immediately if a command exits with a non-zero status. |
| 8 | +set -u # Treat unset variables as an error when substituting. |
| 9 | +set -x # Print command traces before executing command. |
| 10 | + |
| 11 | +if [ "${CIRCLE_NODE_TOTAL:-}" != "4" ]; then |
| 12 | + echo "These tests were designed to be run at 4x parallelism." |
| 13 | + exit 1 |
| 14 | +fi |
| 15 | + |
| 16 | +# These tests are manually balanced based on previous build timings. |
| 17 | +# They may need to be rebalanced in the future. |
| 18 | +case ${CIRCLE_NODE_INDEX} in |
| 19 | + 0) |
| 20 | + docker run --rm=false -it -e FSL_COURSE_DATA="/data/examples/nipype-fsl_course_data" -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_pytests.sh && \ |
| 21 | + docker run --rm=false -it -e FSL_COURSE_DATA="/data/examples/nipype-fsl_course_data" -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py27 /usr/bin/run_pytests.sh && \ |
| 22 | + docker run --rm=false -it -v $WORKDIR:/work -w /src/nipype/doc nipype/nipype:py35 /usr/bin/run_builddocs.sh && \ |
| 23 | + docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh test_spm Linear /data/examples/ workflow3d && \ |
| 24 | + docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh test_spm Linear /data/examples/ workflow4d |
| 25 | + ;; |
| 26 | + 1) |
| 27 | + docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /data/examples/ level1 && \ |
| 28 | + docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /data/examples/ l2pipeline |
| 29 | + ;; |
| 30 | + 2) |
| 31 | + docker run --rm=false -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py27 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ level1 && \ |
| 32 | + docker run --rm=false -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ l2pipeline |
| 33 | + ;; |
| 34 | + 3) |
| 35 | + docker run --rm=false -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /data/examples/ level1 && \ |
| 36 | + docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_fsl_feeds Linear /data/examples/ l1pipeline && \ |
| 37 | + docker run --rm=false -it -v $HOME/examples:/data/examples:ro -v $WORKDIR:/work -w /work nipype/nipype:py35 /usr/bin/run_examples.sh fmri_fsl_reuse Linear /data/examples/ level1_workflow |
| 38 | + ;; |
| 39 | +esac |
| 40 | + |
| 41 | +cp ${WORKDIR}/tests/*.xml ${CIRCLE_TEST_REPORTS}/tests/ |
| 42 | +codecov -f "coverage*.xml" -s "${WORKDIR}/tests/" -R "${HOME}/nipype/" -F unittests -e CIRCLE_NODE_INDEX |
| 43 | +codecov -f "smoketest*.xml" -s "${WORKDIR}/tests/" -R "${HOME}/nipype/" -F smoketests -e CIRCLE_NODE_INDEX |
0 commit comments