7 Commits

Author SHA1 Message Date
Chris Dent
06ea97ae45 Close and dispose test database setup connections
Without explicitly closing and disposing the connections can linger in a
non-deterministic fashion and cause intermittent "too many connection"
errors in the tests.

This is effectively a "backport" of change
I8badf2a3094f2d27d381bd178c6d579f2a5c5ffe in aodh, made here for
safety despite not seeing the problem regularly in the ceilometer
tests.

The -N 100 is removed from the setup-test-env so that we are using
whatever the postgresql default is, meaning that these tests will be
better at exposing errors that users may see.

Change-Id: I694d118ff8dc2b5c8be633121fa1037130fbe874
2015-07-23 16:14:57 +00:00
Chris Dent
bdec0f2a2b Be explicit about using /tmp for temporary datafiles
If TMPDIR is not set, different version of mktemp will behave
differently. To be sure, best to be explicit.

Change-Id: Id92eb4e5b833a1c0859a0c6d68cfc2f4e1f6977f
2015-02-19 17:02:20 +00:00
Ilya Tyaptin
df5cc17c9b Add clean_exit for py-pgsql unit tests
Currently, py-pgsql env doesn't stop postgresql daemon if
tests fails. In this patchset clean_exit function for postgresql
have been added.

Change-Id: If93d261108b2536ce92e15598a56d6cd8267b1fd
Closes-bug: 1423524
2015-02-19 15:33:00 +03:00
ZhiQiang Fan
bb3ba13799 Add mysql and postgresql in tox for debug env
Now we have seperate setup test environment script for mongodb,
mysql and postgresql, this patch adds debug env for mysql and
postgresql backend.

Change-Id: I4bff7f7443d0a5c073840b699dd15034c63b90eb
2014-11-13 21:36:38 +08:00
Romain Soufflet
73e03d2c62 Use 'pg_ctl' utility to start and stop database
Greping output for  starting message don't work all the time
because 'postgres' utility translate messages in other language
depending on computer settings

Change-Id: I6f48db92ccc16e8c75d76dd3fadbbeb9930f9cac
2014-11-07 11:26:51 +01:00
Joe H. Rahme
b23fd8c1fa Sets default encoding for PostgreSQL testing
Fixes the issue of some tests failing when inserting unicode characters
in the PostgreSQL test suite. This patch sets the default encoding of
all created databases to UTF8.

Related to blueprint sql-unit-tests-on-real-backend

Change-Id: Ie8629dd655ddb2327cce13c7e2a31cdb011791b5
2014-10-09 18:36:04 +02:00
Joe H. Rahme
52598e1272 Run unit tests against PostgreSQL
* Creates a new tox env py-pgsql
* Adds a new script setupt-test-env-postgresql.sh to set up postgresql
* Renames the MySQLDbManager into SQLManage, used by both mysql and
  postgresql tests
* Creates a new scenario for posgresql in the
  MixinTestsWithBackendScenarios

Related to blueprint sql-unit-tests-on-real-backend
Co-Authored-By: Ala Rezmerita <ala.rezmerita@cloudwatt.com>

Change-Id: I60af82d5d8b5750884ba0d1ca726645f8b31448b
2014-10-03 11:02:03 +02:00