|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 |
| -echo "running test routine with python versions:" |
| 3 | +SIG="☁☀☂" |
| 4 | + |
| 5 | +echo "${SIG} Running test routine with python versions:" |
4 | 6 | for version in ${PLOTLY_PYTHON_VERSIONS[@]}; do
|
5 |
| - echo " ${version}" |
| 7 | + echo "${SIG} ${version}" |
6 | 8 | done
|
7 | 9 |
|
8 | 10 | PROGNAME=$(basename $0)
|
9 | 11 | function error_exit
|
10 | 12 | {
|
11 |
| - echo -e "${PROGNAME}: ${1:-"Unknown Error"}\n" 1>&2 |
| 13 | + echo -e "${SIG} ${PROGNAME}: ${1:-"Unknown Error"}\n" 1>&2 |
12 | 14 | exit 1
|
13 | 15 | }
|
14 | 16 |
|
15 | 17 | # PYENV shims need to be infront of the rest of the path to work!
|
16 |
| -echo "adding pyenv shims to the beginning of the path in this shell" |
| 18 | +echo "${SIG} Adding pyenv shims to the beginning of the path in this shell." |
17 | 19 | export PATH="/home/ubuntu/.pyenv/shims:$PATH"
|
18 | 20 |
|
19 | 21 | # for each version we want, setup a functional virtual environment
|
20 | 22 | for version in ${PLOTLY_PYTHON_VERSIONS[@]}; do
|
21 |
| - echo Testing Python ${version} |
| 23 | + echo "${SIG} Testing Python ${version}" |
22 | 24 |
|
23 | 25 | # exporting this variable (in this scope) chooses the python version
|
24 | 26 | export PYENV_VERSION=${version}
|
25 |
| - echo "Using pyenv version $(pyenv version)" |
| 27 | + echo "${SIG} Using pyenv version $(pyenv version)." |
26 | 28 |
|
27 | 29 | # this was a major issue previously, sanity check that we're using the
|
28 | 30 | # version we *think* we're using (that pyenv is pointing to)
|
29 |
| - echo "python -c 'import sys; print(sys.version)'" |
| 31 | + echo "${SIG} Running: python -c 'import sys; print(sys.version)'. We've got:" |
30 | 32 | python -c 'import sys; print(sys.version)'
|
31 | 33 |
|
32 | 34 |
|
33 |
| - echo "install plotly (ignoring possibly cached versions)" |
34 |
| - pip install -I ${PLOTLY_PACKAGE_ROOT} || |
35 |
| - error_exit "${LINENO}: can't install plotly package from project root" |
36 |
| - |
37 |
| - echo "import plotly to create .plotly dir if DNE" |
38 |
| - python -c 'import plotly' || |
39 |
| - error_exit "${LINENO}: can't import plotly package" |
40 |
| - |
41 |
| -# echo "${HOME}" |
42 |
| -# echo "${PLOTLY_CONFIG_DIR}" |
43 |
| -# |
44 |
| -# # test that it imports when you don't have write permissions |
45 |
| -# sudo chmod -R 444 ${PLOTLY_CONFIG_DIR} && python -c "import plotly" || |
46 |
| -# error_exit "${LINENO}: permissions test 444 on .plotly dir failed" |
47 |
| -# |
48 |
| -# # test that setting write permissions will work for import (and tests) |
49 |
| -# sudo chmod -R 666 ${PLOTLY_CONFIG_DIR} && python -c "import plotly" || |
50 |
| -# error_exit "${LINENO}: permissions test 666 on .plotly dir failed" |
51 |
| - |
52 |
| - echo "running tests for Python ${version} as user '$(whoami)'" |
53 |
| - nosetests -xv plotly/tests --with-coverage --cover-package=plotly || |
54 |
| - error_exit "${LINENO}: test suite failed for Python ${version}" |
55 |
| - mkdir "${CIRCLE_ARTIFACTS}/${PYENV_VERSION}" || true |
56 |
| - coverage html -d "${CIRCLE_ARTIFACTS}/${PYENV_VERSION}" \ |
57 |
| - --title=${PYENV_VERSION} |
| 35 | + echo "${SIG} Install plotly (ignoring possibly cached versions)." |
| 36 | + pip install -I ${PLOTLY_PACKAGE_ROOT} >/dev/null || |
| 37 | + error_exit "${SIG} ${LINENO}: can't install plotly package from project root" |
| 38 | + |
| 39 | + echo "${SIG} Import plotly to create .plotly dir if DNE." |
| 40 | + python -c 'import plotly' >/dev/null || |
| 41 | + error_exit "${SIG} ${LINENO}: can't import plotly package" |
| 42 | + |
| 43 | + echo "${SIG} Running tests for Python ${version} as user '$(whoami)'." |
| 44 | + nosetests -x plotly/tests || |
| 45 | + error_exit "${SIG} ${LINENO}: test suite failed for Python ${version}" |
58 | 46 |
|
59 | 47 | done
|
0 commit comments