The newer versions of tox by default enable a random PYTHONHASHSEED. However,
this breaks many Neutron unit tests, so PYTHONHASHSEED=0 is currently hard-
coded for Neutron's unit test environments.
We want to clean up the unit test cases that break with a random hashseed
(there are many). To be able to find the broken tests and then verify them,
we need to have an easy way of enabling random hashseed testing.
Partial-bug: #1348818
Change-Id: I51f05cdfa9f8728baabaf315b71e5defb26426b1
New tox (>=1.7.0) sets a random python hash seed by default. This is
generally good for testing because it will help keep projects working
regardless of the hash seed, but neutron unittests don't currently pass
with a random hash seed so set it to the python default seed.
This change will allow us to use new tox again and remove the
restriction on tox<=1.6.1 to run unittests.
Note this change will need to be backported to the stable branches to
keep unittests there working with new tox as well.
Change-Id: If151efeb8caae3111515191e238d6e6ae491cd44
_LC, _LE, _LI, _LW are translation helper functions. This change updates
hacking rules to allow importing them directly:
from neutron.openstack.common.gettextutils import _LC
from neutron.openstack.common.gettextutils import _LE
from neutron.openstack.common.gettextutils import _LI
from neutron.openstack.common.gettextutils import _LW
neutron.policy module has been updated as an example of _LE, _LI and
_LW uses.
Change-Id: I11cba6bca48a179945385fce69e6f642270f5563
The functional gate jobs (*-neutron-dsvm-functional) need special
configuration (e.g. OS_SUDO_TESTING, OS_ROOTWRAP_CMD) to run tests.
This patch adds a new gate-specific tox env (tox -e dsvm-functional)
that sets the appropriate values and allows easy duplication of the
results of the upstream job on a host that has successfully run
devstack with neutron enabled.
A new configuration option, OS_FAIL_ON_MISSING_DEPS, is also set by
the dsvm-functional tox env to ensure that dependency failures will
result in failures rather than skips when run in the gate.
Change-Id: Idbfef1ba72ed129a3021509c7969e2685b8a6d09
Partial-bug: #1336172
This rally scenario is intended to be run in OpenStack CI
by rally-dsvm-neutron-neutron job.
Implements: blueprint neutron-performance-gate-jobs
Closes-Bug: #1334434
Change-Id: If204f3dfc32933792d09fdc929c248fc3f17b0bc
H302 / H304 are clean in the neutron source tree, so it seems
like they shouldn't be ignored. This requires no code changes to
enable.
If there is a longer standing reason for these ignores, would be
great to document in tox.ini.
Change-Id: Ib0f483e4f8fbd328815775a2a6f58be448172bd9
This change removes the E122 exemption for pep8. E122 is "continuation line missing indentation or outdented"
Change-Id: I4bd1e6c787648a3dfa69b514efeeff05996aabc1
Partial-Bug: 1329017
Update a number of files to add missing translation support.
The patch adds a new hacking check - N320. This ensures that
all log messages, except debug ones, have translations.
A '# noqa' indicates that the validation will not be done on
the specific log message. This should be used in cases where
the translations do not need to be done, for example, the log
message is logging raw data.
Change-Id: I3e1fdd04d87b09dff50950b5e85f5cacfb29afdc
Closes-bug: #1314994
H302 violation is reported by flake8 when importing separated objects from
modules instead of importing the whole module.
e.g. from package.module import function
function()
is changed to
from package import module
module.function()
Change-Id: Ifbf31b52316d3cade40743752a49ce700f384a21
Closes-Bug: #1291032
E711 comparison to False should be 'if cond is False:' or 'if not cond:'
comparison to None should be 'if cond is None:' or 'if not cond:'
E712 comparison to True should be 'if cond is True:' or 'if cond:'
Most violations were in DB queries. Replace as follows:
False -> sqlalchemy.sql.false()
None -> sqlalchemy.sql.null()
True -> sqlalchemy.sql.true()
Change-Id: Iff54747b70f504d5466cfdc6e2ec4d7a0f9ddb7c
Closes-bug: #1305377
The job neutron-propose-translation-update
does not update from
transifex since our po files contain duplicate entries where
obsolete entries duplicate normal entries.
Remove all obsolete entries to fix the job.
Add test to pep8 that checks that no new breakages get
introduced.
Change-Id: I9c680eeefecfa124c5b2900b7fa7a0a8f7e8ebd6
Closes-Bug: #1299349
This commit enables the H301 hacking rule by removing all the
multiple imports in a single line from neutron.
Partial-Bug: #1291032
Change-Id: I7ba7f82fb36a433d73190eb3d568b6961ccb57c6
This change wraps the command to generate a migration with code to
update a file called HEAD. The HEAD file will contain the revision ID
of the head of the migraton timeline. Additionally, check migrations has
been altered to verify the contents of this file against the timeline
head.
This file helps the OpenStack gate detect potential migration branches
without running alembic via git merge conflicts.
Closes-Bug:1288427
Change-Id: If382c57baea061753d3f4fcd6faec1a31fbfb7ed
This change is in support of adding a new jenkins job dedicated
to functional testing. Functional tests will no longer be
run as part of the unit tests.
Change-Id: Ia99940f7e5a2165720ae2a74aadf62ff17ad3d75
lockutils: included commits:
8b2b0b7 Use hacking import_exceptions for gettextutils._
6d0a6c3 Correct invalid docstrings
12bcdb7 Remove vim header
79e6bc6 fix lockutils.lock() to make it thread-safe
ace5120 Add main() to lockutils that creates temp dir for locks
537d8e2 Allow lockutils to get lock_path conf from envvar
371fa42 Move LockFixture into a fixtures module
d498c42 Fix to properly log when we release a semaphore
29d387c Add LockFixture to lockutils
3e3ac0c Modify lockutils.py due to dispose of eventlet
90b6a65 Fix locking bug
27d4b41 Move synchronized body to a first-class function
15c17fb Make lock_file_prefix optional
1a2df89 Enable H302 hacking check
fixture: created, included commits:
45658e2 Fix violations of H302:import only modules
12bcdb7 Remove vim header
3970d46 Fix typos in oslo
371fa42 Move LockFixture into a fixtures module
f4a4855 Consolidate the use of stubs
6111131 Make openstack.common.fixture.config Py3 compliant
3906979 Add a fixture for dealing with config
d332cca Add a fixture for dealing with mock patching.
1bc3ecf Start adding reusable test fixtures.
Also tox.ini was corrected to let lockutils work in tests.
This change is needed for work on bp: db-sync-models-with-migrations
Closes-Bug: #1065531
Change-Id: I139f30b4767ff2c9d1f01ee728823859c09b3859
tox 1.6 allows us to skip the sdist step, which is slow. This does that.
It also allows us to override the install line. In this case, it's
important as it allows us to stop getting pre-release software we
weren't asking for.
Original patch by Monty Taylor, talked about here:
http://lists.openstack.org/pipermail/openstack-dev/2013-September/015495.html
Change-Id: I87f172cfcc44c9afff9c5162791d6c6b31972702
See I62ce43a330d7ae94eda4c7498782a655e63747fa for the gorey details on
why this exists.
As of this fix:
https://github.com/eventlet/eventlet/pull/34
which was released in eventlet 0.13, we no longer need the patch.
This has now been removed from oslo-incubator, so this is really just
syncing that removal.
Change-Id: I84267f3c6726cb2e750f615e107c48b12c6ed353
Closes-Bug: #1209070
This commit addresses H102 and H103 hacking check.
H102 Apache 2.0 license header not found
H103 Header does not match Apache 2.0 License notice
Also ignores H233 hacking check in tox.ini.
H233 Python 3.x incompatible use of print operator
Change-Id: I081964bf0b9e21614da2f146bd3ba8d28e211024
This change renames everything to Neutron while providing backwards
compatible adjustments for Grizzly configuration files.
implements blueprint: remove-use-of-quantum
Change-Id: Ie7d07ba7c89857e13d4ddc8f0e9b68de020a3d19
Introduce py33 to tox.ini to make testing with
python3 easier.
Change-Id: I6cf924921e3595baac94ae1567cb2bd68457377e
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Rename tools/pip-requires to requirements.txt and tools/test-requires
to test-requirements.txt. These are standard files, and tools in the
general world are growing intelligence about them.
Fixes: bug #1179008
Change-Id: I6f8a11988982133249d443403f63b4f8724e156e
We are explicitly trying to get rid of scripts like this and flake8 makes
this one non-necessary.
Fix run_tests.sh to run flake8 properly.
This reverts commit 42243d6eb2
Change-Id: I435e34b6acde7931a75f456ccc88da6476581643
Create a common script to call flake8 to share flake8 options and
make tox and run_tests.sh use this script.
Fixes bug: 1179331
Change-Id: I92dc54fa3f4bb22aa39bde226b6d769088f9a2e3
* Add hacking to the tox build - a set of flake8 plugins that
perform automatic validation of many HACKING.rst rules.
* This patch configures hacking in the tox build and performs
the mechanical cleanup required to allow the checks to pass.
* See https://pypi.python.org/pypi/hacking
Change-Id: Ie9b3eb5627a9b6dd181f79225abae422e6cf3777
* flake8 supports more checks than pep8 (e.g. detection of
unused imports and variables), and has an extension mechanism.
A plugin to support automatic HACKING validation is planned.
* See: http://flake8.readthedocs.org/
Change-Id: I8c9314c606802109a4d01908dbc74ecb792ad0ac
This change switches run_tests.sh to use testr
in parallel mode, instead of nosetests, in order
to enable unit tests to run in parallel.
By default, the number of parallel test processes
is set to the number of cores on the test machine.
A similar change was recently merged to nova:
https://review.openstack.org/#/c/15078/
Some tests required updating to remove inter-testcase
dependencies.
bug #1099694
Change-Id: Idfb923d424342a07dcba88d70b971683f549f763
In order to support running unit tests on RHEL 6.x we need to patch
eventlet with contrib/redhat-eventlet.patch. We already
have support for this in the tools/install_venv_common.py but we
need to make a couple changes to allow tox to consume this:
1) Sync in the latest intall_venv_common.py from oslo. This changes
patch to use the -N option (ignore already applied patches) and
makes it safe to call the patching function more than once.
2) Add a new patch_tox_venv.py script in tools.
3) Update tox.ini to call patch_tox_venv.py before it runs tests and
coverage.
NOTE: This will hopefully go away eventually once this patch lands:
https://bitbucket.org/eventlet/eventlet/issue/89/add-a-timeout-argument-to-subprocesspopen#comment-3342969
Change-Id: I3e2b07c3f718e4aede5c5f231ff0cdb7721ec885
Part of making pep8 version standard across all openstack
projects.
Fixes LP: #1143569
Change-Id: Iefc923123243df161ed72888c1651a622afbda04
Signed-off-by: Chuck Short <chuck.short@canonical.com>
3rd part of blueprint quantum-scheduler
1. Allow networks to be hosted by certain dhcp agents.
Network to dhcp agent is a
many to many relationship. Provide a simple
scheduler to schedule a network randomly
to an active dhcp agent when a network or port is created.
2. Allow admin user to (de)schedule network to a
certain dhcp agent manually.
3. Allow routers to be hosted by a certain l3 agent.
Router to l3 agent is a many to one relationship.
Provide a simple scheduler to
schedule a router to l3 agent if the router is not
scheduled when the router is updated.
4. Auto schedule networks and routers to agents when agents
start.
5. Only support ovs plugin at this point
Change-Id: Iddec3ea9d4c0fe2d51a59f7db47145722fc5a1cd
The cfg API is now available via the oslo-config library, so switch to
it and remove the copied-and-pasted version.
Add the 2013.1b3 tarball to tools/pip-requires - this will be changed
to 'oslo-config>=2013.1' when oslo-config is published to pypi. This
will happen in time for grizzly final.
Remove the 'deps = pep8' from tox.ini as it means all the other deps
get installed with easy_install which can't install oslo-config from
the URL.
Retain dummy cfg.py file until keystoneclient middleware has been
updated (I18c450174277c8e2d15ed93879da6cd92074c27a).
Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
Part of bp make-string-localizable
usage: tox -e i18n
tools/check_i18n.py: used check i18n message for one file.
tools/check_i18n_test_case.txt: test case of check_i18n.py.
run test case with cmd:
$ ./tools/check_i18n.py ./tools/check_i18n_test_case.txt -d
Change-Id: I2c383b7bb11ab3bdb8e3bb3b887342b1225840ac
The openstack-common project already does its own pep8 checks; we
don't need to duplicate the effort. This also avoids issues with
pep8 version skew between projects.
Change-Id: I50d6e1b21c743d811e44b415017ca7e19687c9c2
also,this patch turn off pep8 E125 check,this for now seems to
be unnecessary,it check continuous line split.and update the
latest openstack-common https://review.openstack.org/#/c/9201
which has fix pep8 1.3 issue except for E125 check.
Change-Id: I86e6a3add56a0a2941031a1248f1696667ac56b8
Because the openstack common project does not stick to latest pep8 rules,
I have to exclude some bad-ruled files in the tox.ini and run_tests.sh.
However pep8 does not support exclude option in the format quantum/openstack/common,
so I have to exclude some of openstack common files one by one.
Also, I have changed the Qunatum Context to base on the common context.
I does not update the setup.py in our openstack common dir and the one
under quantum top dir, since it should be maintained in a consistent way
across all of openstack projects.
After this introduction, we are ready for notification feature.
Change-Id: I2729c2dc3958835374c88d704e842e613785ec14
Fixes bug 1018833. We're looking at this as a possible pan-project
option instead of manual MANIFEST.in inclusion and then looking for
where the tarballs differ.
Change-Id: I25287d5aca2046c6b613b05d54281533bdd6f79f