Once a new neutron-lib release will be cut off, the new hacking check
will break the pep8 target because the code still uses translation
markers for log messages.
Instead of fixing all remaining log messages and hoping no new messages
land before neutron-lib release, we temporarily disable the check; we
will reenable it back once we have a neutron-lib release in gate that we
can validate the patch removing translation markers against.
Change-Id: Icef59a03184473476e0657334bcc30dc7bf4f9ff
This allows us to kill a bunch of in-tree checks. There are still some
checks that are either not yet in the library, or don't belong there in
the first place, so we still stick to our own factory, just reusing
whatever is there in neutron-lib.
This change skips some new checks. We gotta figure out what to do with
those, that will belong in a separate follow-up.
Change-Id: Ifeb40ec0e0c4ca623b33a6b9f500dec15cec4de0
Three ((value++)) lines are generating this bashate warning:
E043: Arithmetic compound has inconsistent return semantics
This will now be an error when running pep8 checks.
Trivialfix
Change-Id: If7a63e550d5d27fe6716cc63c85426cd2250732f
The current implementation of the coverage code job gate only fails
when the report is not created. This change pretends to set a
minimum reasonable percentage of code coverage(82%).
Change-Id: Ia30116fff8b834486bde93c329543fce15be429f
Bashate is a style checker program for bash scripts. This addition
improves the quality of the current bash scripts and ensures that
any future change will follow the same standards.
Change-Id: Ia346f77632d4ac7beb288fa3aacea221d7969c87
This may become handy when debugging gate failures like job or test case
or ovsdb timeouts, to see the load of the machine, as well as to
understand whether the machine was e.g. locked by its hypervisor during
test run.
Instead of using devstack as a library, we just enable the service in
local.conf [[localrc]], and then call ./stack.sh.
Now that we install some pypi packages into the system, and since
functional targets were using those system packages, post_gate_hook.sh
broke failing to locate subunit-2to1 script in the tox env directory. To
fix that, we disable sitepackages= for all functional tox targets. This
was enabled back in the times when we attempted to install neutron for
the functional job using devstack [1], and we no longer do it, so it
should be ok to stick to all packages from the tox venv.
[1] Icc38cacd69bc5843ccfcc60237a7102df6d8597f
Change-Id: I73857f63f512e26d595c61a20ec5bf22d2fb0da7
The gating on python 3.4 is restricted to <= Mitaka. There is no
need to continue to keep these settings.
From Newton onwards we are gating on python 3.5.
Change-Id: Ib6e6c62212796f493bb99fb3c5e39ab4f2e45cfc
The release includes its own check for delayed string interpolation for
log messages, so we can now remove our own check for the same thing. The
check is off-by-default, so we need to explicitly enable it. Sadly,
select= directive in tox.ini is broken [1] so we need to enable the
check with flake8 argument instead.
[1] https://github.com/PyCQA/pycodestyle/issues/390
Change-Id: Idc6b8e5b1cb594e130d4cc0cbcfffd362f9ab86a
This allows to avoid installing unneeded packages when in gate, saving
some time when preparing environment for unit and other non-dsvm tests.
Change-Id: I09aa9c7ebebf12d0c0cce7457fef57f8451fcffa
This tools list the constants and exceptions that have moved
to neutron-lib. Add it to pep8 to raise awareness of moved
globals.
Related Blueprint: neutron-lib
Change-Id: Ic6439f98d4bf8f566debf26eca3337f359119d5a
Many deprecations are triggered early (on imports, for example)
before the warnings are enabled by the WarningsFixture in the
base test class.
To make sure all DeprecationWarning messages are emitted we enable
them via the PYTHONWARNINGS environment variable.
Change-Id: I93d9447b5f26ba474d4c283a3df49cf4461c715d
NOTE: All subprojects should do this too.
The tox.ini has some unicode characters that cannot be
decoded, so just executing tox will immediately cause an error
because the tox.ini cannot be parsed.
Closes-Bug: #1600068
Change-Id: Ia01ae80d9321584845bb06c3f6673d13027bd2db
There is a bug in pep8, when 'select' used, it omits all default checks
and runs only those specified by 'select'. We got hit by this issue
since I2d26534230ffe5d01aa0aab6ec902f81cfba774d was merged which lead to
almost no static checks in pep8 job.
Also note that off_by_default decorator has no effect for now because
factory in hacking is triggered after ignored checks are collected.
There will be a follow-up patch for that in order to make pep8 doing
its job quickly.
[1] https://github.com/PyCQA/pycodestyle/issues/390
Related-Bug: 1594756
Change-Id: I8e27f40908e1bb4307cc7c893169a9d99f3433c4
Commit 56efc8ac76415070041d125a6e30523caf9b3cbd and
commit 7ddfffb0fc37f4fd04937b11ac03b95aeed1306c removed olso incubator.
So we can remove this from the files that are skipped as they no
longer exist.
TrivialFix
Change-Id: If88988edac2ae2829a8f5827f855812db56ba63e
unittest2 contains bug fixes to unittest for all versions of Python<3.5.
Move unittest references to unittest2.
Bumped hacking requirement to reflect the version in
openstack/requirements that is the minimal version that supports
off_by_default checks.
Change-Id: I2d26534230ffe5d01aa0aab6ec902f81cfba774d
Depends-On: I883223962426ed8e9cdf4e304dfed17ef0946c8a
Log files as .txt files, don't zip them, and put them where
they need to be instead of copy them there in the post gate
hook. The benefit to doing this is that we'll get logs
for tests even if the job timed out.
Change-Id: I4bfd27534c827aed3cbd7b43d7d1289480ea4806
Related-Bug: #1567668
Now that we stopped copying tempest code into our tree, it's fair to
enable the pep8 checks for the subtree.
Change-Id: Ie23b4db2d4d0e3e75e8fdf4af3bf0a430069928e
Since adoption of the Tempest plugin framework, this
extra plumbing is no longer necessary in tree.
Related-bug: 1555356
Depends-on: If5f7ea82c45494953452f728fabb7403d0b6e14e
Change-Id: I5377f33c5a7b29f97f00878e048d154378a4fe34
Make use of the Tempest plugin interface instead of copying Neutron
files into Tempest. This will remove the burden to port Neutron
tests onto Tempest master recurrently.
It uses neutron/tests/tempest/ as new top folder for all Tempest
tests. It follows the model of Heat [1].
[1]: https://github.com/openstack/heat/tree/master/heat_integrationtests
Partially implements bp external-plugin-interface
Change-Id: Ia233aa162746845f6ae08a8157dcd242dcd58eab
Move the requirement to test-requirements so that we can pick up
bot proposals. Let's also match the global-requirement pin.
https://pypi.python.org/pypi/Tempest/11.0.0
Depends-on: Id2c7e09611c1f8b06e6d272589b4ea3435b8de86
Change-Id: I91d6432eabe3de1620fa1ab07ea715e29de62296
Now that we don't need the script to pull tempest from git, it became
redundant. It's better to clean it up.
Change-Id: I8881840813339c20e4d5c59b98c2eff63f4feffb
Since [1], Tempest is a pip installable package, and that prevents zuul_cloner
to work correctly. This change moves away from the existing logic in tox_install,
and adds tempest as an explicit requirement for the api job. This is in fact
the only tox target that needs Tempest to work.
tox_install.sh has become less important now, but cleanup is left as follow
up, to speed up gate salvation.
[1] I25eac915c977ebaedced66ac896c5dd77259d193
Depends-on: I1d1ca087982d7bdda983686775736ed258026aeb
Change-Id: I00d882dde77a687ecb57ec200a34fd96256ad87a
* Detect neutron.i18n import (neutron._i18n is recommended)
* Check builtins _ usage
* 'builtins = _' in tox.ini is no longer required.
* Introduce hacking rule doctest framework.
Newly added check_builtins_gettext() hacking check takes
token as argument. It is not a good idea to pass a tokenized
line manually. Instead it is reasonable to use docstring based
tests used in hacking repo.
Change-Id: Ib7464658fc4c8a6f1b03af6ab46f0bd3ee0bfb18
Database teardowns seem to have a lock contention issue. This is a
workaround.
Change-Id: Ifd0957a86646c6a13a71b5bbf985f4694e37e943
Partial-bug: 1541742
Now that gate does not rely on -constraints targets [1], we should be
safe to remove them.
[1] Iea3a0b1f740d5679ebfa135f2bf5b89c52008716
Change-Id: I59855f1b15d54323dcc7c4759904be7124a1df1a
Since neutron gate already switched to -constraints target, we need to
keep those targets until we switch gate back to using targets without
the postfix.
This change effectively makes both types of targets identical.
Note: override install_command for venv, releasenotes, and cover targets
since corresponding gate jobs do not provide constraints file yet.
Also removed cover-constraints target since it would never work in gate
anyway.
Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Co-Authored-By: Andreas Jaeger <aj@suse.com>
Change-Id: Ica2d509df0c54496aba7cb3162565384cc5d34c8
In Ibdfc03f27450a5392acc276f98bfb464f9a0f663, the oslo team is
adding some periodic jobs to run oslo.* from master against
neutron's py27 and py34, this is done by extending the
existing tox targets. The presence of "dsvm-functional:" in
commands breaks the jobs.
The right way to fix this is to follow the same pattern
as the constraints by defining it once in
[testenv:dsvm-functional] and reusing it. However this will
not work as there is a bug in tox with posargs that Sachi just fixed:
https://bitbucket.org/hpk42/tox/pull-requests/189/fix-section-substitution-with-posargs/diff
So until we have a version of tox in our CI images with that
fix, we need to live with duplicate definitions.
Change-Id: I8880bf9caa269b9183dba8f269760af76461bca1
A while ago we copied Tempest networking API tests in to the
Neutron repo, and along came thousands of lines of code of Tempest
testing infrastructure (neutron.tests.tempest). For a while we
periodically refreshed our fork via:
tools/copy_api_tests_from_tempest.sh
I think it's time we move away from that model by eliminating
the fork. We do this by deleting unused code and importing the
rest from tempest_lib. There's some Tempest code still not
moved from Tempest to tempest_lib in tempest.common. I think
it's preferable to import that code than to copy it, and Tempest
cores mostly agree. Manila and Ironic also do the same.
To be able to import from tempest I added it as a requirement:
Since Tempest is not on PyPi, I had to get it from git. Only the api
tests environment needs Tempest, so instead of adding it to
test-requirements, I added it specifically to the api and
api-constraints venvs.
neutron.tests.tempest.test and neutron.tests.tempest.common.*
still remain. These are tighly coupled with one another, and
sadly since Neutron forked Tempest code, Tempest has made significant
changes to those files that also require changes to the test files.
I aim to get rid of the Neutron fork of these files in a follow up
change.
Also fixed import grouping in test files so that it's std libs,
3rd party libs, and then Neutron code.
* Removed neutron.tests.tempest.config:
- We only added one option after the fork. I created a new group
called 'neutron_plugin_options' and moved the new option to that
group. This is in preperation for the Tempest plugin architecture,
where you're supposed to add new config options to a new group
and not to existing configuration groups. Note that this is
obviously a backward incompatible change, but it's to an option
added in the same cycle.
* Removed neutron.tests.tempest.test and neutron.tests.tempest.common.
- This introduced an API change to the way we access Keystone,
which required mechanical changes to a few tests (create_tenant
calls need a different client now).
- The way Tempest manages primary, admin and alternative tenant
credentials was changed after we forked, which required another
mechanical change to a few tests.
* Cut all of the Keystone clients we don't need. We only need
to create/delete tenants, the other clients were used in Tempest by
actual Keystone tests.
* Changed neutron.tests.api.base.BaseNetworkTest:
- Re-implemented get_client_manager so that it returns the Neutron
clients manager and not the one in the Tempest repo.
- Updated it from the Tempest repo so that it uses the new way
to manage credentials (Since it now uses the Tempest test base
class and not our out of date forked copy).
Change-Id: I4f9193dfe26f2d36985cb480a98709ec182a2f7b
When tox 2.3.0 uses the tox.ini provided by neutron,
the following bug is hitten :
https://bitbucket.org/hpk42/tox/issues/181
We need to set the min version of tox to 2.3.1.
Change-Id: If2c3f4f534ff23a1f649cebea15e945563173544
Closes-bug: #1535725
This reverts commit be63289c273fa02159a6958e0b456d5fda217431.
Yes, it's a third order revert. Ain't it cool?
Now that tox 2.3.1 is used in gate, and it is expected to fix the issue
that we originally hacked around here, let's revert to the previous
code.
For the least, it makes API target executable locally without the need
to set TEMPEST_CONFIG_DIR in the external environment.
Also bump minimal tox version to 2.3 to avoid users hitting the old
issue with their tox 2.2.* package.
Change-Id: Ic64cb466d117ad39436cb1d079c8f5657260da2c
Related-Bug: #1515335
Adds a test to Neutron to check object versions for any changes
to objects. It prompts the developer to update the version of the
changed object. It uses oslo.versionedobjects.
Change-Id: I99454b28ae0b5fa663354eeccdf709d4030a280b
Co-Authored-By: Ryan Rossiter <rlrossit@us.ibm.com>
In the functional tests we have 'functional' and 'dsvm-functional'
venvs. The difference is that dsvm-functional requires can run
rootwrap commands on the machine. In the fullstack context,
not running rootwrap commands doesn't make sense, as fullstack
tests are explicitly and solely integration tests.
Change-Id: I1e85537d137a1b773198facbb835a65b6d0ce9b4