script/run_tox.sh: drop support of python2

since we don't support python2 anymore, there is not need to mention or
support python2 when performing tests

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2021-07-31 20:44:57 +08:00
parent 5ae7b9202b
commit 3c40db975c
3 changed files with 6 additions and 20 deletions

View File

@ -1124,7 +1124,7 @@ Unit tests based on tox
~~~~~~~~~~~~~~~~~~~~~~~~
We included a ``tox`` configuration file that will run the unit tests under
Python 2 or 3, as well as linting tools to guarantee the uniformity of code.
Python 3, as well as linting tools to guarantee the uniformity of code.
You need to install ``tox`` and ``coverage`` before running it. To install the
packages in your system, either install it via your operating system's package
@ -1139,9 +1139,6 @@ Alternatively, you can use Python's native package installation method::
To run the tests, run ``src/script/run_tox.sh`` in the dashboard directory (where
``tox.ini`` is located)::
## Run Python 2+3 tests+lint commands:
$ ../../../script/run_tox.sh --tox-env py27,py3,lint,check
## Run Python 3 tests+lint commands:
$ ../../../script/run_tox.sh --tox-env py3,lint,check

View File

@ -145,7 +145,6 @@ environments and run options::
$ tox -e py3,lint,check
## To run it as Jenkins would:
$ ../../../script/run_tox.sh --tox-env py27,py3,lint,check
$ ../../../script/run_tox.sh --tox-env py3,lint,check
Manager core unit tests

View File

@ -25,13 +25,13 @@ options:
example:
following command will run tox with envlist of "py27,py3" using the "tox.ini" in current directory.
following command will run tox with envlist of "py3,mypy" using the "tox.ini" in current directory.
$prog_name --tox-envs py27,py3
$prog_name --tox-envs py3,mypy
following command will run tox with envlist of "py27" using "/ceph/src/python-common/tox.ini"
following command will run tox with envlist of "py3" using "/ceph/src/python-common/tox.ini"
$prog_name --tox-envs py27 --tox-path /ceph/src/python-common
$prog_name --tox-envs py3 --tox-path /ceph/src/python-common
EOF
}
@ -116,17 +116,7 @@ function main() {
echo "$PWD already exists, but it's not a virtualenv. test_name empty?"
exit 1
fi
# try to use the prefered python for creating the virtual env for
# bootstrapping tox.
case $tox_envs in
py3*)
virtualenv_python=python3;;
py2*)
virtualenv_python=python2;;
*)
virtualenv_python=python3;;
esac
$source_dir/src/tools/setup-virtualenv.sh --python=${virtualenv_python} ${venv_path}
$source_dir/src/tools/setup-virtualenv.sh ${venv_path}
fi
source ${venv_path}/bin/activate
pip install tox