]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/run-tox.sh
3 function dump_envvars
{
4 echo "WITH_PYTHON2: ->$WITH_PYTHON2<-"
5 echo "WITH_PYTHON3: ->$WITH_PYTHON3<-"
6 echo "TOX_PATH: ->$TOX_PATH<-"
7 echo "ENV_LIST: ->$ENV_LIST<-"
10 # run from ./ or from ../
11 : ${CEPH_BUILD_DIR:=$PWD/.tox}
12 : ${MGR_DASHBOARD_VIRTUALENV:=$CEPH_BUILD_DIR/mgr-dashboard-virtualenv}
15 test -d dashboard
&& cd dashboard
17 if [ -e tox.ini
]; then
18 TOX_PATH
=$
(readlink
-f tox.ini
)
20 TOX_PATH
=$
(readlink
-f $
(dirname $0)/tox.ini
)
23 # tox.ini will take care of this.
25 export CEPH_BUILD_DIR
=$CEPH_BUILD_DIR
27 source ${MGR_DASHBOARD_VIRTUALENV}/bin
/activate
29 if [ "$WITH_PYTHON2" = "ON" ]; then
30 if [[ -n "$@" ]]; then
33 ENV_LIST
+="py27-cov,py27-lint,py27-check,"
36 # WITH_PYTHON3 might be set to "ON" or to the python3 RPM version number
37 # prevailing on the system - e.g. "3", "36"
38 if [[ "$WITH_PYTHON3" =~
(^
3|^ON
) ]]; then
39 if [[ -n "$@" ]]; then
42 ENV_LIST
+="py3-cov,py3-lint,py3-check,"
45 # use bash string manipulation to strip off any trailing comma
46 ENV_LIST
=${ENV_LIST%,}
48 tox
-c "${TOX_PATH}" -e "${ENV_LIST}" "$@"
50 test "$TOX_STATUS" -ne "0" && dump_envvars