In order to get similar behavior to the way testr out of the box
works, only displaying failing results, all the user to define
TRACE_FAILONLY environment variable (any value will do). After this
point only failures, and things leaking out of stderr will end up on
the screen.
We also need to remove the suppression of the inline fail dumps for
this to have the impact that you'd expect.
Change-Id: I72911adc8a03450522429c52db661ec0a1bc4678
Found an interesting cantrip in the devstack tox.ini that gets rid of
the scary can't find bash error message at the beginning of test
runs. Reducing non error looking error things make it easier to see
real errors.
Change-Id: I4e1b826626063bf8d5a15531f5768f9ce0eea6a5
It's apparent that Nova is quite a ways from Py3K support, and
developers are not expected to run the py33 tox env. Rather than add
more envs for later Python interpreter versions which will be
equally broken, just remove it for now.
Change-Id: I885e6e8899f771cc52a2bf6282fd7bc1ed3083aa
Tempest developed a set of wrappers around testr to print out tests as
they are running through using the subunit stream. This also displays
which workers the various tests are running on. Adapted for nova's
need for loading the locking.
I expect that the needs of nova will diverge this over time,
especially what's displayed during tracing, as such I think it's fine
to just do a transplant and not try to turn this into some external
repo.
Change-Id: Ied1708515fc49f4e18cd8dbb7b2cd821f85e1966
Bring over the cleaning line from run_tests.sh for the pyc files to
all the tox runs.
This should eliminate the need to clean -x -i to kill pyc files in
your local directory to get tests to pass.
Closes-Bug: #1368661
Change-Id: Idf3a46d8c95806f2d2ce28ce84ced12b625e53df
This commit removes the regex to exclude the coverage extension from
the tox coverage job. The regex was needed for the unit tests on the
coverage extension, (which would mock out coverage) however that
extension has since been removed from nova. So we no longer need to
exclude tests that don't exist anymore.
Change-Id: I45685b1113ecc78eda92f13755ff2274ff517829
Invoke the pip-missing-reqs tool to find packages used by nova but
not explicitly included in its requirements.txt file.
Add simplejson to the requirements to fix the failing check.
Change-Id: Ia90416c613c0acea04f3d4ab4898f550cb702a49
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 nova 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.
Redundant setenvs for specific test envs are removed to prevent them
from overriding the PYTHONHASHSEED value.
Note this change will need to be backported to the stable branches to
keep unittests there working with new tox as well.
Change-Id: Ib54364877a251db48c54dfdc43c503281ea1f04a
We can install libvirt-python bindings from pypi now because the libvirt
devs are supporting pypi packages and the version of libvirt we are
testing nova master against is new enough to link against that pypi
package.
Making this switch will better isolate nova test environments as all
dependencies can be installed without any site packages leaking into
virtualenvs. It will also make the dependency on libvirt-python a bit
more explicit.
Change-Id: I2890702869f05a02ad5e2ecb419db06433231b36
pep8 E265 makes sure block comment start with '# '. Fix and gate on this
new rule as it helps improve comment readability.
In the few cases where the comment was just commented out code, remove
the comment.
Change-Id: Iea1c445df8ddc2b6c17a4ab697ad756eef2f91fa
I6c2537dd27c947e36ebf37eb3b5c8a1ab8b026a1 mistakenly removed H803 since
running flake8 had no hits for this test, but H803 is the period in the
commit message which we are explicitly ignoring until the next version
of hacking is released (which will remove this check).
Change-Id: I22860cc61336ef5bf8ce4509fe130160bdf7e45b
rename instances of loop variables to prevent them from shadowing
imports. This strict check was added in hacking 0.9
Change-Id: Ib5e162b85e3c6931f213731c3febd3dd8ba0b4b1
Fix the offending instances of the rule
and removes it from the ignore list in tox.ini
so that we can gate on E711 and E712 rules.
Most violations were in DB queries. Replace as follows:
False -> sqlalchemy.sql.false()
None -> sqlalchemy.sql.null()
True -> sqlalchemy.sql.true()
Change-Id: Id84aa04697d1b3c23dc03195113e296c6715379d
oslo.i18n provides the i18n functions that were provided by
oslo-incubator's gettextutils module. Some tests that were
using internal details of the library were removed.
Change-Id: I44cfd5552e0dd86af21073419d31622f5fdb28e0
Remove H803 as Nova does not run into that issue. Sort
the rest of the items (E129 was out of place).
Change-Id: I6c2537dd27c947e36ebf37eb3b5c8a1ab8b026a1
This fixes the offending instances of the rule
and removes it from the ignore list in tox.ini
so that we can gate on the E713 rule.
Change-Id: I1f9ef23a8569252b5b6fa660d0d200b1702056d0
Both H305 and H307 are part of the OpenStack style guide.
Ensure that there are 3 groups of imports, stdlib,
third-party and project specific. Within each category
ensure that imports are in alphabetical order.
Change-Id: Id4994551c135c3c1a4982153f0c6cacba6176b95
Additional issues found by flake8 by enabling F811 and
F813. There was only one F813 list comprehension redefinition.
The rest of the changes were F811 redefinition of unused name
violations.
Change-Id: Iad5406c149ab21d360b7e98899a92082197c8c17
Fix up pep8 failures for rules we previously gated on, but that are now
stricter in there enforcement.
Ignore E251 due to https://github.com/jcrocholl/pep8/issues/301
Change-Id: I62b33e97c44c4a5be436b381cfbdaeb31cd2638b
Hacking 0.9.0 had a minor bug so require 0.9.1 or higher.
In order to keep this patch to just a requirements bump, ignore new and
stricter hacking rules that are being triggered. Fixing up the code and
turning these on is out of scope of this patch and is for future patches.
Change-Id: Iafbd4adae8c6b446d53b62dfc490eab8e76a43ac
For those in the community who don't use run_tests.sh but want
tox to have coverage support this small change should help. It
adds coverage erase, combine, html reporting. It also
fixes the coverage unit tests in two ways. The first is
adding the locking like normal unit tests. The second
is adding substring regular expression matching to pick
a subset of tests. This brings it up to closer par with
run_tests.sh.
Change-Id: If9ea229425dc9a191fa7c5cc073cf5da412a69b7
Now that we are starting to move over to multiple log domains we want to
import multiple items on the same line for gettextutils.
Change-Id: Icd88774a0f1087270234a6849bf96a93c0927534
Add doc venv to align with other OpenStack projects (such as keystone,
heat and nova-specs) who are using 'docs' for there doc builds.
Change-Id: I37771db339d864b2b938d1c02d15d38b07093493
Use pip's option to force installation of packages so that
local copies are installed in the virtualenv, even if they
are present in the global site-packages directory. This
ensures that the latest packages are installed, and that
all of the oslo libraries from namespace packages are
installed in a consistent way, making it possible to run
unit tests on a system where devstack was run previously.
Change-Id: If5c4e12956f2c7be6530c5c9a57fdfb1da8e710c
This file is not gated anymore and therefore it gets
out of date. Replacing it with a README that explains
how to generate it
DocImpact
Closes-Bug: 1294774
Change-Id: I2a72a005208a2c86d69ac461d72e54c53bd395cf
This adds a new tox target that uses sitepackages=False. This is
handy for people running unit tests on a devstack box, where the
site-packages oslo.config interferes.
Change-Id: I1101730f18550de0b391d12bcc5841cb671434a2
check_uptodate.sh re-generates a nova.conf.sample and then compares
it, which was fine. It stopped being fine when we started pulling in
options from oslo, or other modules made releases and then the gate
broke until we fixed the config sample.
Change-Id: I04b2b52a9e46dcf5f4f06e639327f22b827ccd0d
This check indicates on comments in which multi line docstring should
start without a leading new line. This change fixed all violators of
said check.
Change-Id: Ic7357b8c7420767dba611f6fcee07b7700f3aea8
* tox.ini: The LANG, LANGUAGE and LC_ALL environment overrides were
introduced originally during the testr migration in an attempt to be
conservative about the possibility that locale settings in the
calling environment could cause consistency problems for test runs.
In actuality, this should be unnecessary and any place where it does
cause issues ought to be considered an actual bug. Also, having
these in the configuration actively causes older pip to have
problems with non-ASCII content in some package metadata files under
Python 3, so drop it now.
Change-Id: I5353dd318ce0bfdc85d6468750fb4c2a2690cde1
Closes-Bug: #1277495
This reverts commit de59c55e77ead72df42c0445c09cf4d63131f6bd.
The netaddr developers have agreed to go back to uploading releases
to PyPI, so this workaround is no longer necessary. For details see
https://github.com/drkjam/netaddr/issues/57#issuecomment-31796111 .
Change-Id: Ieeb3e8e549d9e4b53dba0165277fa2423d2eba01
* Stop ignoring F403 as we have no cases of it anyway
* Cleanup the comments to make it clear what is ignored on purpose and
what is ignored until we clean up the code.
Change-Id: I2500e2db70b9c71fbed781d8f7b7c80eee45140f
* tox.ini(testenv.install_command): Use the --allow-external and
--allow-insecure options so that pip 1.5 and later will assent to
retrieve the netaddr package even though it's not hosted on PyPI.
The --allow-insecure option is aliased to a clearer
--allow-unverified wording in 1.5, but the old form is being used to
avoid breaking users of 1.4.x and will be valid at least through
1.6.x according to comments in the pip source.
Partial-Bug: #1266513
Change-Id: I005e752c8cb9bca78b1ebe777eb5230e9bf05bd8
Apache2 license says that each source file should include the license
header. However, some non empty files don't have it. And we already have
a hacking rule (H102) for this.
This commit fixes them and enables the rule.
Change-Id: I68fa0e1ee43ed28d6b470c0ffff963c095be8283
When running unit-tests concurrently using testr, we might
need to use interprocess file locks (e.g. for running various
tests using the same DB in MySQL/PostgreSQL).
At the same time file locks are only usable when they are placed
to one dir, and we have a test fixture that overrides the lock_path
config value for each test case with a new temporary directory.
The solution is to create the one temprorary directory for locks
to be used by all tests before running tests and then remove it
after running tests. The corresponding helper has been already
put to openstack.common.lockutils module, we just need to reuse
it properly, i.e. change the way unit tests are run in tox.ini.
Closes-Bug: #1261728
Change-Id: I76f95a9f7fdd31c15e6cf4fd6316c7569284f780
E125 overreaches on what pep8 specifies. See
https://github.com/jcrocholl/pep8/issues/126
In practice E125 can be a pain as compliance requires
manual indenting if using emacs and refactoring tools
don't always get it right.
There's a bit of a discussion about it here (on a tempest
changeset):
https://review.openstack.org/#/c/36788/
Change-Id: Ic73ab3c4a47f33de9145e0c7db2d8674230c2fe0
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