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:
parent
b97cf3850f
commit
965e1d18a7
27
TESTING.rst
27
TESTING.rst
@ -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
|
||||
a REST client.
|
||||
|
||||
neutron/tests/tempest/api was copied from the Tempest project. At the time, there was
|
||||
an overlap of tests between the Tempest and Neutron repositories. This overlap
|
||||
was then eliminated by carving out a subset of resources that belong to
|
||||
Tempest, with the rest in Neutron.
|
||||
The neutron/tests/tempest/api directory was copied from the Tempest project around
|
||||
the Kilo timeframe. At the time, there was an overlap of tests between the Tempest
|
||||
and Neutron repositories. This overlap was then eliminated by carving out a subset
|
||||
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:
|
||||
|
||||
@ -514,22 +514,15 @@ API Tests
|
||||
+++++++++
|
||||
|
||||
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
|
||||
DevStack (/opt/stack/tempest/etc) it may be necessary to set
|
||||
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
|
||||
If you want to limit the amount of tests that you would like to run, you
|
||||
can do, for instance: ::
|
||||
|
||||
export DEVSTACK_GATE_TEMPEST_REGEX="<you-regex>" # e.g. "neutron"
|
||||
tox -e all-plugin $DEVSTACK_GATE_TEMPEST_REGEX
|
||||
|
||||
Running Individual Tests
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -3,7 +3,6 @@
|
||||
set -xe
|
||||
|
||||
NEUTRON_DIR="$BASE/new/neutron"
|
||||
TEMPEST_DIR="$BASE/new/tempest"
|
||||
SCRIPTS_DIR="/usr/os-testr-env/bin/"
|
||||
|
||||
venv=${1:-"dsvm-functional"}
|
||||
@ -39,34 +38,24 @@ function generate_testr_results {
|
||||
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* ]]
|
||||
then
|
||||
owner=stack
|
||||
sudo_env=
|
||||
log_dir="/tmp/${venv}-logs"
|
||||
elif [ "$venv" == "api" ]
|
||||
then
|
||||
owner=tempest
|
||||
# Configure the api tests to use the tempest.conf set by devstack.
|
||||
sudo_env="TEMPEST_CONFIG_DIR=$TEMPEST_DIR/etc"
|
||||
|
||||
# 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
|
||||
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
|
||||
|
@ -23,4 +23,3 @@ pylint==1.4.5 # GNU GPL v2
|
||||
reno>=1.6.2 # Apache2
|
||||
# Needed to run DB commands in virtualenvs
|
||||
PyMySQL>=0.6.2 # MIT License
|
||||
tempest>=11.0.0 # Apache-2.0
|
||||
|
8
tox.ini
8
tox.ini
@ -17,14 +17,6 @@ commands =
|
||||
# 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.
|
||||
|
||||
[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]
|
||||
# Fake job to define environment variables shared between dsvm/non-dsvm jobs
|
||||
setenv = OS_TEST_TIMEOUT=180
|
||||
|
Loading…
Reference in New Issue
Block a user