From e950efdc7342c5646d5ec3224fd1913f70bf7e2d Mon Sep 17 00:00:00 2001 From: Chandan Kumar Date: Tue, 25 Jul 2017 12:11:58 +0530 Subject: [PATCH] Switch to refstack-client binary and some cleanup * Use latest pbr >= 2.0.0 * Removed gitpython as it is not used within the code * switched to refstack-client binary in README.rst * Removed unwanted stuff from setup.py as those are already in setup.cfg * use pip install -e . to auto install dependencies from requirements.txt as well as package. Change-Id: Ia0b1b0a598c48200dc91cc08af9bd78d5685091e --- README.rst | 16 ++++++++-------- refstack_client/tests/smoke/run_in_docker | 2 +- requirements.txt | 2 +- setup.py | 13 +++++++++---- setup_env | 2 +- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/README.rst b/README.rst index a4d87b7..99b2e03 100644 --- a/README.rst +++ b/README.rst @@ -58,21 +58,21 @@ Usage 4. Validate your setup by running a short test:: - ./refstack-client test -c -v -- --regex tempest.api.identity.v3.test_tokens.TokensV3Test.test_create_token + refstack-client test -c -v -- --regex tempest.api.identity.v3.test_tokens.TokensV3Test.test_create_token 5. Run tests. To run the entire API test set:: - ./refstack-client test -c -v + refstack-client test -c -v To run only those tests specified in an OpenStack Powered (TM) Guideline:: - ./refstack-client test -c -v --test-list + refstack-client test -c -v --test-list For example:: - ./refstack-client test -c ~/tempest.conf -v --test-list \ + refstack-client test -c ~/tempest.conf -v --test-list \ "https://refstack.openstack.org/api/v1/guidelines/2017.01/tests?target=platform&type=required&alias=true&flag=false" This will run only the test cases required by the 2017.01 guidelines @@ -97,7 +97,7 @@ Usage the ostestr runner as is. This is mainly used for quick verification of the target test cases. (e.g. ``-- --regex tempest.api.identity.v2.test_token``) - Use ``./refstack-client test --help`` for the full list of arguments. + Use ``refstack-client test --help`` for the full list of arguments. 6. Upload your results. @@ -109,7 +109,7 @@ Usage Following is the command to upload your result anonymously:: - ./refstack-client upload + refstack-client upload The results file is a JSON file generated by refstack-client when a test has completed. This is saved in .tempest/.testrepository. When you use the @@ -120,7 +120,7 @@ Usage using an existing subunit file. This requires that you pass in the Keystone endpoint URL for the cloud that was tested to generate the subunit data:: - ./refstack-client upload-subunit --keystone-endpoint http://some.url:5000/v3 + refstack-client upload-subunit --keystone-endpoint http://some.url:5000/v3 Result can also be uploaded with signature by adding ``-i `` option. Intructions for uploading data with @@ -132,7 +132,7 @@ Usage You can list previously uploaded data from a RefStack API server by using the following command:: - ./refstack-client list --url + refstack-client list --url Tempest hacking diff --git a/refstack_client/tests/smoke/run_in_docker b/refstack_client/tests/smoke/run_in_docker index 0c0c82a..1a93318 100755 --- a/refstack_client/tests/smoke/run_in_docker +++ b/refstack_client/tests/smoke/run_in_docker @@ -2,4 +2,4 @@ cp -r /refstack-client /test cd /test ./setup_env -/bin/bash -c ". .venv/bin/activate; exec ./refstack-client test -vv -c tempest.conf -t tempest.api.identity.admin.test_users" +/bin/bash -c ". .venv/bin/activate; exec refstack-client test -vv -c tempest.conf -t tempest.api.identity.admin.test_users" diff --git a/requirements.txt b/requirements.txt index 8a651b7..2759bcd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -gitpython>=0.3.2.RC1 +pbr!=2.1.0,>=2.0.0 # Apache-2.0 python-subunit>=0.0.18 cryptography>=1.0,!=1.3.0 # BSD/Apache-2.0 requests>=2.5.2 diff --git a/setup.py b/setup.py index ed2f8fa..95c3587 100755 --- a/setup.py +++ b/setup.py @@ -16,9 +16,14 @@ import setuptools +# In python < 2.7.4, a lazy loading of package `pbr` will break +# setuptools if some other modules registered functions in `atexit`. +# solution from: http://bugs.python.org/issue15881#msg170215 +try: + import multiprocessing # noqa +except ImportError: + pass + setuptools.setup( - setup_requires=['pbr'], - version=0.1, - author='David Lenwell', - description='A testing tool used primarily by refstack.', + setup_requires=['pbr>=2.0.0'], pbr=True) diff --git a/setup_env b/setup_env index 476ef09..082df1c 100755 --- a/setup_env +++ b/setup_env @@ -157,7 +157,7 @@ python virtualenv.py ${TEMPEST_DIR}/.venv --python="${PYPATH}" cd .. rm -rf virtualenv-${VENV_VERSION} rm virtualenv-${VENV_VERSION}.tar.gz -${WORKDIR}/.venv/bin/python -m pip install -r ${WORKDIR}/requirements.txt +${WORKDIR}/.venv/bin/python -m pip install -e . ${TEMPEST_DIR}/.venv/bin/python -m pip install -r ${TEMPEST_DIR}/requirements.txt # Add additional packages to find more tests by tempest