128 Commits

Author SHA1 Message Date
Jenkins
05a564dc80 Merge "support TRACE_FAILONLY env variable" 2014-10-03 17:29:26 +00:00
Sean Dague
9c448bfb5f support TRACE_FAILONLY env variable
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
2014-10-01 15:08:03 -04:00
Sean Dague
eb49e0aedb remove scary error message in tox
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
2014-10-01 06:25:52 -04:00
Jeremy Stanley
fd297c108a Remove unused py33 tox env
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
2014-09-22 13:06:56 +00:00
Jenkins
f4c780618c Merge "bring over pretty_tox.sh from tempest" 2014-09-18 13:57:18 +00:00
Jenkins
e1e9459888 Merge "Check requirements.txt files for missing (used) requirements" 2014-09-17 03:31:53 +00:00
Sean Dague
c805613d90 bring over pretty_tox.sh from tempest
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
2014-09-16 11:57:20 -04:00
Jenkins
1b683c1771 Merge "Remove exclude coverage regex from coverage job" 2014-09-16 02:44:08 +00:00
Sean Dague
a2530ed1e3 delete python bytecode before every test run
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
2014-09-12 17:35:28 -04:00
Matthew Treinish
abf8f1928e Remove exclude coverage regex from coverage job
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
2014-09-09 17:53:18 -04:00
Richard Jones
26b1db57ce Check requirements.txt files for missing (used) requirements
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
2014-09-09 12:11:07 +10:00
Jenkins
01a56d6436 Merge "Stop depending on sitepackages libvirt-python" 2014-07-28 17:29:15 +00:00
Clark Boylan
4f3e3cd188 Set python hash seed to 0 in tox.ini
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
2014-07-25 13:27:03 -07:00
Clark Boylan
8f505b8526 Stop depending on sitepackages libvirt-python
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
2014-07-25 12:36:46 -07:00
Joe Gordon
855fe98ef4 Fix and Gate on E265
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
2014-07-24 08:11:00 -04:00
Joe Gordon
c03c90ea5d Re-add H803 to flake8 ignore list.
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
2014-07-21 16:56:05 -07:00
Davanum Srinivas
e25ca68709 Gate on F402/pep8
rename instances of loop variables to prevent them from shadowing
imports. This strict check was added in hacking 0.9

Change-Id: Ib5e162b85e3c6931f213731c3febd3dd8ba0b4b1
2014-07-21 16:15:57 -04:00
Davanum Srinivas
284e5ac022 Cleanup and gate on hacking E711 and E712 rule
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
2014-07-19 13:07:59 +00:00
Jenkins
8aade96d8f Merge "Use oslo.i18n" 2014-07-19 01:06:23 +00:00
Davanum Srinivas
826aed0ec7 Use oslo.i18n
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
2014-07-18 14:28:09 -04:00
Davanum Srinivas
0550ae806a update ignore list for pep8
Remove H803 as Nova does not run into that issue. Sort
the rest of the items (E129 was out of place).

Change-Id: I6c2537dd27c947e36ebf37eb3b5c8a1ab8b026a1
2014-07-18 07:42:43 -04:00
Matt Riedemann
51e604f87e Cleanup and gate on hacking E713 rule
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
2014-07-16 02:06:33 -07:00
Davanum Srinivas
f3dc6eefe7 Fix and gate on H305 and H307
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
2014-07-15 01:13:26 +00:00
Davanum Srinivas
e71b76cf03 Fix more re-definitions and enable F811/F813 in gate
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
2014-07-10 10:59:47 -04:00
Joe Gordon
87a08aafd8 Cleanup and gate on pep8 rules that are stricter in hacking 0.9
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
2014-06-17 11:38:12 -07:00
Joe Gordon
e59a64596f Fix H401,H402 violations and re-enable gating
H401 and H402 got stricter in hacking 0.9, so fix new violations and
re-enable gating.

Change-Id: I4785d14edee1ffdf32e2900f6e6234cbecab6d8a
2014-06-10 09:56:31 -07:00
Joe Gordon
518b2766ba Bump hacking to 0.9.x series
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
2014-06-10 09:56:31 -07:00
Jenkins
757ce1049f Merge "Add better coverage support under tox" 2014-06-09 23:05:56 +00:00
Alexander Bochkarev
1fdc4afa15 Enable flake8 F841 checking
This check looks to see whether a local variable
is unused. Fixed all of violators of said check.

Change-Id: I6ff349ca8d650ae7d6ebeeb116a1649b0db8f071
2014-05-28 14:55:08 +01:00
Christopher Lefelhocz
e9b5acf5d4 Add better coverage support under tox
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
2014-05-20 14:01:53 -05:00
Jenkins
d01037018d Merge "Add specific doc build option to tox" 2014-05-20 18:22:49 +00:00
Joe Gordon
2d75fafb88 Loosen import_exceptions to cover all of gettextutils
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
2014-04-18 11:25:38 -07:00
Joe Gordon
c029619b8c Add specific doc build option to tox
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
2014-04-17 10:30:18 -07:00
Doug Hellmann
cab21d229b Tell pip to install packages it sees globally
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
2014-03-25 12:16:48 -07:00
Tracy Jones
918f6eab7c Remove the nova.config.sample file
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
2014-03-19 17:18:58 -07:00
Dan Smith
d8b29d09e2 Add py27local tox target
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
2014-03-11 09:42:12 -07:00
Steve Kowalik
d19ecd1b5b No longer call check_uptodate.sh in pep8
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
2014-03-04 14:31:20 -08:00
Alexander Bochkarev
dd4032e9fb Enable flake8 H404 checking
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
2014-02-27 11:15:55 +04:00
Jeremy Stanley
e040abcbba Remove tox locale overrides
* 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
2014-02-10 03:04:51 +00:00
Jenkins
ec8737a448 Merge "Revert "Whitelist external netaddr requirement"" 2014-01-25 20:07:50 +00:00
Jenkins
cdab346be0 Merge "Cleanup the flake8 section of tox.ini" 2014-01-12 20:49:21 +00:00
Jeremy Stanley
0311a9ab92 Revert "Whitelist external netaddr requirement"
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
2014-01-09 00:28:23 +00:00
Joe Gordon
00431f542f Cleanup the flake8 section of tox.ini
* 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
2014-01-07 13:08:59 -08:00
Jeremy Stanley
de59c55e77 Whitelist external netaddr requirement
* 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
2014-01-06 11:36:05 -08:00
Masayuki Igawa
731d25fdcf Add apache2 license header to appropriate files for enabling H102
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
2013-12-24 09:37:59 +09:00
Roman Podoliaka
78d62186e5 Fix interprocess locks when running unit-tests
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
2013-12-19 18:08:29 +02:00
Chris Yeoh
48a0fdc49e Don't gate on E125
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
2013-11-26 23:11:45 +10:30
lawrancejing
7841ef1f20 Remove extra space in tox.ini
Change-Id: I19060db8622e5747ab19a11a8eafe3144d61abe9
2013-10-24 12:54:17 +08:00
Mark McLoughlin
fd3328511d Remove obsolete redhat-eventlet.patch
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
2013-10-09 21:34:58 +01:00
jmeridth
2266c04458 xenapi: fix pep8 violations in nova plugins
Removed plugins/xenserver from tox.ini excludes list, ran tox -e pep8, and
fixed violations.

Fixes: bug 1197893
Change-Id: I8e0116304b07d54c49a01202b3ce6d3426097bb4
2013-09-17 16:44:59 +00:00