Commit Graph

75 Commits

Author SHA1 Message Date
Takashi Kajinami c66bc22b3e Display coverage report
... for easy reference. Also make sure old data is purged.

Change-Id: I4de110655db80f111fa88bdcdbc0665ebbc40cfc
2024-02-07 12:13:08 +09:00
Mike Bayer 009d23df45 Add option for wsrep_sync_wait
When using Galera, the wsrep_sync_wait option [1]
can change the behavior of a variety of Galera DQL/DML statements
such that a particular operation will pause until outstanding
write-sets are fully persisted to the local node.  The setting
supersedes the previous boolean parameter wsrep_causal_reads
which only affected SELECT, with an updated approach that allows
for fine-grained control of so-called "causality checks"
on individual statement types.  The legacy-compatible setting
of '1' indicates that READ/SELECT/BEGIN operations should
proceed only after any pending writesets are fully available.

The use case for this setting is for an application that
is running operations on multiple Galera nodes simultaenously.
An application that commits data on one node, and then immediately
uses a different connection (on a potentially different node)
to SELECT that data, may fail to see those changes if
"causality checks" for SELECT are not enabled.  While
a COMMIT operation in Galera will block locally until all other
nodes approve of the writeset, the operation does not block
for the subsequent period of time when other nodes are actually
persisting that writeset.  Setting up "causal reads"
in this case indicates that a SELECT operation will wait until
any writesets in progress are available, thus maintaining
serialization between the COMMIT and subsequent SELECT.

As the name implies, wsrep_sync_wait adds...waiting!  to the
operation, and thus directly impacts performance by adding
latency to SELECT operations or to the operations that have
been selected for causality checks, to the degree that
concurrent writesets are expected to be present.

Since it's not expected that most if any Openstack applications
actually need this setting in order to be effective with
Galera multi-master operation, and as the setting is available
within client session scope and also impacts performance,
making it available on a per-application basis means that
specific applications which may see issues under load can
choose to enable this setting, much in the way any other
"transaction isolation" settings might be made, without having
to add a cluster-wide performance penalty by setting it at the
Galera server level.

[1] https://mariadb.com/docs/ent/ref/mdb/system-variables/wsrep_sync_wait/

Change-Id: Iee7afcac8ba952a2d67a9ad9dd0e4eae3f42518e
2022-12-05 11:49:14 -05:00
Stephen Finucane e7642fd2c8 tox: Silence output
Enable the 'CaptureOutput' fixture provided by oslotest by default.

Change-Id: Ib34d8ab411a67816db2e26b49bec75993b5bed56
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-02-08 14:46:42 +00:00
Stephen Finucane 4c1eb966c0 tests: Enable SQLAlchemy 2.0 deprecation warnings
Well, sort of. We enable them but immediately filter out the ones we're
actually seeing, the rationale being that we can address these in a
piecemeal fashion without the risk of introducing new issues.

Change-Id: I32cad5fd9ddbfd2ff6b62e5e2f87fad6ece7a4c1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-07-29 16:37:02 +01:00
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
YuehuiLei bd3ead2b5e Changed minversion in tox to 3.18.0
The patch bumps min version of tox to 3.18.0 in order to
replace tox's whitelist_externals by allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: I86c077215e3256a050d22b00e89d240ef7dbcbff
2021-06-22 11:56:09 +02:00
wu.shiming ad720c3371 Remove lower-constraints remnants
These were missed in change : Icd090cf8a36fa560bf7b0c67d0e1c4923c221c65

Change-Id: I07b577f4e948c03d1751145e5f898b90ac1c197a
2021-02-19 14:38:30 +08:00
Zuul 9aa6114d74 Merge "Use py3 as the default runtime for tox" 2021-01-21 17:48:02 +00:00
Hervé Beraud 2bd456b44a Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

[1] https://review.opendev.org/#/c/722814/
[2] https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file

Change-Id: I4d35a6e96f8b0fb8dc85632a63131b51d06b403e
2020-11-04 10:47:42 +01:00
Hervé Beraud 6c3b36a28d Use py3 as the default runtime for tox
Moving on py3 as the default runtime for tox to avoid to update this at
each new cycle.

Wallaby support officially the following runtimes [1]:
- Python 3.6
- Python 3.8

During Victoria Python 3.7 was used as the default runtime [2] however this
version isn't longer officially supported.

[1] https://governance.openstack.org/tc/reference/runtimes/wallaby.html#python-runtimes-for-wallaby
[2] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-victoria

Change-Id: I66af9ab9bba12cdbb4a3652991f62aa98fa67450
2020-11-04 10:01:50 +01:00
Hervé Beraud 80190b395c Adding pre-commit
Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit
hooks.
- Applying fixes for pre-commit compliance in all code.

Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.

pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker
(check-byte-order-marker);
- Checks that non-binary executables have a proper
  shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings
  (check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
    calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)

For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks

Change-Id: Id03c1ea4752db3236c36521ca9c67125d5ba2526
Co-authored-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-22 12:32:18 +02:00
Sean McGinnis 3db424844b
Bump default tox env from py37 to py38
Python 3.8 is now our highest level supported python runtime.
This updates the default tox target environments to swap out
py37 for py38 to make sure local development testing is
covering this version.

This does not impact zuul jobs in any way, nor prevent local
tests against py37. It just changes the default if none is
explicitly provided.

Change-Id: Id0107e9cdabbc1435c709641b93cb5c90cdf6907
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:25:49 -05:00
Andreas Jaeger 4e6fe7cf7d Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

blacklist:
 W504 line break after binary operator

Fix:
E305 expected 2 blank lines after class or function definition, found 1

Change-Id: I56d62f67914f07e7aef74f857c4b42e3bfd3416e
2020-03-30 11:57:43 +00:00
Hervé Beraud aba1098b7e [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in Ussuri cycle.

Complete discussion & schedule can be found in
-
http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: I02e2d11d38d2aa4182e8d466519b99f05943701f
2020-02-03 18:33:11 +01:00
caoyuan 40e0275849 tox: Trivial cleanup
move 'basepython' to the top-level 'testenv'

Change-Id: I37c608d9da6bffe2f24e0e1fbeb4e8d350089850
2019-12-23 15:37:46 +00:00
caoyuan 9a5f153c4b tox: Keeping going with docs
Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.

[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045

Change-Id: Idaca0bc97e33e0a080de612420177b5e102c628c
2019-10-24 14:28:28 +08:00
Corey Bryant db780378d2 Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: Ie47812bec5284d447a2f9c339a5b29d49d83ab53
Story: #2005924
Task: #34234
2019-08-09 22:48:06 +00:00
Elod Illes f34e53ebf7 Add local bindep.txt
As it was announced [1] global bindep-fallback.txt was removed and now
projects need to have a local bindep.txt to be able to install binary
dependencies for testing.

In test jobs the script tools/test-setup.sh is called which requires
mysql and postgres servers and clients to be installed.

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-June/007272.html

Change-Id: I6b237ecf55ff440b5f5c956ee849a1927bb15441
2019-06-26 16:03:39 +02:00
Ghanshyam Mann 2f8250f3f7 Dropping the py35 testing
All the integration testing has been moved to
Bionic now[1] and py3.5 is not tested runtime for
Train or stable/stein[2].

As per below ML thread, we are good to drop the py35
testing now:
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/005097.html

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004647.html
[2]
https://governance.openstack.org/tc/reference/runtimes/stein.html
https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: Iba00d9fadaf3a682f3e4bb2dea335dfc74cf030d
2019-05-30 13:39:24 +00:00
Stephen Finucane 05ddd9fc9e docs: Use sphinxcontrib.apidoc for building API docs
Gets us away from the old pbr functionality.

Some cleanup of tox.ini is included along the way.

Change-Id: Ia228f8ee49f31f88fa2a66f2aad3a3921c41a785
2019-05-21 08:50:29 +00:00
jacky06 cc5c0e36cd Replace git.openstack.org URLs with opendev.org URLs
Change-Id: Iff5086fee8c94325aa16a3b5727dac66a64478ec
Closes-Bug: #1825933
2019-04-23 05:29:23 +00:00
Vieri 49e5bbe55e Don't quote {posargs} in tox.ini
Quotes around {posargs} cause the entire string to be combined into one
arg that gets passed to stestr. This prevents passing multiple args
(e.g. '--concurrency=16 some-regex')

Change-Id: Id8b5f9e1e334609d39a58706ac2039240f0ce9cb
2018-10-09 13:35:12 +00: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
Doug Hellmann 4c70002578 remove sqla_09 test environment
We no longer support SQLAlchemy 0.9.0, so remove the test environment.

Change-Id: I614945b178ee09fe3c4c6c61c9356d072d776639
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 17:33:06 -04:00
Doug Hellmann 69b23ef7de fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I31a207868c07e08ae27c14635d52506021032cb7
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 14:53:48 -04:00
Kenneth Giusti 06b64aea94 Remove stale pip-missing-reqs tox test
pip_missing_reqs tool is no longer maintained and has broken with
release 10 of pip

Refer to:
 http://lists.openstack.org/pipermail/openstack-dev/2018-April/130027.html

Change-Id: I78b50d28d7d3d06f210a7027b2a74426c891b652
2018-05-01 09:43:21 -04:00
Doug Hellmann 3f7abe0bab set default python to python3
Set the default python to python3 except for the py27 environment. We
have to set that explicitly to override the new default.

Change-Id: I8557195409a559950da6c95aece5787195f31ad6
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-13 16:00:13 -04:00
Doug Hellmann f659198dfc add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.

Add openstack-tox-lower-constraints job to the zuul configuration.

See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.

Change-Id: I33404e115161a430ce0587bf203450c8145db0a0
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-24 21:02:26 -04: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
ChangBo Guo(gcb) 83a32d33c2 add bandit to pep8 job
Add the bandit security scanner to the pep8 job.
* convert assert statement to raise AssertionError
* skip B311,B105

Change-Id: I23b2732791f42adfa04bd64f02b25cbdb98aaf93
2017-12-22 10:10:59 +08:00
ChangBo Guo(gcb) 4f81c41994 Use the new PTI for document build
For compliance with the Project Testing Interface as described in:

https://governance.openstack.org/tc/reference/project-testing-interface.html

For more detials information, please refer to:

http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: Iba311cc69ec5272d8beb433e3589c53f371d5d0a
2017-12-19 14:41:22 +08:00
Dirk Mueller 48d5380f2e Drop MySQL-python dependency from oslo.db
In order to fade out MySQL-python from OpenStack we need to stop
testing it. Add release notes entry and adjust documentation
references accordingly.

Depends-On: Ie1f07062ed18350bcbb9e7b5e33c7ab2390be9ab
Change-Id: Ie17f4543fa3d72b507d88d2c4023a9a5a430419e
2017-10-17 07:17:06 +02:00
Eric Brown 053f240b00 Remove references to Python 3.4
Now that there exists only a gate job for Python 3.5 and not 3.4,
we should remove those references to the 3.4 that is untested.

Change-Id: Ic2e61f28bc82f64814a528d210d1dee8d79b49e5
2017-01-17 10:25:21 -08: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
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