From 426f6afb3ce09ae1325d10930eba134e0573f78e Mon Sep 17 00:00:00 2001 From: Andrey Kurilin Date: Wed, 13 Jan 2016 14:57:24 +0200 Subject: [PATCH] Add functional tests launcher for py3 env It would be nice to check not only unit test on py3 env, but functional tests too. Also, this patch fixes usage of xrange in functional tests. Change-Id: I15ef204022583a40a02b3f2a48771347ddc95f3e --- novaclient/tests/functional/api/test_servers.py | 2 +- novaclient/tests/functional/hooks/post_test_hook.sh | 2 +- tox.ini | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/novaclient/tests/functional/api/test_servers.py b/novaclient/tests/functional/api/test_servers.py index 5615eb849..df6671fa2 100644 --- a/novaclient/tests/functional/api/test_servers.py +++ b/novaclient/tests/functional/api/test_servers.py @@ -22,7 +22,7 @@ class TestServersAPI(base.ClientTestBase): server_name, self.image, self.flavor) self.addCleanup(initial_server.delete) - for x in xrange(60): + for x in range(60): server = self.client.servers.get(initial_server) if server.status == "ACTIVE": break diff --git a/novaclient/tests/functional/hooks/post_test_hook.sh b/novaclient/tests/functional/hooks/post_test_hook.sh index a07bd0c63..f58d8bb6f 100755 --- a/novaclient/tests/functional/hooks/post_test_hook.sh +++ b/novaclient/tests/functional/hooks/post_test_hook.sh @@ -43,7 +43,7 @@ cd $NOVACLIENT_DIR echo "Running novaclient functional test suite" set +e # Preserve env for OS_ credentials -sudo -E -H -u jenkins tox -efunctional +sudo -E -H -u jenkins tox -e ${TOX_ENV:-functional} EXIT_CODE=$? set -e diff --git a/tox.ini b/tox.ini index ba335c1dc..845523a4c 100644 --- a/tox.ini +++ b/tox.ini @@ -35,6 +35,13 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen [testenv:functional] +basepython = python2.7 +setenv = + OS_TEST_PATH = ./novaclient/tests/functional +commands = python setup.py testr --testr-args='--concurrency=1 {posargs}' + +[testenv:functional-py34] +basepython = python3.4 setenv = OS_TEST_PATH = ./novaclient/tests/functional commands = python setup.py testr --testr-args='--concurrency=1 {posargs}'