storyboard/doc/source/contributing.rst
Andreas Jaeger d900740366 Prepare for using standard python tests
Add simple script to setup mysql and postgresql databases,
this script can be run by users during testing and will be
run by CI systems for specific setup before running unit tests.

This allows us to change in project-config the python-db jobs to
python-jobs since python-jobs will call this script initially.

Update documentation for this.

See also http://lists.openstack.org/pipermail/openstack-dev/2016-November/107784.html

Needed-By: I4566705d6e8ff17b2d400111919f6e1a0d0db3eb
Change-Id: I56fbce9fe0d0c90734f28457886b7a27bf8479f4
2017-02-02 12:12:46 +00:00

1.1 KiB

Running the Tests

The test suite includes functional tests that use a MySQL database, so you must configure a database user.

For MySQL you can use the following commands:

mysql -u root
mysql> CREATE USER 'openstack_citest'@'localhost' IDENTIFIED BY
       'openstack_citest';
mysql> GRANT ALL PRIVILEGES ON * . * TO 'openstack_citest'@'localhost';
mysql> FLUSH PRIVILEGES;

Note that the script tools/test-setup.sh can be used for the step above.

Storyboard uses tox to manage its unit and functional tests. After installing tox and downloading the storyboard source, run the tests with:

$ tox -e py27

or for Python 3:

$ tox -e py35

And to run the style-checker and static analysis tool:

$ tox -e pep8

On slower systems, the database migrations may take longer than the default timeout of 60 seconds. To override the timeout, set the OS_TEST_TIMEOUT environment variable. For example, to set the timeout to 2 minutes, run:

$ OS_TEST_TIMEOUT=120 tox -e py27