Master has dropped py3.6 support so upper-constraints
requirements are not installable with python3.6
and due to this fips jobs which are running on py3.6
are failing. Let's run the functional/fullstack tests
with python3.8 on CentOS 8-Stream itself.
Also disable dbcounter installation as it's not
installing on python3.6.
The hacks can be cleaned up when these jobs are
switched to CentOS 9-Stream, currently have some
issues as mentioned in the Related Bug.
Depends-On: https://review.opendev.org/c/openstack/neutron-tempest-plugin/+/843989
Related-Bug: #1976323
Change-Id: I757dbf929cb1dc27027614bbb2147a61606f85a9
Since we use usedevelop=True, as a result neutron
installation happens at 'develop-inst' phase and it installs
requirements from requirements.txt without considering
tox constraints, This can lead to issue where broken
requirements are installed in docs job and as a result
it will fail.
In order to get constraints be considered for this case, add
requirements.txt to deps for docs env.
Change-Id: Ic8f6472fe708d12f8fc129729465367083e1095a
This change in the "dsvm-functional" job definition will avoid the
parallel execution of any MySQL test.
Related-Bug: #1962594
Change-Id: I4fe6a6920b9b2711563e85b51f18a9d5a9086ceb
Functional SQL tests (MySQL and PostgreSQL) use the DB installed
backend. To avoid overloading the DB engine, the test cases are
grouped [1] together and executed by the same worker process.
That will ensure those tests are not executed in parallel,
interfering each other.
All test classes ended in "MySQL" or "PostgreSQL" are now grouped.
That means the tests implemented inside the same class are
executed in the same worker, not in parallel. **HOWEVER**, that
doesn't guarantee all test cases using the same database backend
will run in the same worker serially. The FT job can still execute
test cases from different classes, using the same DB backend,
in two workers at the same time.
This patch also fixes the ``TestReservation*`` classes to inherit
from the parent classes in the correct order. That sets the
"DRIVER" value to the expected one "mysql" or "postgresql".
[1]https://review.opendev.org/c/openstack/neutron/+/785568
Closes-Bug: #1962594
Related-Bug: #1687027
Change-Id: I6bca7daf4d3e46071686bb62d5988ae314af8e7e
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>.
Change-Id: Iae53ccf077796eb0d2518b41d0e262d564e7af10
In order to mitigate the OOM problems in the CI, this patch reduces
the fullstack concurrency to 2. That should reduce the memory
consumption and will avoid those nasty OOM exceptions.
Closes-Bug: #1938455
Change-Id: I4de4b089e615353b7fde82bd54e0abefa244c8ab
Since pyroute 0.6.2, this dependency is not needed anymore. The
pyroute version is bumped both in requirements and doc/requirements.
This patch bumps the pyroute2 version to 0.6.4 (newest version
provided in upper-requirements).
Change-Id: I627e902e32fe59c6829c3bc92af19abff4b70f9a
Related-Bug: #1928913
The assertItemsEqual has been replaced with assertCountEqual
since I7c20fec08e5dc9f67b34100c925ea6724bbd25f0 .
However the hacking check has not been enabled.
This patch enables the hacking check
and replace remaining assertItemsEqual with assertCountEqual.
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Change-Id: I86202f36f1b7c0bce8b29558ad1e377c336b7258
Mitogen is dependency of the pyroute2 and was added link to it
the docs in pyroute2 0.6.1. Due to the missing mitogen in our
docs venv, docs job was failing.
So let's install mitogen as docs env requirement, at least for now
to unblock our gate.
Later we can think about better solution as e.g. adding it properly to
the requirements or report and fix the issue in the pyroute2.
Change-Id: Iba37581916842bb5fc9f42f7f483d3431747bf8d
Closes-Bug: #1928913
Functional SQL tests (MySQL and PostgreSQL) use the DB installed
backend. To avoid overloading the DB engine, the test cases are
grouped [1] together and executed by the same worker process. That
will ensure those tests are not executed in parallel, interfering
each other.
Classes that are grouped:
- TestModelsMigrationsMysql
- TestModelsMigrationsPsql
[1]https://stestr.readthedocs.io/en/latest/MANUAL.html#group-regex
Related-Bug: #1687027
Change-Id: If04e360c01cdb16e956d16357e2181db55445137
If there is too much output produced to the stdout/stderr during the
tests, stestr can hangs and job will then time out.
To avoid that in fullstack job, this patch is doing the same what
was already done for functional job as well - set PYTHONWARNINGS
variable to "ignore" to ignore all warnings and not send them to stdout.
All info really needed to debug tests is still in the tests' logs in
specific directories.
Change-Id: I080381cb8a88a27130ac21c0e27fc915e38bdedd
Fullstack job is using different tox env in the gate
(dsvm-fullstack-gate). To reduce memory usage in that job, some
time ago, in patch [1] we reduced number of test workers from 4
to 3. But it was done for "dsvm-fullstack" tox env, not for
"dsvm-fullstack-gate" thus it had no effect on our CI runs.
Now it is changed also in the CI job's tox env.
[1] https://review.opendev.org/c/openstack/neutron/+/764907
Change-Id: Iec949922be0779a00bf405c2f1d5646c588d323c
Related-Bug: #1906366
After commit 89e2fad8ef856f0e3651e4ea5784d28bc9aeb229,
pep8/bandit/bashate tox envs have different dependencies than
the default tox env. If tox envs with different dependencies share
some common envdir, tox env will be recreated every time a different
tox env is specified. (For example, "tox -e cover" after "tox -e pep8"
recreates the tox env.)
To address it, this commit introduces a new common envdir for linters
(envdir = {toxworkdir}/lint). It also moves deependencies of bashate
and bandit envs to pep8 env to ensure these three tox envs have the
same dependencies.
Cleanups are also made in test-requirements and lower-constraints.
* astroid and isort can be dropped from test-requirements.txt
as pylint has proper version cappings for astroid and isort.
(These cappings are available in pylint 2.5 and later.)
* reno is a document dependency, so it is unnecessary in test-requirements.
* reno, astroid and isort are dropped from lower-constraints
as they are not installed in lower-constraints tests.
Change-Id: Iaa3168764d050875e3d08784aee2dfba809e53be
Another item noted with the new pip resolver [1], linters dependencies
in test-requirements.txt may cause resolver issues (trying to pull in
enum34), conflicting requirements and cause them to be installed for all
test jobs. Move them to tox.ini as was done for some projects already
(this may be backported/squashed with pip resolver fix in stable
branches depending on how fixing these will go).
[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019362.html
Change-Id: I0111c41bea6a6caf5ffba1f5c34489854d9c9747
To limit usage of resources (mostly memory) in the fullstack job and
to avoid oom killer to kill e.g. mysqld service, this patch:
* Makes number of API workers changeable by tests, as a parameter to
EnvironmentDescription and defaults its value to 1. As neutron server
is spawned separately for each test and is used only to process just
few API requests during that single test so this should be still
enough there, and where more API workers are needed (like some dhcp HA
tests: TestDhcpAgentHARaceCondition) it can be changed,
* reduces number of test run workers from 4 to 3 - job will run slower
but hopefully more stable,
* in the functional and fullstack tests job definition disable etcd3
service - this will not save us a lot of memory but still it's not
needed at all so why to run it there.
Change-Id: If19803ab6db144e2d17d6805d379c1c76d8fa343
Closes-Bug: #1906366
Bump astroid test requirement to 2.4.0
Older versions trigger an error on wrapt dependency:
https://github.com/PyCQA/astroid/issues/755
Bump pylint accordingly to new astroid
Fix some new PEP8 warnings appearing with new versions, and filter out
the larget I202 "Additional newline in a group of imports" one for now
Drop psutil from functional requirements, it indicated an old version
and we have it in common requirements now
Bump a series of lower-constraints and requirements to work with new pip
resolver, testing with steps outlined at:
http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019285.html
This includes eventlet 0.22.1, previous versions triggered a hard to
track error on enum34
Cap cryptography in lower-constraints to prevent discovery failure in
relevant job (other jobs have it capped via upper-constraints)
Change-Id: Ie74ea517a403e6e2a7a4e0a245dd20e5281339e8
Closes-Bug: #1907242
The docs and releasenotes requirements migrated to doc/requirements.txt
we need not install things from requirements.txt.
Change-Id: I207be0b861c13bc6cf954b2247bb00546990bbf0
There is no real reason we should be using some of the
terms we do, they're outdated, and we're behind other
open-source projects in this respect. Let's switch to
using more inclusive terms in all possible places.
Change-Id: I99913107e803384b34cbd5ca588451b1cf64d594
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.
Also enabled the hacking check that should have caught this, it
was missing from tox.ini along with most of the other in-tree
hacking checks we have added over the years.
Change-Id: Id91175d0db8b8edc72f0dd98925ddbf7415bb881
In hacking 2.0 or later, local-check-factory was removed as it is not
compatible with flake8 3.x and it is advised to use flake8's local
plugins [1]. neutron-lib provided a factory to register common hacking
rules, but it no longer works with hacking 2, so we need to define rules
defined in neutron-lib as flake8 local check plugin [2] explicitly.
This needs to be done in each neutron related project, so it is the
downside of the migration to hacking 2.x (I explored a way to continue
to use the factory but failed to find a good way to achieve this) but
I believe it is good to migrate the newer libraries.
* flake8ext decorator in neutron/hacking/checks.py is also replaced with
hacking.core.flake8ext to avoid the copy-and-paste code.
* neutron-lib dependency is updated as neutron-lib 2.3 added hacking 3 support.
* Python modules related to coding style checks (listed in blacklist.txt in
openstack/requirements repo) are dropped from lower-constraints.txt
as they are not actually used in tests (other than pep8).
* HackingDocTestCase is now converted into normal test cases.
HackingDocTestCase depends on the internal of hacking and pycodestyle
so it looks better to use normal style of writing tests.
[1] https://docs.openstack.org/releasenotes/hacking/unreleased.html#relnotes-2-0-0
[2] https://flake8.pycqa.org/en/3.7.0/user/configuration.html#using-local-plugins
Change-Id: I92cf50a84bb587a0649a7cffee15cce4ce37d086
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: I4c60a7474da79da30122327ef3a6d8e87ccc4371
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Security groups are based on iptables in many cases and can interfere
between other tests. So it means that if some other test will manipulate
with iptables on host during SG related test is run, this SG related
test may fail without any obvious reason.
So lets try to run those test serially to be sure that no other agents
will manipulate iptables/openflow rules in same time.
Change-Id: I4d19f2a457e004306fdf40980a943073f1b8704a
Closes-Bug: #1779328
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.
This change showed we needed a newer version of debtcollector in lower
constraints, aliging with the version required by os-vif. This change
showed we needed also a newer version of cffi and keystoneauth1 in lower
constraints. Update also the requirements file for debtcollector and
keystoneauth1.
Change-Id: I5e190c3db8bed0a264b911cdf425aa4c9b51f768
In Stein the docs target started to fail when new release of
neutron-lib appeared. This is because tox installs neutron and its
requirements without any constraints. To fix this both the upper
constraints and neutron requirements needs to be added to dependencies
of docs target.
Closes-Bug: #1856156
Change-Id: Iea61238f37fdf24c0264f96d104ee0b3b6aec8e2
In some other repos you can run 'tox -e requirements' and
run the requirements checks, which is useful when adding
or changing requirements. Add it to tox.ini and fix a
python2 warning it noticed as well.
Change-Id: I8caa7f755d1276ffe581583a1ea61bb5f0473924
Since dropping py2 support and adding a basepython setting to the global
tox testenv, tox complains about a basepython mismatch when the
installed python3 is python3.6 and the py37 environment is executed (or
vice versa). Setting ignore_basepython_conflict = True will avoid this
message and enforce the correct python version to be used.
Needs a bump in the minimum tox version supported.
See also [0].
[0] https://review.opendev.org/582392
Change-Id: I3d9beeaed104dcf12cfd97590b44c4003754b4e4
Since it's no longer supported past Train, lets stop
running the tests.
Updated docs and made some pep8 code tweaks as well.
Change-Id: I1c171ab906a3b4c66558163ad26947ebf710a276
The following changes are made for PDF document.
- Sample config/policy files are skipped for PDF doc build.
We hit several problems around verbatim of inline samples
in neutron, nova and others, so we decided to skip them now.
Downloadable links also should be avoided in PDF doc
as PDF doc is expected to work alone.
- tocdepth for latex is explicitly set to 3 for better navigation
in the generated PDF. The default was 1 and we cannot provide
enough information in PDF TOC.
- The module index is disabled as the neutron document does not
generate a full module index and it shows only partial entries.
'makeindex' and 'printindex' are set to empty in latex_elements.
The existing contents (mainly the top page) are reorganized a bit
for a better TOC of the generated PDF document:
- The top page of the documentation is simplified only with toctree
to avoid almost duplicated entries in the TOC of the PDF documentation.
The current TOC for PDF doc seems to use section titles as the first
level and title of linked pages as the second level. They are almost
same and the generated TOC would be redundant.
- The link to the API reference in the top page was moved
to a subdirectory so that PDF TOC can include it.
- 'Search' section is shown in index.rst only when the builder is 'html'
as this section uses a form and makes sense only for HTML doc.
Story: 2006099
Task: 35127
Depends-On: https://review.opendev.org/664555
Change-Id: I6f1614a643efa7fad3c2a6ce5692d6873ca0ebd0
Removed E125 (continuation line does not distinguish itself
from next logical line) from the ignore list and fixed all
the indentation issues. Didn't think it was going to be
close to 100 files when I started.
Change-Id: I0a6f5efec4b7d8d3632dd9dbb43e0ab58af9dff3
This goal is to implement the process set out in the 2018-10-24 Python
Update Process TC resolution[1], for the Train cycle to ensure unit
testing is in place for all of the Tested Runtimes for Train[2].
In practice, this generally means adding unit tests for Python 3.7 and
dropping unit tests for Python 3.5.
For Neutron, which already runs py36 and py37 unit tests it generally
means switch to use the Zuul template openstack-python3-train-jobs
for Train.
Using this template will ensure that all projects that support Python3
will be tested against the agreed runtime versions, and make it easier
to update them in future.
[1]https://governance.openstack.org/tc/resolutions/20181024-python-update-process.html
[2]https://governance.openstack.org/tc/reference/runtimes/train.html
Change-Id: I41d232a10a40d97347566e189457d8044e3639db
Depends-On: https://review.opendev.org/#/c/641878/
As a part of the python 3 community goal, this converts the functional
tests to run with python3 by default, and in Zuul.
As discussed at the Stein PTG in Denver, unit and functional tests will
still run on both versions, so this adds a python2 job for functional
tests.
This patch also suppress logging levels from some external libraries
to avoid issues with subunit.parser and python 3. For details see bug
reported for Cinder [1].
[1] https://bugs.launchpad.net/cinder/+bug/1728640
Co-Authored-By: Slawek Kaplonski <skaplons@redhat.com>
Change-Id: I8958d0b5b9147ffd1ef2d1cef5dcbf79c8be5cd4
Because of known issue with stestr running on Python 3,
that too much output on stdout/stderr cause some subunit.parser
errors, we need to avoid displaying python warnings during
functional tests.
Change-Id: I1a80f62542c68fe891e445920dc89a63efef9175
This commit introduces a framework for policy-in-code support
in the neutron stadium and converts the existing policy.json
in the neutron repository into the policy-in-code style.
NOTES:
1) This commit tries not to change the existing policy behavior
provided by the neutron repository even if there are some stale policies
or policies to be defined in a neutron-related project.
They should be clean up later in Stein release.
2) 'default' policy should be dropped from the default policies
as all default policies should be defined in the code (as many projects
which already completed policy-in-code do). However, dropping 'default'
policy potentially affects policy behavior in neutron-related projects,
so it needs to be visit carefully. Considering this, this commit decides
to keep the 'default' policy.
Partially Implements: blueprint neutron-policy-in-code
Change-Id: I6a61079da4d4f5080ee32d640144e6bdb14735fa
This massively reduces the amount of time needed to install
dependencies and saves a lot of disk space to boot.
Modeled on Nova change, https://review.openstack.org/#/c/534382/
Change-Id: Icae3b6b2b0d014aec17b04b3b516b13b2fa47c5d