42 Commits

Author SHA1 Message Date
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
Mike Bayer
a9ec13d949 Consolidate pifpaf commands into variables
Removes the separate per-Python-interpreter
setup for the pifpaf run and consolidates necessary
variables in one place to be passed into a single command
line.

Change-Id: I2f34642f16d6dba5b01500fcdc89e88b93642cd3
2016-07-19 20:18:07 +03:00
Roman Podoliaka
72bab42e00 tox: add py35 envs for convenience
py35 jobs are going to be run in the gate soon. Add py35 to the list
of defaut envs and add corresponding pifpaf environments for running
tests locally.

All py35 tests currently pass - we can effectively declare py35
compatibility via a new classifier in setup.cfg.

Change-Id: Iea7e286062f95d5c61b9ec1e7f6af4138fe3ce99
2016-07-07 08:02:11 +03:00
Jenkins
d1716100a9 Merge "Allow testing of MySQL and PostgreSQL scenario locally" 2016-05-31 16:50:51 +00: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
ChangBo Guo(gcb)
7574ab7ac7 Remove oslo-incubator related stuff
Change-Id: I4f09eb32cbc461e8aa8cb0df4612730d02e46dda
2016-05-11 19:32:58 +08:00
Doug Hellmann
91cd18ef99 add reno for release notes management
Change-Id: I6574d2bb21fa8c64290b06ab493f8f7c8b1b7c16
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-02-23 15:04:49 -05:00
Janonymous
09df051276 Put py34 first in the env order of tox
To solve the problem of "db type could
not be determined" on py34 we have to run first the py34 env to, then, run
py27. This patch puts py34 first on the tox.ini list of envs to avoid this
problem to happen.

Change-Id: I2365f66eee43cd36e62fe05e582c328787a0a112
Closes-bug: #1489059
2015-12-22 18:24:28 +05:30
Robert Collins
01359ef167 Refactor deps to use extras and env markers
Adds extras for e.g. nova to use for testing, so that oslo.db can
control the libraries used.

Removes test-requirements.txt - it becomes a single env-marker
controlled list, and shows how tox will access those dependencies.

Co-Authored-By: Roman Podoliaka <rpodolyaka@mirantis.com>

Change-Id: I97ef5bad215abe60d92c3fda4474c48ccb13eab0
2015-11-30 17:01:36 +00:00
Davanum Srinivas
be42656cd9 Remove python 2.6 and cleanup tox.ini
* Remove support for python 2.6
* Remove skipsdist : Needs to be set only if 
  sdist is expensive
* Remove usedevelop : only needed when skipsdist 
  is set to True
* Remove install_command : We can just use the 
  default, we don't need to override
* sitepackages : default is already false


Change-Id: I12de2f2175fce3a0b24c16a1fc55100c2927883f
2015-11-16 00:28:36 +00:00
Ronald Bradford
e00868db72 Fix coverage configuration and execution
A number of configuration errors prevent the successful creation of code
coverage. This corrects the .coveragerc source/omit setup and the tox
package name generation.

http://lists.openstack.org/pipermail/openstack-dev/2015-October/076193.html

Change-Id: I677ca6ed73096cf408455cd0968a488a1cbab636
2015-10-08 17:29:42 -04:00
Matt Riedemann
30cb737256 Move runtime test resources into setup.cfg [extras]
testscenarios and testresources are only needed if you're using the
oslo.db testing fixtures downstream, otherwise you don't need this at
runtime in a deployment, so move them into the setup.cfg [extras] group.

If a consumer of oslo.db wants to use the db test fixtures then they
install oslo.db like 'sudo pip install oslo.db[fixtures]'.

This should trigger a major version bump for the library when it lands.

Closes-Bug: #1429233

Change-Id: I1a7c5b6a7b29cd3a50655f60606cc0b025400a96
2015-08-26 12:06:29 -07:00
Davanum Srinivas
5645b7b93d Fix hacking rules and docs job
Change-Id: I2d86f266165ad98ded9f0bb9f11abfd8aa2c09ef
2015-08-08 07:30:58 -04:00
Angus Lees
112aa3dd00 Test that concurrent sqlalchemy transactions don't block
Neutron (and presumably other projects) expect to be able to have
overlapping transactions open from two eventlets at once, without
deadlock.

Note that the default mysql sqlalchemy engine (mysqldb) fails this test.

This change modifies py27 tox env to run the full test suite separately
with and without TEST_EVENTLET environment variable set.  When set,
tests are run with eventlet imported and monkey_patched.

Change-Id: Ib35c95defea8ace5b456af28801659f2ba67eb96
Related-Bug: #1350149
2015-07-16 20:20:45 +10:00
Dirk Mueller
5554801ee6 Remove outdated tox environments for SQLAlchemy 0.8
The global requirements require now SQLAlchemy 0.9.7 or newer,
so there is no choice to test in a SQLAlchemy 0.8 environment
anymore. Just remove the code related to that.

Change-Id: Id4be73285a1f4b4ca70a3cbb0904e8d4f577aaa4
2015-07-13 10:14:08 +02:00
Davanum Srinivas
8d1bb486fd Add tox target to find missing requirements
Change-Id: I8c0f7bb9718c851e20a1ea7e2d066cf5f664e9a1
2015-06-26 15:17:24 +03:00
Jeremy Stanley
9b552046f5 Switch from MySQL-python to PyMySQL
As discussed in the Liberty Design Summit "Moving apps to Python 3"
cross-project workshop, the way forward in the near future is to
switch to the pure-python PyMySQL library as a default.

Added a special test environment to keep MySQL-python support.
Documentation modified.

https://etherpad.openstack.org/p/liberty-cross-project-python3

Change-Id: I12b32dc097a121bd43991bc38dd4d289b65e86c1
2015-06-18 15:42:23 +03:00
Davanum Srinivas
7edad68918 Remove support for Python 3.3
Change-Id: Ia4993cd36fa1573c3ac28abe08ea7c665a8332c0
2015-05-10 19:17:03 -04:00
Victor Sergeyev
fa43657e9a Use PyMySQL as DB driver in py3 environment
MySQLDb driver works only with python2.x, so we should use an another
connector for work with python3.
Used OS_TEST_DBAPI_ADMIN_CONNECTION env variable to set connection
strings.

Change-Id: I27fbe8f87c713b53a0b1831543a23f7c06fe454b
2015-02-12 17:28:54 +02: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
James Carey
766ff5ef9f Activate pep8 check that _ is imported
Remove the specification in tox.ini that _ is a builtin so that
it will no longer assume that _ does not need to be imported.

This helps ensure that the _ from i18n is used.

Activating this check did not flag any violations.

Change-Id: Idc4d6259d4eb2db66e7122535bc42f8647049a06
2014-10-31 20:39:59 +00:00
Joshua Harlow
4fa3350945 Start adding a environment for py34/py33
Get a tox environment for py34/py33 that doesn't stop the existing
py26 and py27 to continue working with the adjusted test-requirements since
MySQL-python and sqlalchemy-migrate do not yet exist in 3.x.

Note that this does not fully make py34 work yet but it starts to work
in this direction of getting it to work (which will apparently require
quite a big more tweaking).

Change-Id: I024957a76f2de0bd406d14da5af6e4caf3d493e7
2014-09-25 13:05:09 -07:00
Jenkins
720af896c8 Merge "Add doc8 to tox environment docs" 2014-09-02 17:07:02 +00:00
Christian Berendt
f2f0960b15 Add doc8 to tox environment docs
Check reStructuredText documents for common style issues.

Change-Id: I10e61742e86d2d4781c5a00532c8e17d38a7d4b4
2014-09-01 11:40:08 +02:00
Andrey Kurilin
92d9a1c40f Use oslo.i18n
Module `gettextutils` from common code was graduated to oslo.i18n, so it
would be great if we reuse this library.

Change-Id: Ie5836b82723fc80c1d54e5e65eac8565cf905c5a
2014-09-01 11:48:21 +03:00
Petr Blaho
69f16bf8b1 Fixes comments to pass E265 check.
Fixes comments to pass E265 check.
Removes E265 from ignore setting in tox.ini.

Change-Id: I2e83c037a920a06b24695d6daea70ded179e3ebe
2014-08-03 17:19:06 +02:00
Petr Blaho
e1dbd31c5b Fixes indentations to pass E128 check.
Fixes indentations to pass E128 check.
Removes E128 from ignore setting in tox.ini.

Change-Id: I92ca574c076b4bd26e424a3b404188601264b5de
2014-08-03 17:19:06 +02:00
Petr Blaho
423c17e02b Uses keyword params for i18n string to pass H703
Uses keyword params for i18n string to pass H703 check.
Removes H703 from ignore setting in tox.ini.

Change-Id: I7b4f48be739167aed7dcb33a8a70e24adfe02672
2014-08-03 17:19:00 +02:00
Petr Blaho
3cb592775d Adds empty line to multilines docs to pass H405
Adds empty line to multilines docs to pass H405 check.
Removes H405 from ignore setting in tox.ini.

Change-Id: I0516fb12765bf961a4488570a6c73b80f667d972
2014-08-03 17:08:21 +02:00
Petr Blaho
0996c5d016 Updates one line docstring with dot to pass H402
Updates one line docstring with dot to pass H402.
Removes H402 from ignore setting in tox.ini.

Change-Id: Ibb4f16cbb3bb453456b579e0fafbd3f4c4e60aff
2014-08-03 16:38:22 +02:00
Petr Blaho
a3ca010d0a Changes import orders to pass H305 check
Changes import orders to H305 check in hacking 0.9.x
Leaves H305 in ignore setting in tox.ini
due to hacking is confused by oslo.* namespace
when checking import rules
see https://bugs.launchpad.net/hacking/+bug/1329363

Change-Id: I1701574b5e1a8cde1a044cda90a0c95360bb0825
2014-08-03 16:38:22 +02:00
Oleksii Chuprykov
d845a16abd Remove sqla_07 from tox.ini
Remove support of sqla_07 test according to global requirements

Change-Id: I1c4817c28b779bdb6467e346a38147b193f58a38
2014-07-24 12:31:28 +00:00
Ilya Pekelny
c34c32e09e Opportunistic migration tests
Migrations should be tested with real database backends. For this goal
intended number of base test cases which used in current implementation.
Previously there were two ways to run migration tests: using
opportunistic test cases (default way we've been using on CI) and
by using database connection strings, specified in test_migrations.conf,
for every particular database test case. For the sake of simplicity and
consistency we are moving to using of opportunistic db test cases here.

With this change we are free from locking, so we don't need `lockfile`
anymore.

Closes-Bug: #1327397
Closes-Bug: #1328997
Change-Id: I92b1dcd830c4755f429a0f6529911e607c2c7de7
2014-07-16 10:31:21 +03:00
Mike Bayer
a1fd49fd9b Test for distinct SQLAlchemy major releases
This change presents one way we might include test support
for oslo.db against specific SQLAlchemy major releases, currently
including the 0.7, 0.8, and 0.9 series.  As we will want to
begin including features within oslo.db that target advanced
and in some cases semi-public APIs within SQLAlchemy, it will
be important that we test these features against each major release,
as there may be variances between major revs as well as
version-specific approaches within oslo.

To accomplish this, I was not able to override "deps" alone,
as the SQLAlchemy revision within requirements.txt conflicts
with a hand-entered requirement, and due to pip's lack of
a dependency resolver (see https://github.com/pypa/pip/issues/988
and https://github.com/pypa/pip/issues/56) I instead overrode
"commands".  I don't know that this is the best approach, nor
do I know how the tox.ini file is accommodated by CI servers,
if these CI servers would need their tox invocation altered or
how that works.

This patch may or may not be the way to go, but in any case
I'd like to get input on how we can ensure that more SQLAlchemy-specific
oslo.db features can be tested against multiple SQLAlchemy versions.
Note that even with this change, running the "sqla_07" environment
does in fact produce test failures, see http://paste.openstack.org/show/85263/;
so already oslo.db expects behaviors that are not present in
all SQLAlchemy versions listed in the common requirements.txt.

Change-Id: I4128272ce15b9e576d7b97b1adab4d5027108c7c
2014-07-01 15:21:12 -04:00
Davanum Srinivas
455b47168f Bump hacking to 0.9.x series
In order to keep this patch to just a requirements bump, ignore new and
stricter hacking rules that are being triggered. Fixing up the code and
turning these on is out of scope of this patch and is for future patches.

Change-Id: I632655eb975a9f6c2b922c065c029e9870bc2b70
2014-06-12 07:48:09 -04:00
Victor Sergeyev
df1c1dc23c Added `docs` environment to tox.ini
Added the new tox environment to build docs.
Fixes in oslo.db documentation building

Change-Id: Icab4f299df3d8a4c40dc4fd7292609109f206afd
2014-06-06 12:47:17 +03:00
Victor Sergeyev
86401d6da3 Add import_exceptions to tox.ini
In oslo-incubator Oslo incubator multiple functions can be imported
from gettextutils on one line. So we should allow such imports in
hacking.

Change-Id: Ic55996987d312839c5e6863a1eb99faea3b575a9
2014-05-27 12:04:17 +03:00
Brant Knudson
6f8e4fe99d Allow cover tests to work
`tox -e cover` would fail with

 ERROR: InvocationError: could not find executable
 'OSLO_LOCK_PATH=/tmp/'

Change-Id: I6208847f25a47ff3d4e7704249a02baecaac2d7e
2014-05-19 17:06:25 -05:00
Victor Sergeyev
b50609bc0e Fix dhellmann's notes from April 18
removed the python 3 classifier. See note
e4cfa6d39d (commitcomment-6058177)

added W292 pep8 check. See note
276f7570d7 (commitcomment-6058296)

added usage examples. See note
e4cfa6d39d (commitcomment-6058130)
2014-04-22 18:37:08 +03:00
Victor Sergeyev
276f7570d7 Make the tests passing
- add missed requirements
- add required modules from openstack.common
- added entry points to setup.cfg
- fixed tests location
- fixed incorrect common modules imports
2014-04-18 12:51:26 +03:00
Victor Sergeyev
e4cfa6d39d Fix the graduate.sh script result 2014-04-18 11:33:16 +03:00