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
- This does NOT break other projects that rely on neutron.i18n,
as this change includes a debtcollector shim to maintain those
older entry points, until they can migrate.
- Also updates _i18n.py to the latest pattern defined by oslo_i18n
- Guidance and template are from the reference:
http://docs.openstack.org/developer/oslo.i18n/usage.html
Partially-Closes-Bug: #1519493
Change-Id: I1aa3a5fd837d9156da4643a367013c869ed8bf9d
This adds a new tox environment, genconfig, which generates sample
neutron core configuration file using oslo-config-generator.
Updates to some configuration option help messages to reflect useful
details that were missing in the code but were present in config files.
It also adds details to devref on how to update config files.
Partially-Implements: blueprint autogen-neutron-conf-file
DocImpact
Change-Id: I1c6dc4e7d479f1b7c755597caded24a0f018c712
Closes-bug: #1199963
Co-Authored-By: Louis Taylor <louis@kragniz.eu>
Currently, API job skips all tests because TEMPEST_CONFIG_DIR is not set
properly. The environment variable was hardcoded to
/opt/stack/tempest/etc before, and since that's the location for tempest
configuration files that was used in gate, it worked fine there.
But after we were forced to remove the hardcoded value from the file due
to regression in tox 2.2.0+ (If3742b6eabe295a5aaeb4901c55909a70c451698),
it was neither hardcoded, nor passed from the external gate environment.
Note that since tox 2.0.0, the tool does not pass all envvars into tox
targets, but require explicit specification of the list of variables
that should be allowed into the target environment, using passenv
directive.
So that's what the patch does: it allows TEMPEST_CONFIG_DIR to get into
api tox target, which should be enough to make the API job avoid
skipping all tests.
Users are still required to set TEMPEST_CONFIG_DIR variable locally if
they want to execute the suite locally.
Closes-Bug: #1518632
Change-Id: Ia7dcc6785390a6012c7ba16a14573aa44f2b6fb5
This reverts commit a3154b03ac60df586bd8fd67f03c20327f2dde41.
The revert was merged too quickly, without waiting for tox project to fix us.
The gate passed for the revert only because infra folks removed images
that had new tox in them. We will be broken by the next images though.
Change-Id: I148c80e5b9512fee280ecbf3ca7498ddf1cfd96d