forked from plotly/plotly.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
49 lines (40 loc) · 1.74 KB
/
test.sh
File metadata and controls
49 lines (40 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
echo "running test routine with python versions:"
for version in ${PLOTLY_PYTHON_VERSIONS[@]}; do
echo " ${version}"
done
PROGNAME=$(basename $0)
function error_exit
{
echo -e "${PROGNAME}: ${1:-"Unknown Error"}\n" 1>&2
exit 1
}
# for each version we want, setup a functional virtual environment
for version in ${PLOTLY_PYTHON_VERSIONS[@]}; do
echo Testing Python ${version}
# exporting this variable (in this scope) chooses the python version
export PYENV_VERSION=${version}
echo "Using pyenv version $(pyenv version)"
echo "install plotly (ignoring possibly cached versions)"
pip install -I ${PLOTLY_PACKAGE_ROOT} ||
error_exit "${LINENO}: can't install plotly package from project root"
echo "import plotly to create .plotly dir if DNE"
python -c 'import plotly' ||
error_exit "${LINENO}: can't import plotly package"
# echo "${HOME}"
# echo "${PLOTLY_CONFIG_DIR}"
#
# # test that it imports when you don't have write permissions
# sudo chmod -R 444 ${PLOTLY_CONFIG_DIR} && python -c "import plotly" ||
# error_exit "${LINENO}: permissions test 444 on .plotly dir failed"
#
# # test that setting write permissions will work for import (and tests)
# sudo chmod -R 666 ${PLOTLY_CONFIG_DIR} && python -c "import plotly" ||
# error_exit "${LINENO}: permissions test 666 on .plotly dir failed"
echo "running tests for Python ${version} as user '$(whoami)'"
nosetests -xv plotly/tests --with-coverage --cover-package=plotly ||
error_exit "${LINENO}: test suite failed for Python ${version}"
mkdir "${CIRCLE_ARTIFACTS}/${PYENV_VERSION}" || true
coverage html -d "${CIRCLE_ARTIFACTS}/${PYENV_VERSION}" \
--title=${PYENV_VERSION}
done