Commit Graph

12 Commits

Author SHA1 Message Date
Stephen Finucane f048068216 tox: Simplify test running
We were actually running tests four times. Twice with eventlet disabled
and twice with it enabled. Correct this.

Change-Id: Idb3926d73ff3c11abe9c273062aca1b299b9f72e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-07-16 13:01:45 +01:00
Sean McGinnis 7af699e728
Make test-setup.sh compatible with mysql8
Starting from mysql version 8 it's not possible to create a user
implictly when using GRANT.

This patch makes the behavior compatible with that.

Change-Id: I42912629daaca44250270fca8d9534b801e95d7b
Co-written-by: Riccardo Pittau <elfosardo@gmail.com>
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-06-30 08:15:27 -05:00
Vu Cong Tuan 944fe4b6c1 Switch to stestr
According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: Ifd51e726de277d33ff61db47110bf8b5563fcda7
2018-07-13 10:18:54 +07:00
Monty Taylor 621332cf36
Remove tox_install.sh and align constraints consumption
As part of removing reliance on the old and deprecated zuul-cloner,
we need to shift constraints declaration to the deps line. This
means we unfortunately have to duplicate the extras declarations
into test-requirements - because otherwise the contraints for
oslo.db conflicts with the installation of itself.

Change-Id: I2b79444a58a9144993131f9cba7494b236d9e950
2018-03-08 09:46:24 -06:00
Andreas Jaeger 353ab39047 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 is exactly what is
currently done by OpenStack CI in project-config.

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

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

Update CONTRIBUTING.rst for this.

Needed-By: Ia298e25f9b15a2dcfc4553ea058fc2c0f3705a8b
Change-Id: I825b72e3f645d02f7efdb3315a12825a8c937759
2017-02-06 21:56:20 +01:00
Tony Breeds a07e1320e7 Add Constraints support
Adding constraints support to libraries is slightly more complex than
services as the libraries themselves are listed in upper-constraints.txt
which leads to errors that you can't install a specific version and a
constrained version.

This change adds constraints support by also adding a helper script to
edit the constraints to remove oslo.db.

Change-Id: I31febfe00698e36f4c2e0e41c3f7bf64acf47adf
2016-12-20 14:37:14 +11:00
Julien Danjou 044cf85ef5 Allow testing of MySQL and PostgreSQL scenario locally
This leverage pifpaf to start MySQL or PostgreSQL temporarily and allow to test
provisioning directly without being on OpenStack CI by adding new tox
targets:

- py27-mysql
- py27-postgresql
- py34-mysql
- py34-postgresql
- py27-all
- py34-all

These targets will start MySQL or PostgreSQL before running the tests,
while exporting the connection string to $PIFPAF_URL. The `all' target
will start both MySQL and PostgreSQL and will run the tests against
these backends, plus SQLite.

Also, this patches add OS_TEST_DBAPI_ADMIN_CONNECTION to be allowed to
be passed through tox. This allows to run the opportunistic tests on a
more persistent pifpaf database, for example by running tox with:

$ eval `pifpaf -g OS_TEST_DBAPI_ADMIN_CONNECTION run postgresql`
$ echo $OS_TEST_DBAPI_ADMIN_CONNECTION
postgresql://localhost/postgres?host=/var/folders/7k/pwdhb_mj2cv4zyr0kyrlzjx40000gq/T/tmpMGqN8C&port=9824
$ tox -e py27
[…]
$ tox -e py34
[…]
$ kill $PIFPAF_PID

Change-Id: I1ee582e6f96e98378f02be79f4aaff0f447a062a
Depends-On: Id3e6b694bb186724517599cd9875ad80ceeee053
2016-05-19 16:19:53 +02:00
Doug Hellmann b775191428 Remove run_cross_tests.sh
This script is part of the oslotest package now.

Change-Id: Ic8c2fbaf5b34d2f254a9091a1b4390b7c8e751fe
2015-05-05 19:39:49 +00:00
Matthew Treinish 9a510e85ce Fix slowest test output after test run
This commit fixes the output from pretty_tox.sh so that the testr
slowest output is gobbled up by the pipe into subunit-trace.

Change-Id: I4e23cb3c3773e58a297416c1f51996fef059330a
2015-01-11 16:55:30 -05:00
Mike Bayer efbb3887e0 Add pretty_tox wrapper script
This ports Nova/Neutron's'(and others) "pretty tox" script into tools/
and establishes it within tox.ini.   This causes a vanilla test run
to output the full package names of all tests, the index of the
subprocess it's being run within, as well as the total run time
and status of each test.  It also captures stdout/stderr and reports on that
as well; revealing that oslo.db's tests have a lot of deprecation
warnings in fact.

The display of this runner shows a lot more information than the
default testr/subunit thing which is somewhat useless, and for
those who are actually watching the test output, this is what
we'd most like to see.

Pretty Tox.  Pretty please, can we have?

Change-Id: I50d1c6e998425964dd9a5497c2bc1e9145be3120
2015-01-06 17:57:50 -05:00
Doug Hellmann 7063585c60 Move files out of the namespace package
Move the public API out of oslo.db to oslo_db. Retain the ability to
import from the old namespace package for backwards compatibility for
this release cycle.

Blueprint: drop-namespace-packages

Change-Id: Ie96b482b9fbcb1d85203ad35bb65c1f43e912a44
2014-12-24 13:28:48 +02:00
Victor Sergeyev c9e5fdf3bc Add run_cross_tests.sh script
Script `run_cross_tests.sh` can be used for running unit tests in
other projects using the current package's code.

Change-Id: Iad636216cd73d2eeb70448fda789c0ad9d579b3a
Related-Bug: #1367354
2014-09-09 19:13:03 +03:00