Commit Graph

77 Commits

Author SHA1 Message Date
Takashi Kajinami 29f9043b7b Fix sentinel tests not running
We have to tweak the environment set by pifpaf to use redis sentinel
as backend.

Change-Id: I2a3e0d08b6742ee7b473bc382bfc021523719251
2024-03-07 10:02:17 +00:00
Takashi Kajinami 221c4029f2 Show coverage report
... for easy reference. Also make sure old data is purged.

Change-Id: I3098314ad54031d0d169bd3bb93222a5792c3146
2024-02-07 12:39:10 +09:00
Takashi Kajinami f9d666aa4c tox: Bump python runtime versions in the default envlist
... according to the versions currently used in CI.

Change-Id: I5694f98fba37e58ae5280184ea966a7121d26f43
2023-12-18 15:13:35 +09:00
Takashi Kajinami 6bc02cda5b Remove etcd3 drvier
This driver was deprecated in the 2.11.0 release[1]. The 3.2.0 release
which contains this deprecation is used in upper-constraints of
stable/2023.1 so we are ready to remove this feature now.

[1] 7ee2780af8

Change-Id: I5ca2fe43cb25b4687ace6bd21a866b74f289d628
2023-11-17 23:34:26 +09:00
Tobias Urdin 7698c582f3 tox: set allowlist_externals
Change-Id: I96c9822e54864cdc7cfb6e22ce069054cfef9a94
2023-01-17 15:32:49 +00:00
Dmitriy Rabotyagov 7d50893625 Loosen protobuf version that's used for docs/renos
protobuf package is present in upper-constraints, thus should not be
specified in requirements to version that is smaller that one on u-c,
otherwise pip will fail due to conflict between requirements and
constraints.
We do that only for docs and releasenotes, since used workaround
decreases performance.

The issue is mainly raised by etcd3 module that we rely on, so not
to affect runtime things a left as is for now.

Change-Id: Ieeba8d53a8311ed6cc228f444c831d148ee29025
2022-11-30 18:16:48 +01:00
Daniel Bengtsson 714e77e71f Move flake8 as a pre-commit local target.
The goal here is to avoid conflicts between flake8 and hacking version each
2 days.

Inspired from nova's approach[1].

The flake8 version to install will be determined by hacking and
requirements[2] will stay aligned instead of relying on different versions.

[1] https://opendev.org/openstack/nova/src/branch/master/.pre-commit-config.yaml#L26-L35
[2] https://opendev.org/openstack/hacking/src/branch/master/requirements.txt#L1

Change-Id: Ic3f3d05ce7bb10a7d29815444dac00dea4f9c9d1
2021-04-06 11:01:50 +02:00
Zuul fa2b6cc7ae Merge "Use py3 as the default runtime for tox" 2021-02-24 02:42:21 +00:00
manchandavishal a381d71423 Bump hacking and flake8 version to fix pep8 job
This patch update hacking and flake8 version to
fix pep8 job.

Change-Id: Id6999d06fb2e15b5c80bc27b995bde065b342eec
2021-02-08 08:43:26 +00:00
Hervé Beraud 0187a2d24a 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: Id8aa147958139ddb3877c9a0066aa1513f543737
2020-11-04 10:07:09 +01:00
Hervé Beraud c3d8c2ed96 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: I7a2386a823fdd43b138956894bd915c0e11289a9
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-10-09 15:35:34 +00:00
Andreas Jaeger b60eee68b4 Switch to Victoria tests
This repo has been using train tests and thus was missed by the bot to
update from ussuri to victoria, update manually. also, update other jobs
to use now py38.

See also the PTI in governance [1].

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

Change-Id: Ie1ef901d7b52800912365cfeae96b0e66108e1fc
2020-05-14 13:13:57 +02:00
Andreas Jaeger ba27954b06 [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

Parent tox py36/py37 jobs to openstack-tox-py36/37 so that the correct
interpreter is installed.

Change-Id: I14a01f0a9989195e30c3ed0dadec35490f41bd48
2020-02-03 22:19:47 +01:00
Thomas Bechtold 4492bbaea8 Drop os-testr test-requirement and pretty_tox.sh
os-testr is only needed to provide the "subunit-trace" command which
is used in the tools/pretty_tox.sh script. And pretty_tox.sh is not
needed. "stestr" can be used directly in tox.ini. So drop
tools/pretty_tox.sh .

Change-Id: I6a18183f092689c8c9d283c19914da9baa59cc32
2019-09-24 13:05:10 +02:00
Corey Bryant 5f7a0e290e 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: Ie594497012dd65372c0014890f1fc989714a94b1
Story: #2005924
Task: #34234
2019-07-05 15:20:19 -04:00
Hervé Beraud ef5277d75c Move test deps to test-requirements.txt
Change-Id: I17554c184d028c142e9415c4a85d9a57d8177b77
2019-06-05 23:55:27 +02:00
garenchan 42672e3288 Referencing testenv deps now works
The bug `https://github.com/tox-dev/tox/issues/706` mentioned in the
comments has been resolved since tox version 3.1.0.

Change-Id: Idb5428d883efa776f0782a543cb7423ae9d4e4b4
2019-05-24 02:03:54 +00:00
Ben Nemec 8207427fff Unblock tooz gate
This is a squash of two commits needed to get gate tests passing
again on tooz. See below for details:

Move testing to py36

The base infra images no longer have python 3.5 available and are
all failing. We should be testing on py36 now anyway since that is
the minimum supported version for Train.

Stop redis-server before running tests

Just installing redis-server on Ubuntu Bionic starts the service,
which means when we try to start one via pifpaf it fails due to the
port already being in use.

This change adds a pre-run playbook that stops the redis-server
service so ours can run successfully.

Change-Id: I3f7f7ea9069d8c890a82f31ad14c9663e98c09dc
Closes-Bug: 1828610
2019-05-10 20:02:04 +00:00
Sahid Orentino Ferdjaoui de3a5f818b add python 3.7 unit test job
See ML discussion here [1] for context.

[1] http://lists.openstack.org/pipermail/openstack-dev/2018-October/135626.html

Story: #2004073
Co-authored-by: Corey Bryant <corey.bryant@canonical.com>
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
Change-Id: I438b44ee98df01dc2e870b4342ccb8a969a6c5c4
2019-02-26 15:59:40 +00:00
Ben Nemec f5accf53a0 Fix coverage tests
This project needs some special setup before running its tests, and
that wasn't happening in the cover tox env. This switches cover to
use the same methods for running tests as the regular test envs.

Change-Id: Ie4a6543286caa11dc15173679455b2aa2020dc97
2018-09-18 00:37:30 +00:00
Doug Hellmann bb234731d3 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.

Decode the output of subprocess in doc/source/conf.py so that we always
have a string.

Change-Id: I17601d56b6e6d9d300bb07d8982a7bbde637822e
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 16:18:21 -04:00
Doug Hellmann e883541d9f 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: Ib90566414f0967b2c7c7633950e3dc2fa8634982
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-13 16:17:04 -04:00
Sean McGinnis f36f0fcdb7 Follow 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: I328db3d0048386ddd2c4f785de542aeb7b98c6e1
2018-01-08 12:21:46 -06:00
Andreas Jaeger e7afb739bf Add doc/requirements.txt
Fix doc building with new PTI changes and job updates.

Add a doc/requirements.txt file with all needed dependencies.

Change-Id: Ic7963520aeb0b9c463c4f9b5675589308720d6f8
2017-12-20 12:14:08 +01:00
Akihiro Motoki ee6f82d9d5 doc: use list-table for driver support tables
list-table is easier to be maintained.

In addition, we avoid too long lines.
We no longer have too long lines which doc8 complains,
so doc8 ignore_path can be dropped.

Change-Id: I574391295288ef9e33744aa608c2f2930a6e46f8
2017-07-10 12:44:29 +00:00
Akihiro Motoki 2ca15fedbe rearrange existing documentation to fit the new standard layout
Change-Id: If03b33fc1393c3a04d7d155b31e8377dc9e09360
2017-07-10 12:41:52 +00:00
Akihiro Motoki cf12457896 Turn on warning-is-error in doc build
- Update sphinx so that warning-is-error option is available
- Fix sphinx warnings
- Install python modules required for automodule into docs env
- Fix docstring warning in tooz/coordination.py
- pbr warnerrors is no longer needed in favor of sphinx warning-is-error

Change-Id: I5d54c452522b6ee00884d7d17105af22b4c95189
2017-07-07 02:52:30 +00:00
Julien Danjou 6d1e1b55cb Simplify env list and test running
This should make it easy to run any Python version test, e.g. Python 3.6,
without any further change.

Change-Id: I91a47b736371549e50b7c7fd60e46e0f87c357ae
2017-06-09 18:09:31 +02:00
Julien Danjou 0fa14dd60e Factorize tox envlist for better readability
Also add missing etcd.

Change-Id: I99dc4d6d2a62459652904dceb1d5047d1eb20077
2017-06-08 09:27:38 +02:00
Davanum Srinivas 6ec73a0bed Separate etcd3gw driver that uses the etcd3 grpc gateway
Using grpc to directly access etcd3 does not work well with
eventlet based services. So we need to use the grpc HTTP
gateway API (/v3alpha).
https://coreos.com/etcd/docs/latest/dev-guide/api_grpc_gateway.html

For this we use the etcd3gw package:
https://pypi.python.org/pypi/etcd3gw

The structure of the code is very similar to the one we
already have that uses the etcd3 package.

Change-Id: I97bd7ffb05a7e40cb08c9b9d62cc45236ad292aa
2017-05-22 14:33:44 +02:00
Julien Danjou 9eb820bfde etcd3: fix test run
pifpaf always exports the URL as being etcd:// which always loads the etcd
driver, and never the etcd3 driver. Therefore, it's not currently tested.

This fixes that by exporting a variable in tox that will allow us to replace
the URL correctly.

Change-Id: Id4f54bb1f729498a39e9bf58da8ee01562c4344b
2017-05-09 21:31:52 -04:00
Jay Pipes 9ba92a88d0 etcd3: add etcd3 coordination driver
This patch adds support to Tooz for taking advantage of the etcd3 gRPC-based
API (instead of the etcd2 HTTP/REST-based API) via the python-etcd3 library.

Change-Id: Ic7c3d9be42a9912fcb09c43e7637270db4011c4a
2017-04-17 11:47:15 -04:00
Julien Danjou afba8d3c22 tests: tests fail if no URL is set + run partitioner tests on basic drivers
This makes sure that the test fails if not URL is set. This allows make sure we
test the non-coordination tests (e.g. partitioner) with all base drives (zake,
ipc, file) by using the TOOZ_TEST_URL to run the tests.

Change-Id: Id500636d166e5ebcc54fda16ef128f91f32170d6
2017-03-28 18:29:47 +02:00
Julien Danjou 85fbf6ca3c tests: fix etcd and consul test run
There was a typo in pifpaf call where the prefix for the variable name should
be prefixed by using the -e option and not -g.

Change-Id: I5a97e0a0ffc5ba675914bb0881520ddc9693fa1b
2017-03-28 18:29:47 +02:00
Tony Breeds 3a36a640cd [doc] Note lack of constraints is a choice
Change-Id: Id8cdb746ea1eaf66835a9b9cfbb6b11792a5f49d
2016-12-22 09:49:10 +11:00
Jenkins ee27b133f5 Merge "Bump hacking to 0.12" 2016-11-18 08:27:46 +00:00
Julien Danjou 09d5b3d45e tox: use pretty tox output
Change-Id: Ib8738de03820f94b9e68681631034b7847c39fbb
2016-11-14 21:38:00 +01:00
Julien Danjou 4e46ae1a5d tox: install docs dependency in docs target and reno
Otherwise, it does not work.

Change-Id: I6b3dd5752abdecd5ba9ec3acf7b122e5a40898d3
2016-11-10 10:34:29 +01:00
Julien Danjou a34d1d77f4 Bump hacking to 0.12
Change-Id: I43417e8a00960e6f3895263414218cf0de9bf1f3
Signed-off-by: Julien Danjou <julien@danjou.info>
2016-11-09 22:47:00 +01:00
ChangBo Guo(gcb) bfbee9fc9f Add reno for release notes management
The release management team have indicated this is their preferred way
to collect release notes in future.

Closes-Bug: #1634356

Change-Id: I10fbc4cb80d53d4bf5b8b6365c7472b7706d46b2
2016-11-03 15:09:51 +08:00
Julien Danjou 4f177580fe etcd: run tests in clustering mode too
Depends-On: Icbf997be2afb6e4f2cb8e142024dce21fe12a04b
Change-Id: Ibcb315ccde165ef3a5f7ba6900336059b436d75c
2016-09-25 12:43:41 +02:00
Julien Danjou 65d8c09148 Switch from Python 3.4 to Python 3.5
Change-Id: Iacf2a84d775ded1d67bf540ad0afc4bcf2066f14
2016-09-22 16:59:19 +02:00
John Schwarz f296519c27 etcd: properly block when using 'wait'
When using the wait functionality, one must use the last index increased
by one, as the wait returns once that index has been used. Using the
index that is already been returned by the etcd instance will cause
'wait' to return immediately, producing a busy-wait loop while spamming
the server with the same requests over and over.

Closes-Bug: #1603002
Change-Id: I4f3bee0a52dcf2eb69b96b53a9f777a5e2a7efb1
2016-07-20 16:50:16 +03:00
Julien Danjou e8d37b018a Change dependency to use flavors
This makes sure we install the correct and only the correct dependencies
when installing tooz, based on the driver one wants to use.

Change-Id: I58825cf228771a00b28d515a552141b42f884efa
2016-06-09 10:40:48 +02:00
Julien Danjou 7360f85dab Run doc8 only in pep8 target
This should be enough and we're sure it's also run by the gate.

Change-Id: I7680cbb54f38322c23e303c9b63b6887d3f609ad
2016-06-09 10:40:16 +02:00
Julien Danjou e2683c7b86 Move pep8 requirements in their own target
There's no need to depends on all the stack, as hacking is pulling
everything. We also can only install hacking in the pep8 target, as it's
not used per say for tests in tooz.

Change-Id: I69426ab2373ba2f76b098cf9e9eb812c8124748f
2016-06-09 10:40:16 +02:00
Julien Danjou 4906e72416 Use pifpaf to setup daemons
Depends-On: Id3e6b694bb186724517599cd9875ad80ceeee053
Change-Id: I2265b4b83f136f2eeb21e86cda1c7ec36401d0a8
2016-06-09 10:40:16 +02:00
Vilobh Meshram f917844ee5 Add a consul based driver
For now it only supports locks, in the
future it may support more functionality
as time allows (and/or if people want to
add it).

Co-Authored-By: Joshua Harlow <harlowja@gmail.com>

Implements: bp add-consul-driver

Change-Id: I6064383e9db4e90fd16f17065bd7b0934ca7e125
2016-05-12 08:23:49 +00:00
Julien Danjou 7d9dbc85f2 pep8: fix remaining errors and enable all checks
Change-Id: I6bd5b67c1227b967a6d65ae063a31817e3979ac4
2016-01-07 15:46:18 +01:00
Julien Danjou d2529173ec etcd: driver with lock support
Change-Id: Ibac90b9b2a751eb4f502e2f8b723e5608dcaad18
2015-12-29 10:02:05 +01:00