From c6e48ef0f024b4a3f4b457367544d773197933d4 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 20 Apr 2020 18:26:27 +0800 Subject: [PATCH] doc/dev/developer_guide: use python3 to launch vstart_runner.py as vstart_runner.py is compatible with python3, and so is the tests under `qa/` directory. and use `pip` to install teuthology, simpler this way. Signed-off-by: Kefu Chai --- .../developer_guide/running-tests-locally.rst | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/doc/dev/developer_guide/running-tests-locally.rst b/doc/dev/developer_guide/running-tests-locally.rst index f80a6f52b339c..49eff3ecec155 100644 --- a/doc/dev/developer_guide/running-tests-locally.rst +++ b/doc/dev/developer_guide/running-tests-locally.rst @@ -36,6 +36,8 @@ This means the cluster is running. Step 3 - run s3-tests ^^^^^^^^^^^^^^^^^^^^^ +.. highlight:: console + To run the s3tests suite do the following:: $ ../qa/workunits/rgw/run-s3tests.sh @@ -50,17 +52,12 @@ Running your first test The Python tests in Ceph repository can be executed on your local machine using `vstart_runner.py`_. To do that, you'd need `teuthology`_ installed:: - $ git clone https://github.com/ceph/teuthology - $ cd teuthology/ - $ virtualenv -p python2.7 ./venv + $ virtualenv --python=python3 venv $ source venv/bin/activate - $ pip install --upgrade pip - $ pip install -r requirements.txt - $ python setup.py develop + $ pip install 'setuptools >= 12' + $ pip install git+https://github.com/ceph/teuthology#egg=teuthology[test] $ deactivate -.. note:: The pip command above is pip2, not pip3; run ``pip --version``. - The above steps installs teuthology in a virtual environment. Before running a test locally, build Ceph successfully from the source (refer :doc:`/install/build-ceph`) and do:: @@ -73,24 +70,20 @@ To run a specific test, say `test_reconnect_timeout`_ from `TestClientRecovery`_ in ``qa/tasks/cephfs/test_client_recovery``, you can do:: - $ python2 ../qa/tasks/vstart_runner.py tasks.cephfs.test_client_recovery.TestClientRecovery.test_reconnect_timeout + $ python ../qa/tasks/vstart_runner.py tasks.cephfs.test_client_recovery.TestClientRecovery.test_reconnect_timeout The above command runs vstart_runner.py and passes the test to be executed as an argument to vstart_runner.py. In a similar way, you can also run the group of tests in the following manner:: $ # run all tests in class TestClientRecovery - $ python2 ../qa/tasks/vstart_runner.py tasks.cephfs.test_client_recovery.TestClientRecovery + $ python ../qa/tasks/vstart_runner.py tasks.cephfs.test_client_recovery.TestClientRecovery $ # run all tests in test_client_recovery.py - $ python2 ../qa/tasks/vstart_runner.py tasks.cephfs.test_client_recovery + $ python ../qa/tasks/vstart_runner.py tasks.cephfs.test_client_recovery Based on the argument passed, vstart_runner.py collects tests and executes as it would execute a single test. -.. note:: vstart_runner.py as well as most tests in ``qa/`` are only - compatible with ``python2``. Therefore, use ``python2`` to run the - tests locally. - vstart_runner.py can take the following options - --clear-old-log deletes old log file before running the test -- 2.39.5