subunit2sql/.testr.conf
Matthew Treinish 6608e63b19 Add DB API testing framework
This commit adds functional tests for the db api. It is still a
rough implementation right now, but to start I'm not worried about
that too much since it works. Things will just be a bit slow, because
it drops the db and runs the migrations on an empty db on each test
method, locks against every other api test method and the migration
tests, and requires a local mysql db exist with the hardcoded values
from the migration opportunistic test functions. But it works!

Ideally we would just use the in memory sqlite db for this testing
since it provides the isolation we really desire for running
individual tests. However, because the migrations don't work on
sqlite this makes it kinda difficult.

To mitigate the locking penalty a bit a group regex is added to the
testr.conf to serialize tests at the class level. This will at least
mean that api tests will run serially since they're all in the same
class.

In an effort to decrease code duplication as part of adding additional
DB functional tests the existing migration tests are refactored to
use a common set of fixtures and util methods to handle the test db
setup and connection configuration information.

We also should slowly ramp up the number of tests here since the
coverage is very basic as this was intended to mostly start the
framework. But that, can be a follow up patch.

Change-Id: Iea6dd86498002ab20977b5fb02b4c7d751a08bca
2015-09-16 22:30:16 +00:00

10 lines
435 B
Plaintext

[DEFAULT]
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
${PYTHON:-python} -m subunit.run discover -t ./ ./subunit2sql/tests $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list
group_regex=([^\.]*\.)*