Commit Graph

120 Commits

Author SHA1 Message Date
Riccardo Pittau bd08bf4f85 Force constraints when installing a package during tox test
The tox deps option grants installation of single dependencies and
requirements, optionally pinned using constraints, before installing
a package, therefore not granting installation of the correct
constraint during the package installation.
To fix that tox 4.4.0 has introduced the constrain_package_deps
option [1]

[1] https://tox.wiki/en/4.12.1/faq.html#using-constraint-files

Change-Id: Ied659411bffb3f37e67523bc50a6a03b19cceef6
2024-02-12 14:57:43 +01:00
Zuul ac019a064c Merge "Bump hacking to 6.1.0" 2024-01-31 02:13:15 +00:00
Takashi Kajinami c448b7c63f Bump hacking to 6.1.0
... which is the latest version available now.

Change-Id: I0953eac69ca3c68cdb68c527485cc3de60325220
2024-01-29 18:26:41 +09:00
Sharpz7 fd0d8171b7 [codespell] Adding Tox Target for Codespell
Second in a series of commits to add Codespell to Ironic Repos. This one adds the command that was used to fix the spelling errors.

Future Commits will add CI support and potentially a git-blame-ignore-revs file if their are lots of spelling mistakes that could clutter git blame.

Change-Id: I2e356fb4dea543d6e57614394d439a6767498f8d
2024-01-25 21:22:18 +00:00
likui 13a0d9374f tox: Remove basepython
Python 2 is EOL. No environment should be defaulting to it. Our CI
environments certainly aren't.

Change-Id: I7c5d73f8499a6eec3cae2a6254e6a26a64a9de9b
2023-08-02 16:58:22 +08:00
Zuul 418aa6b1f5 Merge "Upgrade to latest hacking - v6" 2023-04-25 14:37:29 +00:00
Jay Faulkner c3dd0f18ac Upgrade to latest hacking - v6
No code changes needed to work with latest flake8.

Change-Id: I5a45f31590534685016a4fdb78f3ea2b954150f1
2023-04-21 12:20:25 -07:00
Dmitry Tantsur 20797f0a82 Stop gating on unit test coverage
It's nice to keep coverage high, but with little active development
it starts merely hindering refactorings, causing us to gradually lower
the expected minimum anyway.

Change-Id: I4bec5dbb224c59048c24cf2189a80014d63bfa36
2023-01-26 16:17:42 +01:00
Zuul a273c6fd07 Merge "setup.py: Remove 'py_modules'" 2023-01-11 19:27:52 +00:00
Stephen Finucane f853061fe4 setup.py: Remove 'py_modules'
This was merely obscuring a bug in pbr. setuptools doesn't do the
auto-discovery when pbr is in use. Remove it.

Also fixes the environments list where it is now validated for what is
installed by removing functional-py38, and fixing the job to just be
"functional".

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-on: https://review.opendev.org/c/openstack/pbr/+/869082
Change-Id: Ife999840777f3c553f569d81cd826ef9d5a6765d
2023-01-11 08:22:52 -08:00
Zuul c0f9602227 Merge "SQLAlchemy 2.0 Support" 2023-01-04 17:54:05 +00:00
Riccardo Pittau 0f5bbf68d6 Fix tox4 and setuptools errors
- Remove skipsdist that it was never supported and causes breakage
when used with usedevelop.
- disable setuptools autodiscovery

Change-Id: Icd107c69be1685af9eddf9cc9fe2236d5eb57c5a
2022-12-28 15:42:45 +01:00
Anton Arefiev 3fe42b53fd SQLAlchemy 2.0 Support
Primarily remove the workaround added in
Ia6d512ff2ae417bab938cb095fbb0884d195010a which added
continued use of autocommit, which is incompatible with
SQLAlchemy 2.0.

Also set the environment for unit tests to report compatability
warnings, although it appears none are being reported at this time.

Also cuts out the db upgrade cruft to only use the online database
migration code through oslo_db's enginefacade, which has the smarts
to handle online or offline migrations.

And then, retools unit/functional test data storage to utlize sqlite,
and in that re-tooled the queries to prevent locking conditions
which could exist with queries, and some additional refactoring/cleanup.

Also, don't mock and test time.sleep().

Additionally, it looks like we have discovered the root cause of the
memory/connection leakage issue which has been observed, due to the
way lists of nodes are processed/returned.

This change was based upon the work in
I506da42a9891a245831f325e34bec92e0a3f33f0 which is included in
this commit as the entire database structure and interaction
has been modified for ironic-inspector.

Co-Authored-By: aarefiev <aarefiev@mirantis.com>
Story: 2009727
Task: 44132
Change-Id: Ic88eb9dec5fddc924a72d9a23c17a304954ebf46
2022-12-15 09:28:55 -08:00
Riccardo Pittau be40022295 Update tox.ini for tox 4
Update tox.ini to be compatible with tox 4
It should also be retrocompatible with tox 3

Change-Id: I3625c77ddc28f6bb7f310be215ca347076762d90
2022-12-13 17:49:51 +01:00
Riccardo Pittau 6513d3db37 Fix CI
Sync with ironic configuration to fix grenade job
Drop lower-constraints.txt and its testing (was [1])
Fix ironic-inspector-tempest-managed-non-standalone sine we're here

[1] https://review.opendev.org/c/openstack/ironic-inspector/+/840075

Change-Id: I9b08c6e61c39a0e5616e51256f76a19dc5fd00c0
2022-05-09 09:31:55 +02:00
Riccardo Pittau 9cfd98e577 Increase version of hacking and pycodestyle
Fix errors in unit tests

Change-Id: Ibc8648b64887daac6fb5ec8a6dd61d9312a52ef3
2021-07-29 11:19:36 +02:00
likui b912248f09 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: I143ef78dec2ffff6b1c309036d50533591c20171
2021-06-03 16:53:55 +08:00
Riccardo Pittau e670c24ea2 Update minversion of tox
The minimum version since when tox accepts having inline comments
in deps is 3.9.0

https://tox.readthedocs.io/en/latest/changelog.html#v3-9-0-2019-04-17

Change-Id: I2a42de56b0d1c48604f026d27c1d262181cfe29b
2021-01-22 08:56:21 +01:00
Riccardo Pittau fb5955bcce Update version of doc8
The doc8 lib supports Python 3.6 starting from version 0.8.1

Change-Id: I1acd3f12acbaf413e0752155c1e78e84824034af
2021-01-05 09:00:42 +01:00
Dmitry Tantsur 8d52a7789a Avoid a full install in tox environments that do not need it
Usage of usedevelop=True results in all requirements.txt dependencies
always installed (without constraints) even when requirements.txt
is not explicitly added. Override usedevelop for these environments.

Add requirements.txt to the 'docs' environment since it imports
the whole ironic in the process.

Create a separate doc/requirements.txt.

Change-Id: I352f21772ccd68b35806f46851f254edb7c24c60
2020-12-14 14:18:46 +01:00
Riccardo Pittau caf9256b22 Fix lower-constraints with the new pip resolver
Remove pep8 dependencies from test-requirements, they're not
needed there and are hard to constraint properly.

Change lower-constraints to make pip happy and not require infinite
time to calculate dependencies.

Change-Id: Id524ad2bd2994fefadd6a3ad728123a0a1a49dc8
2020-12-10 06:04:30 -08:00
likui 4ce61af741 Reuse the docs deps to benefit from constraints
Tox 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: Ic2a8a264e95ecd70902329fc5de3839625845129
2020-11-18 09:59:35 +08:00
Vladyslav Drok d77ce5cabd Remove unicode quotes from tox.ini
On some locales and some versions of python these quotes might not
decode properly, causing tox to fail to run pep8 environment, so
let's change them to the usual ASCII ones.

Change-Id: Ib60844aa222c65c7862adf817c5cb73e1d1cf5f4
2020-11-04 17:08:24 +01:00
likui ca47af38d0 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: I62f320a0406c0ed8b025e889da0c928f48ef0545
2020-11-03 13:17:06 +08:00
likui 8e9adf1293 use py38 for functional tests
we should test py38 by default.

[1] https://governance.openstack.org/tc/reference/runtimes/wallaby.html

Change-Id: Ib10a065105a740450e2c486a88b773b803847bd7
2020-10-15 18:14:30 +08:00
Dmitry Tantsur a5e8cce1af CI: run doc8 on api-ref
Change-Id: I000ffe5915a1c74b0e4eeb93ceeb4aee429a1901
2020-07-28 12:45:47 +02:00
Riccardo Pittau 32d68ef53b Set min version of tox to 3.2.1
As recommended, since version 3.2.0 tox switches pip invocations
to use the module -m pip instead of direct invocation.
We set min version to 3.2.1 [1] to also fix the behavior of
--parallel--safe-build

[1] https://tox.readthedocs.io/en/latest/changelog.html#v3-2-1-2018-08-10

Change-Id: I64afec683ca3ac0e750ce30d689441d3517671b5
2020-07-15 15:26:06 +02:00
Iury Gregory Melo Ferreira b9f1746643 Stop configuring install_command in tox.
Currently, we are overriding 'install_command' to use 'pip'. This is
considered poor behavior and 'python -m pip' should be used instead:

https://snarky.ca/why-you-should-use-python-m-pip/

It turns out that this is the the default value provided by tox:

https://tox.readthedocs.io/en/latest/config.html#conf-install_command

So we can remove the line and simply use the default value.

openstack-discuss thread
http://lists.openstack.org/pipermail/openstack-discuss/2020-April/014237.html

Bumping requirements and l-c with:
keystoneauth1 3.18.0
alembic 0.9.6
pika 0.10.0 (necessary for installation)
Change-Id: I849342bd077ab2f8bbda4e0a228c308eb7a4908b
2020-05-14 14:56:26 +02:00
Dmitry Tantsur cee5922674 Hacking: enforce usage of autospec=True in tests
Using autospec ensures that mocked functions are called with correct
arguments, so it's highly desired to have it.

Change-Id: I9c8395adf852495d2ef6db732d727990e8abd5d7
2020-04-28 12:27:41 +02:00
Andreas Jaeger 1a8c1bb370 Cleanup py27 support
This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
  know about the requirement
- Remove obsolete sections from setup.cfg
- Update classifiers
- Update requirements, no need for python_version anymore
- Switch to using sphinx-build with apidoc extension
- Use newer openstackdocstheme version
- Remove Babel requirement, this is not needed.

Change-Id: I4176d8002d45449171aa5f7a7caef196ab7900d0
2020-04-20 08:18:51 +02:00
Riccardo Pittau 4eefb42550 Finalize ironicclient removal
Completely remove dependency from ironicclient in favor of
openstacksdk.

Change-Id: I9b98ddb05fe867a0d3884f736a2edd7b4d61b00c
2020-03-25 10:08:38 +01:00
Zuul af43de3b23 Merge "Enforce running tox with correct python version based on env" 2019-12-26 15:32:06 +00:00
Madhuri Kumari 51e791e954 Add librsvg2* to bindep and bindep env
76cbd2dbbb added the docs
build requirement on sphinxcontrib-svg2pdfconverter which
needs the native rsvg-convert command. This change adds
the native package that provides that command to bindep.txt.
Also adds bindep env in tox.ini.

Change-Id: I72aa8695c058989b4a1aa62cbb5d5fda2ce348ad
2019-12-24 13:03:35 +05:30
Riccardo Pittau 917d2e44eb Enforce running tox with correct python version based on env
Since removing support for Python 2, we changed the basepython
value to 3.
This means that all the tox tests run with the default python
version available in the system.
This is not quite correct when running on environment such as
py36, py37 or py38, since they imply running with different
Python versions based on the environment.
To enforce the correct version we need to add the option
ignore_basepython_conflict available since tox 3.1.0 [0].

[0] https://tox.readthedocs.io/en/latest/config.html#conf-ignore_basepython_conflict

Change-Id: Ia14bc6397a88f200277abc5485cab02eb3724e1b
2019-12-20 16:24:13 +01:00
Kaifeng Wang 0e3cd671da Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

ironic-inspector 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://review.opendev.org/#/c/691178/

Change-Id: Ifae00adf782b6a7d71c4dc45a69a9638b8514d30
2019-11-22 11:17:34 +08:00
Kaifeng Wang 76cbd2dbbb Build pdf doc
The is one of community goals that each project could produce a
single PDF file. The pdf should be in the output of openstack-tox-docs
job.

TeX packages are required to build PDF locally, following is recommended:

* inkscape
* texlive-latex-base
* texlive-latex-extra
* texlive-fonts-recommended

More about the goal:
https://governance.openstack.org/tc/goals/train/pdf-doc-generation.html
https://etherpad.openstack.org/p/train-pdf-support-goal
https://etherpad.openstack.org/p/pdf-goal-train-common-problems

Change-Id: I784be3f2462184ce951cb27e68e578f8befaa580
2019-09-06 15:58:06 +08:00
Dmitry Tantsur 4f578169c7 Allow running a specific functional test via CLI
Change-Id: I5897d8121b7cc992d64f948f73f1f846615f6e46
2019-07-18 14:25:41 +02:00
Kaifeng Wang f979456c16 testenv does not install requirements
Fix testenv which only installs test-requirement, also updated
upper constraint url.

mock minimum version is bumped to 3.0.0,
keystonemiddleware minimum version is bumped to 4.18.0.

Change-Id: I162bcf372598c2268c9c5e30947e49eedb0147e3
2019-07-16 10:38:14 +08:00
Kaifeng Wang 30a4e0981f Adds bandit template and exclude some of tests
Adds bandit configuration template and exclude some of
tests that we don't want to fix for the moment.

Keeping job unvoted so that we can keep an eye on possible
issues while not breaking gate.

Change-Id: Icc055980c13696b29c512edf8c48abba924aa244
Story: 2005791
Task: 33563
2019-06-20 14:35:43 +08:00
Kaifeng Wang 52349c6c0a Incorporate bandit support in CI
Change-Id: I1beded7e0198a5b5b43df00a355cf1c59cf2dc27
Story: 2005791
Task: 33563
2019-06-05 08:44:38 +08:00
Riccardo Pittau ba545df90a Removing python 3.5 testing in favor of 3.6
This patch removes the python 3.5 tests in favor of python 3.6
tests.

Change-Id: I455782a1c1ae5ca351aa90a4f67e4a0525a43e36
2019-02-22 11:49:52 +01:00
Zuul 054f300290 Merge "Add API reference" 2018-10-22 20:31:33 +00:00
Anton Arefiev 05a86b3d57 Add API reference
Add initial API reference, which covers all inspector endpoits.

The conf.py and the tox environment are stolen from ironic.

Co-Authored-By: Kaifeng Wang <kaifeng.w@gmail.com>
Change-Id: I5009e8708dcad8ab25380f7bf574125d6e758ef5
2018-10-16 16:50:01 +08:00
Kaifeng Wang 8ab225e47a Rearrange conf and policy configuration file
Minor project file structure adjustment, to move config-generator.conf
and policy-generator.conf into tools/ subdirectory.

Also exclude tools/ from dsvm jobs.

Change-Id: I3242401511b88bd9b677d9875481808783f890b8
2018-10-16 16:16:29 +08:00
Kaifeng Wang 292c168d9e Follow up to pycodestyle fix
During pycodestyle fix [0], the max code complexity is temporarily
increased to 18.

This patch is a follow up to restore previous complexity (value 15),
and refactor code causing C901.

[0] https://review.openstack.org/#/c/567066

Story: #2001985
Task: #19604

Change-Id: Id64c31c449761024504284dcadd2b6c9f4a97f00
2018-08-03 16:53:44 +08:00
Zuul 7991f12e17 Merge "Switch to using stestr" 2018-07-16 14:49:41 +00:00
Chuck Short cce25ed22e 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.

Also adjust requirements to pass the gate.

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

Change-Id: I79b2220c20a04e2e33360bc330b5b4b4124caf71
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-07-14 07:49:50 -04:00
huang.zhiping 0feeaf1f9b 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: Ic87686868f784f0e1b514d6b899cc16240d88d61
2018-06-09 11:47:48 +00:00
Harald Jensås 868965c340 Fix pycodestyle warnings/errors now visible with hacking 1.1.0
This fixes the warning/errors except for the C901 Function is
too complex in the ironic_inspector/rules.py's create method.

Bump's max-complexity to 18 in tox.ini to workaround the C901.

Story: 2001985
Task: 19604
Change-Id: I6c76a43353b1beb572dbde78dba4b4a839d45ea7
2018-05-08 23:46:05 +02:00
Doug Hellmann 5113ef51c5 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: I8a5c47cb8e4d623776cd4335754184f6f7f0d398
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-22 13:44:49 -04:00