Skip to content

Commit 9ea38a7

Browse files
committed
1. add error messages, 2. force failed exit status
1 parent 43042e7 commit 9ea38a7

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

circle/setup.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ for version in ${PLOTLY_PYTHON_VERSIONS[@]}; do
2626

2727
# only create a virtualenv if it doesn't already exist
2828
if [ ! -d ${PLOTLY_VENV_DIR}/${version} ]; then
29-
virtualenv ${PLOTLY_VENV_DIR}/${version} || error_exit "${LINENO}: can't install virtualenv for ${version}"
29+
virtualenv ${PLOTLY_VENV_DIR}/${version} ||
30+
error_exit "${LINENO}: can't install virtualenv for ${version}"
3031
fi
3132

3233
# get rid of the current virtualenv if we're in one
@@ -35,20 +36,24 @@ for version in ${PLOTLY_PYTHON_VERSIONS[@]}; do
3536
fi
3637

3738
# drop us into a virtualenv
38-
source ${PLOTLY_VENV_DIR}/${version}/bin/activate
39+
source ${PLOTLY_VENV_DIR}/${version}/bin/activate ||
40+
error_exit "${LINENO}: can't activate virtualenv for Python ${version}"
3941

4042
# install core requirements all versions need
41-
pip install -r ${PLOTLY_CORE_REQUIREMENTS_FILE}
43+
pip install -r ${PLOTLY_CORE_REQUIREMENTS_FILE} ||
44+
error_exit "${LINENO}: can't install core reqs for Python ${version}"
4245

4346
# handle funkiness around python 2.6
4447
if [ ${version:0:3} == '2.6' ]
4548
then
46-
pip install simplejson ordereddict
49+
pip install simplejson ordereddict ||
50+
error_exit "${LINENO}: can't install extras for Python ${version}"
4751
# pip install -r ${PLOTLY_OPTIONAL_REQUIREMENTS_FILE_2_6}
4852
# else
4953
# pip install -r ${PLOTLY_OPTIONAL_REQUIREMENTS_FILE}
5054
fi
5155

5256
# install some test tools
53-
pip install nose coverage
57+
pip install nose coverage ||
58+
error_exit "${LINENO}: can't install test tools for Python ${version}"
5459
done

circle/test.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ for version in ${PLOTLY_PYTHON_VERSIONS[@]}; do
2222
fi
2323

2424
# drop us into a virtualenv
25-
source ${PLOTLY_VENV_DIR}/${version}/bin/activate || error_exit
25+
source ${PLOTLY_VENV_DIR}/${version}/bin/activate ||
26+
error_exit "${LINENO}: can't activate virtualenv for Python ${version}"
2627

2728
# install plotly (ignoring possibly cached versions)
28-
pip install -I ${PLOTLY_PACKAGE_ROOT} || error_exit
29+
pip install -I ${PLOTLY_PACKAGE_ROOT} ||
30+
error_exit "${LINENO}: can't install plotly package from project root"
2931

3032
# import it once to make sure that works and to create .plotly dir if DNE
31-
python -c 'import plotly' || error_exit
33+
python -c 'import plotly' ||
34+
error_exit "${LINENO}: can't import plotly package"
3235

3336
# # test that it imports when you don't have file permissions
3437
# chmod 000 ${PLOTLY_CONFIG_DIR} && python -c "import plotly"
@@ -38,9 +41,13 @@ for version in ${PLOTLY_PYTHON_VERSIONS[@]}; do
3841

3942
if [ ${version:0:3} == '2.7' ]
4043
then
41-
nosetests -xv plotly/tests/test_core --with-coverage --cover-package=plotly || error_exit
44+
nosetests -xv plotly/tests/test_core \
45+
--with-coverage \
46+
--cover-package=plotly ||
47+
error_exit "${LINENO}: test suite failed for Python ${version}"
4248
coverage html -d ${CIRCLE_ARTIFACTS}
4349
else
44-
nosetests -xv plotly/tests/test_core || error_exit
50+
nosetests -xv plotly/tests/test_core ||
51+
error_exit "${LINENO}: test suite failed for Python ${version}"
4552
fi
4653
done

0 commit comments

Comments
 (0)