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
Running tox targets on python3 write out a lot of DeprecationWarning,
the idea to hide them comes from this patch:
https://review.openstack.org/611884 from Stephen Finucane.
Change-Id: Id002ced641bba9833a633b331a3aa82ff0252f47
In the Neutron CI meeting on 2018-10-02 [1] we decided on the proper
approach for fullstack testing of Neutron in Zuul. The approach is:
1. There should be only one fullstack CI job, named "neutron-fullstack"
2. The neutron-fullstack job should invoke python3 in tox.ini
This change implements the agreed-upon approach.
Switching the nodeset to newer OS will be handled in a separate step
[1] http://eavesdrop.openstack.org/meetings/neutron_ci/2018/neutron_ci.2018-10-02-16.00.html
Co-Authored-By: Nate Johnston <nate.johnston@redhat.com>
Change-Id: I37c1cb42b3a94532e7b7fea21a929a39fe63f00b
This is a mechanically generated patch to add a unit test job running
under Python 3.6 as part of the python3-first goal.
See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html
Change-Id: I08e6b9fb4223569c3db04b54137d9092062c22ea
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: I9530cd2433e0e34f05667d33bd6469b2592f8738
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Plugin B111 "Test for the use of rootwrap running as root"
was removed from bandit in [1].
Blacklist call of hashlib.sha1 was blacklisted in bandit
with [2] and it is now added to list of skipped tests in
Neutron.
This commit adds also plugin B604 to list of skipped plugins.
[1] d93eed5492
[2] 35e35446b0
Change-Id: I33d6089b497fccfca4b212e2a62fb881cae9cb94
This incorporates flake8 2.6.x and pycodestyle will be used
instead of older pep8. This ensures future python3 compatibility
and a bit better code styling.
Change-Id: Ia7c7c5a44727f615a151e1e68dd94c7ed42f974f
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: Id3804896efc11de24d5e13500cdce7571e6d3314
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
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: If3383707c9baf69e03bcccc50970da748a834141
Fixed all pep8 E265 errors and changed tox.ini to no longer
ignore them. Also removed an N536 comment missed from a
previous change.
Change-Id: Ie6db8406c3b884c95b2a54a7598ea83476b8dba1
Debugging unit tests locally with pdb ends in failure with tox.
this patch adds debug environment to debug tests with pdb
break points by following below steps.
1. set break point in code by adding import pdb;pdb.set_trace
2. run tox -e debug test_regex
Change-Id: I088a558a1fb68b3bc2a218ccda0911ed1389f91f
The openstack-tox-lower-constraints job is timing out
a lot at the 40 minute mark, increase to 60 minutes
to try and stabilize it.
Change-Id: I5becda7dd3d2a2ff4883fc4265eb35882173b1c0
This patch is a fix for the issue B108: hardcoded_tmp_directory
found by bandit scanner.
The main reasoning for that is the need for safely creating
a temporary file or directory.
Change-Id: I4277e9196b9b707b83bb298faeccb59f07d6f10b
Related-Bug: #1759250
Fix E402 (module level import not at top of file) pep8 errors
and no longer ignore new failures.
Trivialfix
Change-Id: If9a202f1f322b5b03966c692e33e94b7c872079b
Fix W503 (line break before binary operator) pep8 warnings
and no longer ignore new failures.
Trivialfix
Change-Id: I7539f3b7187f2ad40681781f74b6e05a01bac474
Recent pep8 upgrade and corresponding pycodestyle update break
pep8 job due to the new rules.
This commit fixes the following new errors:
- E266 too many leading '#' for block comment
- E501 line too long
- H903 Windows style line endings not allowed in code
The following errors are added to the ignore list
as there are many errors:
- E402 module level import not at top of file
- E731 do not assign a lambda expression, use a def
- W503 line break before binary operator
Change-Id: I1fd3357479bb2ba3d89de92739ffac99900761b6
This patch is a fix for the issue B101 assert_used found by bandit
scanner:
https://docs.openstack.org/bandit/latest/plugins/b101_assert_used.html
As assert functionality could be turned off by the -O option for python
interpreter, assert statements were replaced to raise AssertionError.
The main reasoning for that is rest code after assert could be not
ready for values that assert filters.
Change-Id: I92a871b1b496c96c0c76cb37e4dda51bfc007e38
Related-Bug: #1759250
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: I78f0beea8f78aa635b59bc80c97fec41412049e0
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
In order to deal with neutron going into the upper-constraints file so
that neutron plugins can consume it normally, we need to align the
constraints invocation in neutron's tox.ini. This means putting the -C
argument into the dependencies list rather than the pip install line so
that it doesn't get appended to tox installing neutron itself.
Needed-By: https://review.openstack.org/550475
Change-Id: I014177c8afcadd3e6acb20bd38bb9d9fcc778ed6
This patch enable extensions:
-[H204] Use assert(Not)Equal to check for equality.
-[H205] Use assert(Greater|Less)(Equal) for comparison.
Change-Id: I9ad51e006561251030b5a6759c930b87ff94a861
By default there is as many test workers running fullstack
tests as cores on host.
On gate tests it is 8 cores so 8 test workers.
Each such workers spawns own neutron-server and agents.
That cause quite big load on such test node. From my tests
it looks that it can be up to 25.
By lowering number of test workers to 4 I observed that
load is at max about 10.
Overall time of tests is longer for about 10-15 minutes
(about 45-50 minutes with 8 workers and about 60-65 minutes
with 4 workers).
Change-Id: I58cb2ade598e8dc2377e6187483cb39881a9dc3c
This patch updates our doc conf.py to support the linkcheck builder in
addition to adding a new 'linkcheck' target in tox to run the builder.
Also the release checklist is updated suggesting the linkcheck tox
target be run prior to a release.
Change-Id: Ia7c282b7331f0b624bb3324f27dfec223cf414f7
Closes-Bug: #1716005
the OS_TEST_TIMEOUT of 180 is too short for
some test servers. Allow it to be modified from the
outside via environment. Currently I have to sed the tox.ini
file to fix this.
Change-Id: Ib0e9aa0fff4cd26be115cc4b12036e9ee5e737f3
Since Pike log messages should not be translated.
This patch removes calls to i18n _LC, _LI, _LE, _LW from
logging logic throughout the code. Translators definition
from neutron._i18n is removed as well.
This patch also removes log translation verification from
ignore directive in tox.ini.
Change-Id: If9aa76fcf121c0e61a7c08088006c5873faee56e
This helps catch a number of potential issues with the neutron
code in advance. A false positive can be skipped with #nosec
at the offending line, just like #noqa can be added on
offending module imports.
Change-Id: I3e4cbc94539dd2cce61bfa5cd0265e75d7336311