Commit graph

452 commits

Author SHA1 Message Date
Takashi Kajinami
e1f95eea4a Fix duplicated checks to enforce usage of assertIs(Not)None
H203 and N536 are equivalent. Use the built-in one from hacking.

Change-Id: I04a9ce41539ead71f8df0510c07ab2505ab7db3f
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2026-01-05 15:10:01 +00:00
Rodolfo Alonso Hernandez
f2d6eaa61c Bump ovsdbapp to version 2.14.1
This patch also removes the workaround needed for ovsdbapp 2.14.0
release in the functional test job.

Related-Bug: #2131994
Signed-off-by: Rodolfo Alonso Hernandez <ralonsoh@redhat.com>
Change-Id: Id895c01dd9342a28df99055b0dc2fde9b5e70b1d
2025-11-25 22:42:01 +00:00
Rodolfo Alonso Hernandez
2806f566f3 Workaround for the OVN/OVS directories in functional job
This patch is overriding the OVN_SRCDIR, OVS_SRCDIR and VTEP_SRCDIR
directories until the proper fix lands in ``ovsdbapp``. This patch
will unblock the zuul gate temporarily.

Related-Bug: #2131994
Signed-off-by: Rodolfo Alonso Hernandez <ralonsoh@redhat.com>
Change-Id: I0fc4b92a8dbaf5631470a9d74860fe76d8dd6109
2025-11-20 10:54:20 +00:00
Rodolfo Alonso Hernandez
683da89848 Missing "passenv" import in "dsvm-functional"
In [1], the "passenv" variables from the "testenv" section were
missing in "dsvm-functional".

[1]https://review.opendev.org/c/openstack/neutron/+/952258

Signed-off-by: Rodolfo Alonso Hernandez <ralonsoh@redhat.com>
Change-Id: I0cc812e0976829ea7b497782b5aec5706d5a5692
2025-11-07 11:06:21 +00:00
Zuul
9731ee32b5 Merge "The `oslo_service default backend is now THREADING`" 2025-11-04 14:53:44 +00:00
Brian Haley
34ef8ca4aa Update tox.ini for pep8
N530 was in both enable and ignore, removed from enable as
it should be ignored.

Fixed H701, H702 and H703 warnings and removed them from
ignore list so they are enforced.

TrivialFix

Change-Id: I07792b6907f551f428d9c8d3986017a4e9d2441f
Signed-off-by: Brian Haley <haleyb.dev@gmail.com>
2025-10-31 08:21:56 +00:00
Rodolfo Alonso Hernandez
322122bc8c The `oslo_service default backend is now THREADING`
Neutron no longer supports using ``EVENTLET`` backend. This option is
removed from the tox.ini file.

Signed-off-by: Rodolfo Alonso Hernandez <ralonsoh@redhat.com>
Change-Id: I924adfe34d952b6fb166e677f5211a3d0b747392
2025-10-29 22:58:13 +00:00
Rodolfo Alonso Hernandez
b9c9e63b88 Restore the N535 eventlet import check
This patch restores the N535 pylint check that prevents the Neutron
repository from using the eventlet library.

Signed-off-by: Rodolfo Alonso Hernandez <ralonsoh@redhat.com>
Change-Id: I8502122e0adc2376a451dd5963996301d99d5ba3
2025-10-29 22:57:31 +00:00
Rodolfo Alonso Hernandez
08a8a7d81e [eventlet-removal] Don't use eventlet in the unit/functional tests
More information about this patch in the document section "Eventlet
Deprecation Reference".

Signed-off-by: Rodolfo Alonso Hernandez <ralonsoh@redhat.com>
Change-Id: I5d8b828e100cfcb374ddf311da4cd7805dd26ffd
2025-10-27 09:44:22 +00:00
Zuul
1b4e20e6ae Merge "pre-commit: Use local neutron hacking checks" 2025-09-11 11:35:43 +00:00
Stephen Finucane
fad3b6f8bc pre-commit: Use local neutron hacking checks
This patch requires a new neutron-lib release (3.21.1) containing
the depends on one.

Change-Id: I880dc9e7f0d3cd578168e5c1435275901fc68f1f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-On: https://review.opendev.org/c/openstack/neutron-lib/+/956353
2025-09-09 12:33:24 +00:00
Zuul
cd3bf2f88c Merge "pep8: Return ability to run pylint only on given patches" 2025-09-09 09:46:24 +00:00
Jakub Libosvar
4b74594a29 pep8: Return ability to run pylint only on given patches
This commit [1] removed ability to run pylint only on files
that were modified by latest patches. This patch adds it back.

[1] be77ed3a81

Change-Id: Ic6cbe9c9639b976a46fb2858c10c9caf0c998bbf
Signed-off-by: Jakub Libosvar <jlibosva@redhat.com>
2025-09-08 19:31:27 +00:00
Rodolfo Alonso Hernandez
84f606a9bc [FT] Add all `TestOvnNbSync|TestOvnSbSync` classes to the regex
The ``TestOvnNbSync`` class tests are executed with concurrency 1. The
same must apply to all tests from child classes
(``TestOvnNbSyncOverTcp``, ``TestOvnNbSyncOverSsl``). This configuration
should apply to ``TestOvnSbSync`` and its derived classes
(``TestOvnSbSyncOverTcp``, ``TestOvnSbSyncOverSsl``).

Signed-off-by: Rodolfo Alonso Hernandez <ralonsoh@redhat.com>
Change-Id: Ie64827a3d5212d22eff5ce48cbbb10b28de65a41
2025-09-03 08:04:59 +00:00
Yatin Karel
1baf3b462d Revert "tox: Remove basepython and ineffective ignore_basepython_conflict"
These are needed as we need to override PYTHON3_VERSION
in FIPS job running with CentOS 9-stream.

This reverts commit b615560926.

Signed-off-by: Yatin Karel <ykarel@redhat.com>
Change-Id: Id49739b36f16a05a0ce8d702ed390c56ce392c46
2025-08-26 04:44:33 +00:00
Yatin Karel
e5fe4cc41c [hacking check] Ignore N535 check_no_eventlet_imports
We still have eventlet usage so until those get's cleared[1]
we need to ignore the hacking check.

[1] https://review.opendev.org/c/openstack/neutron/+/952258

Change-Id: I39e37445864de75df40d08a09c1ff2db5b580769
Signed-off-by: Yatin Karel <ykarel@redhat.com>
2025-08-26 10:12:30 +05:30
Zuul
ca7e479342 Merge "tox: Remove basepython and ineffective ignore_basepython_conflict" 2025-08-21 22:56:39 +00:00
Stephen Finucane
0117eb0c08 Re-enable optional hacking checks
These are not enabled by default when you enable the group with 'select'

Change-Id: Iee191fc778c014acd2d093e1f2107e11cd1e81fd
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-08-01 11:25:33 +01:00
Ivan Anfimov
b615560926 tox: Remove basepython and ineffective ignore_basepython_conflict
Change-Id: I2d64528bef5c1f348cd6a5ee08040282f546c82b
Signed-off-by: Ivan Anfimov <lazekteam@gmail.com>
2025-07-28 21:51:10 +00:00
yatinkarel
6c729befc1 [tox] Re add option to override py3 version with TOX_PYTHON
Got dropped in https://review.opendev.org/950581

Also add ignore_basepython_conflict = True to avoid:-
tox.tox_env.errors.Fail: env name py312 conflicting with
base python python3

Change-Id: I0b2e88c8cf7a532280ceaf0bdaeb240297f1270f
Signed-off-by: yatinkarel <ykarel@redhat.com>
2025-07-14 16:48:42 +05:30
Stephen Finucane
d72adaa8d6 tox: Fix indentation
Change-Id: I87110682c280ccdad940dd9420c8b37774dddd19
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-07-01 10:47:55 +01:00
Stephen Finucane
be77ed3a81 pre-commit: Migrate to ruff, enable autopep8
This allows us to replace bandit and flake8. It also ensures we run
pyupgrade-like checks continuously to prevent adding Python < 3.10 style
syntax in the future.

Long-term, we should look at replacing autopep8 with ruff, but that's a
different discussion :)

Change-Id: I12f058d95a0745d895b3257dbaa4e866835c7008
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-07-01 10:47:55 +01:00
Takashi Kajinami
fbdd642df6 Drop unused method
As described in the TODO comment, this method is not at all used.

Also loose the minimum boundary of coverage percentage, because
the limit matches the exact percentage of current tests and can be
easily broken.

Change-Id: Idd9f4ade3911b21691f220c5eafa09463689b8b3
2025-06-24 17:34:34 +09:00
yatinkarel
5c6a10003e [FT] Isolate randomly failing address scope tests
These tests randomly failing for different reasons
as described in the bug, moving these to run with
concurrency 1 will help.

Partial-Bug: #2115026
Change-Id: I21f0993356fe4d1ad518bd5b991541cc9c3fb425
2025-06-20 11:42:50 +05:30
elajkat
67ad781821 Bandit: add B311 to skiplist
Bandit 1.8.4 is more strict for random functions, see: [1],
to avoid pep8 failures due to the few random calls in Neutron,
skip B311

[1]: https://github.com/PyCQA/bandit/releases/tag/1.8.4

Change-Id: I1a2119221be57afaa94a94ecb1448196802f041b
2025-06-17 16:02:32 +02:00
Rodolfo Alonso Hernandez
94f6d69d4e Execute `test_initialize_network...` with concurrency 1
Closes-Bug: #2113861
Change-Id: I635480cb087a75c8a4f2dbb30960b8aff8cf8b14
2025-06-10 07:55:25 +00:00
Stephen Finucane
f4dafbeef6 Move mypy configuration to pyproject.toml
Change-Id: I5938f47c5941bdbe57f2219a78153d5431e93eb7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-21 18:14:13 +01:00
Brian Haley
27a98b5c62 pyupgrade changes for Python3.10+
As discussed at the Flamingo PTG meeting, run an automated
upgrade tool to make code python 3.10+ compliant.

Result of running:

$ pyupgrade --py310-plus $(git ls-files | grep ".py$")

Fixed PEP8 errors introduced by pyupgrade by running:

$ autopep8 --select=E127,E128,E501 --max-line-length 79 -r \
--in-place neutron

Also did manual updates as necessary to fix other errors
and warnings after above commands.

Bumped versions of checkers - pylint, bandit and mypy to
more recent versions, which required disabling a new
warning, too-many-positional-arguments.

Change-Id: Ic6908af2c331e3ea6c50f1a8a8e261db41572645
2025-05-21 17:11:13 +01:00
yatinkarel
750ff49f6b [OVN] Isolate test_ovn_client* Functional Tests
This solution is similar to what was implemented in [1].

[1] https://review.opendev.org/q/topic:%22bug/2088423%22

Related-Bug: #2088423
Change-Id: I960a734f364959c391ecbd6b630f997de4ce49ff
2025-04-10 10:16:23 +05:30
Rodolfo Alonso Hernandez
e86951ef49 [OVN] Isolate `test_ovsdb_monitor.TestNBDbMonitor*` FTs
This patch moves the following test classes to the 1 worker execution:
* TestNBDbMonitor
* TestNBDbMonitorOverTcp
* TestNBDbMonitorOverSsl

Related-Bug: #2088423
Change-Id: I138eb78683aa1cbc565533e2ef011f1946f9bc58
2025-03-18 11:03:08 +00:00
Rodolfo Alonso Hernandez
8152b83384 [OVN] Isolate `test_maintenance.Test*Maintenance` FTs
Related-Bug: #2088423
Change-Id: I07e57f765c4eb6b1feef2571f4bf2f049297a029
2025-02-19 12:07:18 +00:00
Zuul
5d867444fb Merge "Enable mypy pre-commit hook" 2025-01-30 00:19:47 +00:00
Zuul
7031da2cc2 Merge "Bump mypy to 1.14.1 (the latest)" 2025-01-21 23:44:52 +00:00
yatinkarel
3dfaa1dbbc [Functional job] Switch test order to avoid memory issue
Until we handle the keepalived-state-change script properly
let's workaround the issue with some CI node to run the
problematic test in the end.

Related-Bug: #2091855
Change-Id: I51c8df10d4efe2da0a66a18c0262cb1dbfb1eb9e
2025-01-20 21:07:09 +05:30
Ihar Hrachyshka
434ef3018e Enable mypy pre-commit hook
Change-Id: I266a2866627fcf66d0f5111c9237a37e55414685
2025-01-09 18:10:18 -05:00
Ihar Hrachyshka
9127c121da Bump mypy to 1.14.1 (the latest)
Change-Id: I5fdb45daf480646d56772a76d03ee36c0c0f46df
2025-01-09 18:09:36 -05:00
Rodolfo Alonso Hernandez
73720da72f [OVN] Isolate test_ovn_db_sync.TestOvnNbSync.* FTs
Related-Bug: #2088423
Change-Id: Ia0309e9129df992498820b239d8a145c1400aa6a
2024-12-20 13:05:58 +01:00
yatinkarel
a475aefdcb [functional][CI] split tests in more runs
With some CI nodes which runs with 4 CPU we seeing
random failures in functional jobs as some processes
getting oom-killed.
With this patch splitting tests in more runs so
memory not remain utilized till completion of all the tests.

Related-Bug: #2091855
Change-Id: I01bd8eb72aa5545b072bccec4a75f6062529b1c5
2024-12-16 15:20:52 +05:30
Zuul
ea02089974 Merge "Drop duplicate hacking check" 2024-11-28 11:18:34 +00:00
Takashi Kajinami
3a0f7bcb97 Drop duplicate hacking check
Usage of assertTrue(isinstance(a, b)) is already checked by
the built-in H211 check which is enabled by default.

Change-Id: Ib72a4055212d125718bb5a096fb602ddb2878406
2024-11-27 11:32:09 +09:00
Ihar Hrachyshka
315ca9db17 functional: Allow to override OS_FAIL_ON_MISSING_DEPS
This is useful when we'd like to run a `dsvm-` target but e.g. not fail
on particular dependencies missing, e.g. db backend.

Change-Id: I978435f8ccad5bfff87f47a2e2f65a9b6867b246
2024-11-14 21:40:32 -05:00
Zuul
9e75d2a4a5 Merge "refactor: Move hacking dependency from tox.ini to test-reqs" 2024-11-12 16:18:44 +00:00
Zuul
fa0f857010 Merge "mypy: enable for all non-test modules" 2024-11-12 03:01:10 +00:00
Ihar Hrachyshka
82a57ef980 refactor: Move hacking dependency from tox.ini to test-reqs
This dependency was moved from test-requirements.txt to tox.ini[deps] a
long time ago: I0111c41bea6a6caf5ffba1f5c34489854d9c9747 due to some pip
resolver issues related to lower-constraints.txt

Since then, a lot has changed and this probably doesn't apply anymore
(other projects like nova already keep the dependency in
test-requirements.txt).

We actually import hacking from neutron.tests.unit (because we have
custom rules), so it makes more sense to keep the dependency with the
rest of requirements.

Change-Id: I02ad072fb2982f6968db987cb822efdc1b6f10ba
2024-11-11 18:02:57 -05:00
Zuul
28b2e819e3 Merge "Fix dependencies for mypy tox target" 2024-11-08 17:28:22 +00:00
Ihar Hrachyshka
3f29ba5cdf mypy: enable for all non-test modules
The patch also bumps mypy to the latest release on pypi. It fixes one
discrepancy in error reporting between different basepython versions.

Change-Id: I359e82463911821568be7939f9c08209401d0d08
2024-11-07 17:00:32 -05:00
Ihar Hrachyshka
51a823ae2c Fix dependencies for mypy tox target
Ia70f471c0f66679c44c4d3684c9e46c00993f3b3 incorrectly removed mypy
dependency from the target, which broke `tox -e mypy`. This change
makes sure the target uses all dependencies from pep8 target (which also
now includes the mypy dependency).

Change-Id: I3ccef4183fd3020e51af195fab5d3949b7611151
2024-11-07 13:35:58 -05:00
Zuul
57b059e36b Merge "Remove postgresql code" 2024-11-07 04:56:39 +00:00
Ihar Hrachyshka
919b4f6d68 gate: squash mypy into pep8 job
You can still run just mypy checks locally with `tox -e mypy`.

Change-Id: Ia70f471c0f66679c44c4d3684c9e46c00993f3b3
2024-11-05 18:00:56 -05:00
Ihar Hrachyshka
16e4f0af89 Remove postgresql code
Change-Id: I9cbe3316effc7c31ee478aeab180382709de4981
2024-11-05 17:12:22 -05:00