Merge "Document how to run tempest tests locally"

This commit is contained in:
Jenkins 2017-04-06 14:25:42 +00:00 committed by Gerrit Code Review
commit ce1089603b
5 changed files with 154 additions and 52 deletions

View File

@ -0,0 +1,11 @@
[[local|localrc]]
DATABASE_PASSWORD=password
RABBIT_PASSWORD=password
SERVICE_TOKEN=password
SERVICE_PASSWORD=password
ADMIN_PASSWORD=password
enable_plugin zun https://git.openstack.org/openstack/zun
enable_plugin kuryr-libnetwork http://git.openstack.org/openstack/kuryr-libnetwork
# Optional: uncomment to enable the Zun UI plugin in Horizon
# enable_plugin zun-ui https://git.openstack.org/openstack/zun-ui

View File

@ -12,60 +12,10 @@ an OpenStack project.
http://docs.openstack.org/infra/manual/developers.html
Setup Dev Environment
=====================
Install OS-specific prerequisites::
# Ubuntu/Debian:
sudo apt-get update
sudo apt-get install -y libmysqlclient-dev build-essential python-dev \
python3.4-dev git libssl-dev libffi-dev
Install pip::
curl -s https://bootstrap.pypa.io/get-pip.py | sudo python
Install common prerequisites::
sudo pip install virtualenv flake8 tox testrepository git-review
You may need to explicitly upgrade virtualenv if you've installed the one
from your OS distribution and it is too old (tox will complain). You can
upgrade it individually, if you need to::
sudo pip install -U virtualenv
Zun source code should be pulled directly from git::
# from your home or source directory
cd ~
git clone https://git.openstack.org/openstack/zun
cd zun
All unit tests should be run using tox. To run Zun's entire test suite::
# run all tests (unit and pep8)
tox
To run a specific test, use a positional argument for the unit tests::
# run a specific test for Python 2.7
tox -epy27 -- test_conductor
You may pass options to the test programs using positional arguments::
# run all the Python 2.7 unit tests (in parallel!)
tox -epy27 -- --parallel
To run only the pep8/flake8 syntax and style checks::
tox -epep8
Exercising the Services Using Devstack
======================================
This session has been tested on Ubuntu only.
This session has been tested on Ubuntu 16.04 (Xenial) only.
Clone devstack::

View File

@ -0,0 +1,64 @@
..
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
=========================
Run tempest tests locally
=========================
This is a guide for developers who want to run tempest tests in their local
machine.
Zun contains a suite of tempest tests in the zun/tests/tempest directory.
Tempest tests are primary for testing integration between Zun and its
depending software stack (i.e. Docker, other OpenStack services). Any proposed
code change will be automatically rejected by the gate if the change causes
tempest test failures. If this happens, contributors are suggested to refer
this document to re-run the tests locally and perform any necessary
trouble-shooting.
Prerequisite
============
You need to deploy Zun in a devstack environment.
Clone devstack::
# Create a root directory for devstack if needed
sudo mkdir -p /opt/stack
sudo chown $USER /opt/stack
git clone https://git.openstack.org/openstack-dev/devstack /opt/stack/devstack
We will run devstack with minimal local.conf settings required. You can use the
sample local.conf as a quick-start::
git clone https://git.openstack.org/openstack/zun /opt/stack/zun
cp /opt/stack/zun/devstack/local.conf.sample /opt/stack/devstack/local.conf
Run devstack::
cd /opt/stack/devstack
./stack.sh
**NOTE:** This will take a while to setup the dev environment.
Run the test
============
Navigate to tempest directory::
cd /opt/stack/tempest
Run this command::
tox -eall-plugin -- zun.tests.tempest.api --concurrency=1

View File

@ -0,0 +1,74 @@
..
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
==============
Run unit tests
==============
This is a guide for developers who want to run unit tests in their local
machine.
Prerequisite
============
Install OS-specific prerequisites::
# Ubuntu/Debian (recommend Ubuntu 16.04):
sudo apt-get update
sudo apt-get install -y libmysqlclient-dev build-essential python-dev \
python3.5-dev git libssl-dev libffi-dev \
python-gdbm
Install pip::
curl -s https://bootstrap.pypa.io/get-pip.py | sudo python
Install common prerequisites::
sudo pip install virtualenv flake8 tox testrepository git-review os-testr
You may need to explicitly upgrade virtualenv if you've installed the one
from your OS distribution and it is too old (tox will complain). You can
upgrade it individually, if you need to::
sudo pip install -U virtualenv
Zun source code should be pulled directly from git::
# from your home or source directory
cd ~
git clone https://git.openstack.org/openstack/zun
cd zun
Running the tests
=================
All unit tests should be run using tox. To run Zun's entire test suite::
# run all tests (unit and pep8)
tox
To run a specific test, use a positional argument for the unit tests::
# run a specific test for Python 2.7
tox -epy27 -- test_container
You may pass options to the test programs using positional arguments::
# run all the Python 2.7 unit tests (in parallel!)
tox -epy27 -- --parallel
To run only the pep8/flake8 syntax and style checks::
tox -epep8

View File

@ -23,7 +23,10 @@ Contents
:maxdepth: 1
dev/quickstart
dev/manual-devstack.rst
dev/unit_tests
dev/tempest_tests
dev/manual-devstack
osprofiler
readme
installation
usage