Move away from invoking api tests explicitly

Since adoption of the Tempest plugin framework, this
extra plumbing is no longer necessary in tree.

Related-bug: 1555356

Depends-on: If5f7ea82c45494953452f728fabb7403d0b6e14e
Change-Id: I5377f33c5a7b29f97f00878e048d154378a4fe34
This commit is contained in:
Armando Migliaccio 2016-04-11 15:04:12 -07:00
parent b97cf3850f
commit 965e1d18a7
4 changed files with 25 additions and 52 deletions

View File

@ -297,10 +297,10 @@ be made about implementation. Only the contract defined by Neutron's REST API
should be validated, and all interaction with the daemon should be via should be validated, and all interaction with the daemon should be via
a REST client. a REST client.
neutron/tests/tempest/api was copied from the Tempest project. At the time, there was The neutron/tests/tempest/api directory was copied from the Tempest project around
an overlap of tests between the Tempest and Neutron repositories. This overlap the Kilo timeframe. At the time, there was an overlap of tests between the Tempest
was then eliminated by carving out a subset of resources that belong to and Neutron repositories. This overlap was then eliminated by carving out a subset
Tempest, with the rest in Neutron. of resources that belong to Tempest, with the rest in Neutron.
API tests that belong to Tempest deal with a subset of Neutron's resources: API tests that belong to Tempest deal with a subset of Neutron's resources:
@ -514,22 +514,15 @@ API Tests
+++++++++ +++++++++
To run the api tests, deploy Tempest and Neutron with DevStack and To run the api tests, deploy Tempest and Neutron with DevStack and
then run the following command: :: then run the following command, from the tempest directory: ::
tox -e api tox -e all-plugin
If tempest.conf cannot be found at the default location used by If you want to limit the amount of tests that you would like to run, you
DevStack (/opt/stack/tempest/etc) it may be necessary to set can do, for instance: ::
TEMPEST_CONFIG_DIR before invoking tox: ::
export TEMPEST_CONFIG_DIR=[path to dir containing tempest.conf]
tox -e api
You may also utilize Neutron's Tempest plugin by going to the Tempest directory
and executing:
tox -e all-plugin neutron
export DEVSTACK_GATE_TEMPEST_REGEX="<you-regex>" # e.g. "neutron"
tox -e all-plugin $DEVSTACK_GATE_TEMPEST_REGEX
Running Individual Tests Running Individual Tests
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -3,7 +3,6 @@
set -xe set -xe
NEUTRON_DIR="$BASE/new/neutron" NEUTRON_DIR="$BASE/new/neutron"
TEMPEST_DIR="$BASE/new/tempest"
SCRIPTS_DIR="/usr/os-testr-env/bin/" SCRIPTS_DIR="/usr/os-testr-env/bin/"
venv=${1:-"dsvm-functional"} venv=${1:-"dsvm-functional"}
@ -39,34 +38,24 @@ function generate_testr_results {
fi fi
} }
if [ "$venv" == "api-pecan" ]; then
# api-pecan is the same as the regular api job
venv='api'
fi
if [[ "$venv" == dsvm-functional* ]] || [[ "$venv" == dsvm-fullstack* ]] if [[ "$venv" == dsvm-functional* ]] || [[ "$venv" == dsvm-fullstack* ]]
then then
owner=stack owner=stack
sudo_env= sudo_env=
log_dir="/tmp/${venv}-logs" log_dir="/tmp/${venv}-logs"
elif [ "$venv" == "api" ]
then # Set owner permissions according to job's requirements.
owner=tempest cd $NEUTRON_DIR
# Configure the api tests to use the tempest.conf set by devstack. sudo chown -R $owner:stack $NEUTRON_DIR
sudo_env="TEMPEST_CONFIG_DIR=$TEMPEST_DIR/etc"
# Run tests
echo "Running neutron $venv test suite"
set +e
sudo -H -u $owner $sudo_env tox -e $venv
testr_exit_code=$?
set -e
# Collect and parse results
generate_testr_results
exit $testr_exit_code
fi fi
# Set owner permissions according to job's requirements.
cd $NEUTRON_DIR
sudo chown -R $owner:stack $NEUTRON_DIR
# Run tests
echo "Running neutron $venv test suite"
set +e
sudo -H -u $owner $sudo_env tox -e $venv
testr_exit_code=$?
set -e
# Collect and parse results
generate_testr_results
exit $testr_exit_code

View File

@ -23,4 +23,3 @@ pylint==1.4.5 # GNU GPL v2
reno>=1.6.2 # Apache2 reno>=1.6.2 # Apache2
# Needed to run DB commands in virtualenvs # Needed to run DB commands in virtualenvs
PyMySQL>=0.6.2 # MIT License PyMySQL>=0.6.2 # MIT License
tempest>=11.0.0 # Apache-2.0

View File

@ -17,14 +17,6 @@ commands =
# there is also secret magic in ostestr which lets you run in a fail only # there is also secret magic in ostestr which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable. # mode. To do this define the TRACE_FAILONLY environmental variable.
[testenv:api]
basepython = python2.7
passenv = {[testenv]passenv} TEMPEST_CONFIG_DIR
setenv = {[testenv]setenv}
OS_TEST_PATH=./neutron/tests/tempest/api
TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc}
OS_TEST_API_WITH_REST=1
[testenv:common] [testenv:common]
# Fake job to define environment variables shared between dsvm/non-dsvm jobs # Fake job to define environment variables shared between dsvm/non-dsvm jobs
setenv = OS_TEST_TIMEOUT=180 setenv = OS_TEST_TIMEOUT=180