11#! /bin/bash
2+ #
3+ # Balance nipype testing workflows across CircleCI build nodes
4+ #
25
3- set -o nounset
4- set -o xtrace
5-
6- export CODECOV_TOKEN=ac172a50-8e66-42e5-8822-5373fcf54686
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.
710
811if [ " ${CIRCLE_NODE_TOTAL:- } " != " 4" ]; then
912 echo " These tests were designed to be run at 4x parallelism."
1417# They may need to be rebalanced in the future.
1518case ${CIRCLE_NODE_INDEX} in
1619 0)
17- docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /root/examples/ level1 && \
18- docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /root/examples/ l2pipeline
19- ;;
20- 1)
21- docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh test_spm Linear /root/examples/ workflow3d && \
22- docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh test_spm Linear /root/examples/ workflow4d && \
2320 docker run --rm -it -e FSL_COURSE_DATA=" /root/examples/nipype-fsl_course_data" -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /root/src/nipype nipype/nipype_test:py27 /usr/bin/run_pytests.sh py27 && \
2421 docker run --rm -it -e FSL_COURSE_DATA=" /root/examples/nipype-fsl_course_data" -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /root/src/nipype nipype/nipype_test:py35 /usr/bin/run_pytests.sh py35 && \
25- docker run --rm -it -v $SCRATCH :/scratch -w /root/src/nipype/doc nipype/nipype_test:py35 /usr/bin/run_builddocs.sh
22+ docker run --rm -it -v $SCRATCH :/scratch -w /root/src/nipype/doc nipype/nipype_test:py35 /usr/bin/run_builddocs.sh && \
23+ docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh test_spm Linear /root/examples/ workflow3d && \
24+ docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh test_spm Linear /root/examples/ workflow4d
25+ ;;
26+ 1)
27+ docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /root/examples/ level1 && \
28+ docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_dartel Linear /root/examples/ l2pipeline
2629 ;;
2730 2)
2831 docker run --rm -it -e NIPYPE_NUMBER_OF_CPUS=4 -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py27 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /root/examples/ level1 && \
@@ -34,14 +37,3 @@ case ${CIRCLE_NODE_INDEX} in
3437 docker run --rm -it -v $HOME /examples:/root/examples:ro -v $SCRATCH :/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_fsl_reuse Linear /root/examples/ level1_workflow
3538 ;;
3639esac
37-
38- # Put the artifacts in place
39- bash docker/files/teardown.sh
40-
41- # Send coverage data to codecov.io
42- curl -so codecov.io https://codecov.io/bash
43- chmod 755 codecov.io
44- find " ${CIRCLE_TEST_REPORTS} /pytest" -name ' coverage*.xml' -print0 | \
45- xargs -0 -I file ./codecov.io -f file -t " ${CODECOV_TOKEN} " -F unittests
46- find " ${CIRCLE_TEST_REPORTS} /pytest" -name ' smoketests*.xml' -print0 | \
47- xargs -0 -I file ./codecov.io -f file -t " ${CODECOV_TOKEN} " -F smoketests
0 commit comments