Commit Graph

54 Commits

Author SHA1 Message Date
Stephen Finucane 88950e33ba 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.

There's a lot more to be done here. However, the work done in oslo.db
[1], nova [2], cinder [2] etc. should provide a guide for how to resolve
the outstanding issues.

[1] https://review.opendev.org/q/topic:sqlalchemy-20+project:openstack/oslo.db
[2] https://review.opendev.org/q/topic:sqlalchemy-20+project:openstack/nova
[3] https://review.opendev.org/q/topic:sqlalchemy-20+project:openstack/cinder

Change-Id: If13c14f1d968f1ef968ae440087227691cf966b0
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-12-22 15:57:44 +00:00
Radosław Piliszek 324fe6e69b Fix tox4 issues
New tox version 4 has changed interpretation of tox.ini

The passenv parsing requires the list to be comma-separated.
Since the names are case-insensitive, duplicates are removed.

skipsdist is now a synonym of no_package and avoids the
installation of the package in all cases.
However, some environments require it (for setup metadata).

Fix allowlist_externals where appropriate.

Change-Id: Icb067e85e4f4874a52710d7053a2048e337305c8
2022-12-25 15:57:41 +00:00
Elod Illes aa13e4536e [CI] Install dependencies for docs target
When tox 'docs' target is called, first it installs the dependencies
(listed in 'deps') in 'installdeps' phase, then it installs masakari
(with its requirements) in 'develop-inst' phase. In the latter case
'deps' is not used so that the constraints defined in 'deps' are not
used. This could lead to failures on stable branches when new packages
are released that break the build. To avoid this, the simplest solution
is to pre-install requirements, i.e. add requirements.txt to 'docs' tox
target.

Change-Id: Ic5e214be240023f0e4f02cae3939e1d199ecb061
2022-04-28 20:05:25 +02:00
sunjia 7b47a2a7a4 Generate PDF documentation
For PDFLaTeX, remove the irrelevant parts (contributing,
search) and those that break (full config examples).
Additionally, this replaces fancy quotes as they don't work
in PDFLaTeX either (it handles regular quotes internally).

Change-Id: I60459407e49a88c2231217152fc078346e5f4b4f
Co-Authored-By: Radosław Piliszek <radoslaw.piliszek@gmail.com>
2021-08-17 16:42:09 +00:00
songwenping 7d10b286ab 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: I2c5e92944ca38ca72b3d25041d2ef6bca13cbc51
2021-04-20 01:14:18 +00:00
Radosław Piliszek a90d5f1b5b [CI] Run bashate
... and fix related issues.

Change-Id: I3283545a8994c3895b9ccbe4006bec4b4cfc8c95
2021-03-20 14:06:57 +00:00
Zuul ca6c1525a0 Merge "Update TOX_CONSTRAINTS_FILE" 2020-12-22 17:35:02 +00:00
Radosław Piliszek f8f13e7d09 Drop lower-constraints
Per a general OpenStack resolution [1], lower-constraints
are not worth the extra work and confusion they introduce.
This patch drops them along with all mentions.

[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019521.html

Change-Id: Ib13e4f07aa6ee76be329d9eec9180c1fe31b9593
2020-12-21 17:49:44 +01:00
wu.shiming 8e5fb66709 Update TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
-https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file
This allows to use lower-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

Change-Id: Ifd0ee2056f605163d3d3de5a74059802b0f5674e
2020-12-14 17:55:34 +08:00
zhangboye 329b9fedd1 Replace deprecated UPPER_CONSTRAINTS_FILE variable
Change-Id: I5cbe5609ff3de717b624f89b76d999fb58ce3390
2020-12-03 14:34:00 +08:00
zhoulinhui 7bae084439 Constrain docs deps by upper-constraints
Tox is trying to install latest versions for building docs which may
not be supported by stable and lower branches, so should be
restricted by respective version's upper-constraints.txt

Change-Id: Iffb019a8a0b1b74bb54c92fc5079f0af6d7f4bc6
2020-09-11 17:24:29 +00:00
Radosław Piliszek 9e7d35b889 Use some better linting
Lints docs and yaml files in addition to Python.

Change-Id: I5255362cd6d2194600e149b118da4fbe102ffdb1
2020-09-11 17:24:25 +00:00
Radosław Piliszek c1d8b35661 Fix tox for api-ref
api-ref requires only doc requirements, not test.
Furthermore, some deps may not be installable due to lack of
binary deps in api-ref jobs, e.g. postgres [1].

[1] https://review.opendev.org/744343

Change-Id: Ie730a85ec2d05c3cdbab49da619f27982c14b9ce
Needed-By: https://review.opendev.org/744343
2020-09-11 17:24:05 +00:00
Radosław Piliszek a48a9fd5f1 Fix tox for py38 and lower-contraints
Make tox actually run the tests rather than just
install the deps.

Change-Id: Ie5e0ad7a05a97ecd280a0c87d6dc810bc17a641a
2020-09-11 17:23:08 +00:00
Sean McGinnis 2453383930
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: If2c78e4506670d341ad4ae7209957dc7d1832b38
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:25:43 -05:00
Andreas Jaeger 9350d8fb83 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found by updated hacking version.

Update local hacking checks to work with current flake8.

Remove hacking and friends from lower-constraints, they are not needed
there.

Change-Id: I89695a03791c2de36ab015b3831c85887b27f3b8
2020-04-19 07:41:06 +02:00
Zuul 953e1d804a Merge "Add ignore_basepython_conflict in tox.ini" 2020-03-23 06:42:29 +00:00
Zuul 4554e72a70 Merge "Fix constraints URL enforcement for lower-constraints" 2020-03-23 05:59:05 +00:00
Ghanshyam c596c966e9 Add ignore_basepython_conflict in tox.ini
ignore_basepython_conflict = True is to avoid the
python version conflict for basepython defined in base
env.

Bumping the tox minversion to 3.1.1 which has this flag available.

Change-Id: Ie16eede633e6c5706c9d68d525503b6ab77ea10c
2020-01-23 07:37:04 -06:00
Sean McGinnis 75388fdd27
Fix constraints URL enforcement for lower-constraints
Due to the upper-constraints argument being hard coded in the
install_command, even jobs like lower-constraints will end up getting
the latest upper-constraints installed.

The correct way to handle the constraints is to separate it out into
deps. This allows the l-c job to properly set what constraints to use.

Also fixes constraints URL to the preferred static path.

Change-Id: I92b6ee8ea5afdb16367a5b6d939e65e2fa48190d
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2019-12-16 11:24:10 -06:00
Ghanshyam Mann d46ea6b110 [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

Masakari is ready with python 3 and ok to drop the
python 2.7 support.

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

Depends-On: https://review.opendev.org/#/c/693631/
Change-Id: I144571286343e6be2518e3fe72e33c86a0fd0dfe
2019-11-16 14:24:16 +00:00
Shilpa Devharakar 596b3d142e Reorganize masakari documentation
Updated operator guide documentation for
1. segregated sections appropriately
2. referred masakariclient for CLI section
3. added detailed 'Install and configure for Ubuntu' section
4. added detailed 'Verify operation' section
5. used sphinx-build instead of the pbr sphinx extention for building docs
   as instructed by the PTI[1]
6. cleaned up build_sphinx related entries in setup.cfg

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

Change-Id: Iec93bebdbc7ffe1ccd27bb11f474384ff06a559c
2019-10-11 01:32:08 +00:00
Corey Bryant 85fa0c0058 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

Co-Authored-By: gujin <gu.jin@99cloud.net>
Change-Id: Ib98f78131050be2c38a0128d2e2a792639c03c1c
Story: #2005924
Task: #34221
2019-08-26 14:08:28 +05:30
Shilpa Devharakar 118381fcb4 add libpq-dev and python-dev to build psycopg2
This patch adds build prerequisites for psycopg2-2.8.3 as per [1]

[1]: http://initd.org/psycopg/docs/install.html

Change-Id: I591776f5e356152655b9c453644a79b397559f4f
2019-08-26 13:36:36 +05:30
Zuul 89cc782a58 Merge "Update api-ref location" 2019-08-26 06:15:23 +00:00
caoyuan 50938d0636 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I3976f7c19b4813a40a800cea58d3dc8e343e4ac8
2019-08-11 15:00:14 +00:00
Andreas Jaeger 7f16e79c49 Update api-ref location
The api documentation is now published on docs.openstack.org instead
of developer.openstack.org. Update all links that are changed to the
new location.

Note that redirects will be set up as well but let's point now to the
new location.

For details, see:
http://lists.openstack.org/pipermail/openstack-discuss/2019-July/007828.html

Change-Id: Ib3bf99b1fcb81d70aae3125734b3fe21e6b1aa5b
2019-08-01 16:43:01 +02:00
Sean McGinnis 0e100304a7
Switch from oslosphinx to openstackdocstheme
The oslosphinx package is not compatible with the current Sphinx 2.0
release. Migration has been happening to openstackdocstheme for some
time. To fix build failures for docs and releasenotes jobs, this
switches masakari jobs to use openstackdocstheme.

Uncapping jsonschema to pass requirements check so it matches global
requirements.

Change-Id: Ic74e8b075aa67d410617dac3346bf1c903995da7
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2019-04-10 09:07:04 -05:00
tpatil 0fa59ab7ed Add functional CI job and tests for segments
Added multi-node CI job to run functional tests.
This patch adds functional tests to check the behaviour
of Segment APIs.

Co-Authored-By: jayashri bidwe <jayashri.bidwe@nttdata.com>

Change-Id: I787b26b29fcd9556bc6b24b75ffe8e70e9f44610
2019-03-05 12:22:07 +05:30
openstack 68b9c42bef Run all jobs by default using python3
This patch implements the community wide goal to run all jobs by
default using python3.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Change-Id: Ie235cbffcfc69eee96c4b34358467009ca34ef9f
2019-03-03 19:11:19 +05:30
tpatil d471b824ea Update hacking version >1.1.0
Updated hacking version to >1.1.0 and <1.2.0.

Change-Id: I77ff4723fd420fc2f9afe0ca6c3d85d7ae1a28ba
2019-02-18 18:29:45 +09:00
tpatil 65d9f95124 Cleanup testrepository
Due to switch from testrepository to stestr, all references of
testrepoistory should be removed.

This patch cleanup all testrepository occurrences.

Change-Id: I02751fb6e94c3c18852812d2847e7713e8d3dd14
2019-01-16 10:49:14 +09:00
openstack 8373138dd7 Update coverage environment and use template for cover
After switch to using stestr, testrepository is unnecessary
and it is removed in patch[1]. After patch[1] got merged
tox -e cover returns "error: option --coverage not recognized".

In this patch fixed coverage environment to default stestr setup.
Also used openstack-tox-cover template, this runs the cover job
in the check queue only.

[1]: https://review.openstack.org/#/c/581686/
Closes-Bug: #1809230

Change-Id: I77a295a64e2c4d128a6772e400c0968f40d11c1d
2019-01-10 04:09:06 +00:00
Doug Hellmann fb8bd95600 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: Idb812bcd1f7068377e89da2873c61b856a6faf04
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-09-26 18:56:04 -04:00
bhagyashris ad3dc737c9 Add hooks for recovery method customization plugins
This change adds hooks for pulling in plugins for
Interoperable recovery method customization taksflow
by configuring the actions in terms of execution order,
extra parameters to execute commands in action.

Implements: blueprint recovery-method-customization

Change-Id: I8150935ce0a4e592bd0f87bb3c7b3e599cefa033
2018-08-02 13:13:00 +05:30
shilpa.devharakar d7592cbe25 Register and Document policy in code
Adds below things for the implementation of framework for registering and
using default policy rules.
* Policy-in-code
  The framework for registering and using default policy rules.
  Rules should be defined and returned from a module in
  masakari/policies/, and then added to the list in masakari/policies/__init__.py.
  A new context.can() method has been added for policy enforcement of
  registered rules. It has the same parameters as the enforce() method
  currently being used.
* Add policy sample generation
  The entry point and config file necessary for using the
  oslo.policy sample generation script. It also adds a tox target to
  simplify the usage of it.
* Add policy documentation and sample file
  Documentation and sample file for default policy in code feature.
* Hacking check for policy registration
  It ensures that policy registration happens in the centralized
  masakari/policies/ directory.
* Hacking check for _ENFORCER.enforce()
  Hacking check in order to ensure that only registered policies
  are used for authorization checks _ENFORCER.authorize should be used rather
  than _ENFORCER.enforce.
* Add entry_point for oslo policy scripts
  There are two helper scripts in oslo.policy to help deployers understand
  their policy configuration better. With the setup.cfg entry these can be
  called directly from oslo.policy.

Changes done here are with the reference of [1] at NOVA side
which is contributed by Andrew Laski and Claudiu Belu

[1] https://review.openstack.org/#/q/topic:bp/policy-in-code+project:openstack/nova+status:merged

Change-Id: If885a66d92c31be440d27d6780635800a0b12e3e
2018-07-27 12:15:14 +05:30
Doug Hellmann aa36bdaca5 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: Ibf03dd1e17a50ce1b263998342a6ebcb814562d3
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-07-23 12:51:43 +00:00
Chuck Short 56e733f784 Switch to using stestr
According to Openstack summit session [1] stestr is maintained
project to which all Openstack projects should migrate.
Let's switch it then.

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

Change-Id: Ifb64df81f7684d5bf732afcbe594a38691a7286f
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-07-03 12:02:08 -04:00
Doug Hellmann 1bcde21460 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: Iff00524bc3eb0fe1070aee7584885465cacd2393
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-20 16:23:35 -04:00
Abhishek Kekane c54d45f5db Masakari developer's documentation
Added documentation for how to get involved, development qucikstart
and masakari system architecture.

Change-Id: Ie2cbdde7698a79a1b996e485d141eb15dbded4cd
2017-11-27 05:31:13 +00:00
Abhishek Kekane f5e074c9e4 Masakari API Specifications
Added api specifications for versions, segments, hosts and
notifications as per OpenStack standards.

Change-Id: Iefc83254e22fc31d1f0d13f52e71d42c63e82b7d
2017-11-27 05:29:45 +00:00
Dinesh Bhor 66c607c6e8 Enable global hacking checks and remove local checks
In newer hacking version 0.12.0 [1], we can enable some of the
non-default hacking rules (one by one), which are disabled by
default. The enabled rules are the following:

* [H106] Don’t put vim configuration in source files (off by default).
* [H203] Use assertIs(Not)None to check for None (off by default).
* [H904] Delay string interpolations at logging calls (off by default).

Enabled these hacking rules by adding them in the list of
'enable-extensions' in tox.ini [flake8] section. Removed the local
implementation of those hacking rules from hacking/checks.py.

The test-requirements.txt is already updated to use the newer
hacking version 0.12.0 with this commit:
cc44a33f3d

[1] See "Enabling off-by-default checks" section:
    https://pypi.python.org/pypi/hacking/0.12.0

Change-Id: Ieccd5a84ebd80ba3313016c9caeb036eaa37769b
2017-08-04 04:55:18 +00:00
Vu Cong Tuan b26ba43f72 Remove support for py34
The gating on python 3.4 is restricted to <= Mitaka. This is due to
the change from Ubuntu Trusty to Xenial, where only python3.5 is
available. There is no need to continue to keep these settings.

Change-Id: Ieecf7342152cc813ec3585a3b1873ac0dc13d804
2017-07-11 15:33:14 +07:00
Jenkins 1ad9c148cd Merge "Use os-testr instead of testr" 2017-07-10 06:56:14 +00:00
Dinesh Bhor d4f982449e Use os-testr instead of testr
Masakari should use ostestr instead of testr. ostestr is more
powerful and provide much prettier output than testr. Other
projects like cinder, nova, glance, neutron etc already uses
the ostestr wrapper.

Using ostestr shows each tests execution separately because of
which it has shown errors related to "KeyError" in existing test
cases. The error looks like below:

"Exception in string format operation: KeyError: u'id'"

This happens if we don't pass keyword argument like "id" to
exception which we expect to be raised from test through
side_effect [1]. This doesn't lead to test failure but it
appears in test logs. This patch fixes such issues by passing
expected keyword arguments to exceptions.

[1] https://github.com/openstack/masakari/blob/master/masakari/tests/unit/api/openstack/ha/test_hosts.py#L364
Change-Id: I91603ea3dcf35fd20a00dcf477b93d612edca362
2017-07-05 17:37:52 +05:30
pooja jadhav 3076b10202 Enable code coverage report in console output
Modified tox configuration to enable code coverage
report in console output.

Change-Id: I64684f312612681552b511962a3366d832880106
2017-07-04 14:22:51 +05:30
Abhishek Kekane 7645ab489d Sync tox environment with upper-constraint of requirements
Added upper-constraints reference while installing requirements
in tox environment.

Change-Id: I4732d1128aefb57af1598a2c704e86c1d9509b2d
Closes-Bug: #1662408
2017-02-07 12:57:57 +05:30
hussainchachuliya 9b2422677e Remove deps under pep8 section to enable hacking checks
Hacking checks are not working due to the presence of
"deps = hacking" under pep8 section. This installs the
latest version of hacking library which is 0.13.0 and
it has some issues due to which custom hacking checks
are not working.

After removing it from pep8 section, the hacking
version to be used is referred from test-requirements.txt
and it installs hacking library version 0.10.2 which does
not have this issue.

Change-Id: I6ef802838c05f93b15a3a5a0359b6ea3579fa476
2017-01-13 12:36:39 +05:30
Takashi Kajinami 4d84c90055 Remove pypy from tox env list
We do not test pypy-constraints in our gate job, and do not have
any plan to use it.

This patch removes pypy from env list, to remove unused and unmanaged
setting.

Closes-bug: #1596856
Change-Id: I9c69933d8adbff8adc74fe44b88dcd724563a6d4
2016-10-19 13:45:18 +09:00
Andreas Jaeger 88cf9f4764 Cleanup tox.ini: Remove obsolete constraints
Remove old and unused constraints environments from tox.ini. Those
have never been used. Use standard environments as default list.

Note that the repo has in the past not used constraints in OpenStack
CI, this change keeps the status quo.

For more information about constraints see:
http://lists.openstack.org/pipermail/openstack-dev/2016-August/101474.html

Change-Id: I7866184672ae44bdf335ef39c657d8b7bdad8f83
2016-08-26 18:04:40 +02:00