54 Commits

Author SHA1 Message Date
Sean Dague
9a06348f47 add pretty_tox to nova functional tests
debugging tests is a lot easier when you can actually inject stderr
directly through even on successes. Add the pretty tox facility from
nova / tempest-lib into python-nova client as well for functional
tests.

Change-Id: I5c1f8244a5c743b590b74a8eb3eaf4a699555644
2015-02-23 17:22:10 -05:00
Joe Gordon
b89da9be28 First pass at tempest_lib based functional testing
Begin moving tempest nova CLI tests out of tempest and into this repo
using tempest-lib. This patch adds the framework to run the functional
tests, later patches will port the existing tempest tests.

Use standard OpenStack environment variables to get keystone auth

Change-Id: Ie957bd450bfed97b63788cfb488f92988fbbc889
2015-01-28 15:44:43 -08:00
Joe Gordon
7544dcb4ea whitelist find in testenv
Stop logging a warning when running find inside of tox.

Change-Id: I9a79ea62bc85d6a414ef3c6e45a059301a3ea8a4
2015-01-27 12:35:40 -08:00
Joe Gordon
0eb2e72d38 Move to hacking 0.10
Release notes: http://lists.openstack.org/pipermail/openstack-dev/2015-January/054165.html

Explicitly move everything to new style classes (H238).
http://python3porting.com/preparing.html#use-new-style-classes

Remove deleted hacking rules from tox.ini

Change-Id: If65b0060e6f64a456b4869ef4129ad15aef107fb
2015-01-12 09:40:49 +13:00
Eugeniya Kudryashova
1aa020989e Enable check for E128 rule
Fix E128 failures in novaclient/client and
novaclient/shell and enable check for E128

E128 continuation line under-indented for visual indent

Change-Id: Id3ac46ccdbb8a9f97e54b4643240d93b06fac6ea
2014-11-27 14:19:55 +02:00
Andrey Kurilin
3065afd6c0 Enable check for E129
E129 visually indented line with same indent as next logical line

Change-Id: I438bf0d9de7f61ab65e753169c9a8007e84b215a
2014-10-23 14:28:57 +00:00
Andrey Kurilin
ae6c39397e Enable check for E127
E127 continuation line over-indented for visual indent

Change-Id: I9dfd489565ee2d1469b2048a930c3a8384dd245d
2014-10-23 14:28:50 +00:00
Andrey Kurilin
8de2237cc4 Enable check for E126
E126 continuation line over-indented for hanging indent

Change-Id: Id64edce8278d96c1b2d4a6ca536e9fc8fbef478c
2014-10-23 17:28:25 +03:00
Joe Gordon
1adc6d0251 Remove E12* from list of deliberately ignored flake8 rules
I367064ecaa6d1fd9d918f7ce003303e2db660647  Added E12 to the
ignored on purpose list, which also makes no sense E12 was never meant
to be skipped all together (I was the one who added E12 to the flake8
ignore list (Ifc8924914b5a0d625bc8df6442ee85eb21459cde)

Then I4cf246e3ec932ba0d2391eb8bcb793b28b005b4c came along and updated
the list to break out the E12 ignored on purpose list.

Drop all E12 rules from the ignored on purpose list, as we do not want
to ignore these on purpose.

Change-Id: Ic400047347a82aebbc0f6ce6f5061e7757a02d3d
2014-10-20 10:21:20 -07:00
Andrey Kurilin
dc09cf27e3 Port to use oslo.i18n
Module gettextutils from oslo-incubator was graduated to separate
library (oslo.i18n) and removed from repository, so we should use
new library.

Change-Id: I15d36ac5a2bb88b332ffa38d29488b75c55a20a9
2014-10-16 01:19:48 +03:00
Andrey Kurilin
8b8aa499e1 Enable check for E123
E123 closing bracket does not match indentation of opening bracket's line

Change-Id: I3f941032efb5ca2ef9a78f865effbf79c8674ebb
2014-09-24 22:44:20 +03:00
Andrey Kurilin
d05ae5dcc0 Enable check for E122
E122 continuation line missing indentation or outdented

Change-Id: Ic54714142b3c5aded42d544f296b0ef9a840c282
2014-09-24 22:44:20 +03:00
Andrey Kurilin
7fc1588dfd Enable check for E121
E121 continuation line under-indented for hanging indent

Change-Id: I4cf246e3ec932ba0d2391eb8bcb793b28b005b4c
2014-09-24 22:44:09 +03:00
Sean Dague
d96f13d2e2 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.

Related-Bug: #1368661

Change-Id: I00ee418eea2d82031bb510b09e63e2ec87fb1b09
2014-09-12 17:37:15 -04:00
Christian Berendt
33058cbe8e Enable several checks and do not check docs/source/conf.py
* E265 block comment should start with '# '
* H302 import only modules

Do not check docs/source/conf.py. The file is imported from the
cookiecutter template.

Documented why checks are ignored and if they should be enabled
in the future.

Change-Id: I367064ecaa6d1fd9d918f7ce003303e2db660647
2014-08-05 22:18:14 +02:00
Christian Berendt
68f357d963 Enable check for E131
* E131 continuation line unaligned for hanging indent

Change-Id: I719d5bcd1b51896c947e637f6dfce2e1f1a6bd2b
2014-08-01 22:39:14 +02:00
Joe Gordon
4d2586716a Enable H233
H233 (and H402) were temporarily disabled as part of the migration to
hacking 0.9. This patch fixes all H233 issues and re-enables
gating on them.

H402 has been removed in hacking
(I9426644fa708e9d5563abe04dc4ad656dbeb3656) so leave this one off as its
going away anyway.

Change-Id: Iae8f132c66c5e345dc2e9c2464f67609887c1475
2014-07-25 19:20:38 +02:00
Christian Berendt
d51b546774 Enabled hacking checks H305 and H307
* H305  imports not grouped correctly
* H307  like imports should be grouped together

Change-Id: I23fdad285508707a2c1d7c832ff8b1a6a10e8f88
2014-07-17 15:31:08 +02:00
ChangBo Guo(gcb)
88d0b6f2d9 Enable F841
F841 detects local variable is assigned to but never used.
This commit fix the violations and enable F841 in gate.

Change-Id: I52419f5e17db70e511ff2d4d61c85458c958e9c3
2014-06-19 09:49:05 +08:00
Jenkins
f44c49d3c3 Merge "Bump hacking to 0.9.x series" 2014-06-17 10:30:42 +00:00
Jenkins
8aec8049b9 Merge "Add posargs support to flake8 call" 2014-06-17 03:59:22 +00:00
Joe Gordon
9f92301983 Bump hacking to 0.9.x series
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: Ia3517e705f894b48585b957c21e7a3a6ed90e586
2014-06-16 09:30:52 -07:00
Joe Gordon
b4d0280f03 Add posargs support to flake8 call
Add posargs to flake8 call in tox.ini, with this you can pass arguments
directly into flake8 using the following notation
  tox -epep8 -- --FLAKE8-ARG

This can be used to pass arguments like '--statistics' to flake8

Change-Id: Ia820d62c4a1f428d60d88b04d8a4d9b1442baa09
2014-06-15 23:42:31 -07:00
Sean Dague
9520fbbfea add tox target for python 3.4
Ubuntu 14.04 has python 3.4 so add a 3.4 target. 
Note that this will fail unless
you have new enough virtualenv. Recommend you install the packaged
version of 1.11.4 and get rid of any pip installed ones.

Change-Id: Ib54dc49fca2463f1c5cd788b48d06bd85be52655
2014-06-11 10:45:08 +00:00
Alex Gaynor
cbbfc6904e Removed now unnecesary workaround for PyPy
Change-Id: Id23fdf62352a1575653d2277f7b87d371b0480c8
2014-05-31 21:40:59 -07:00
Kevin L. Mitchell
8c7524b8bf Work around pypy testing issue
A recent release of setuptools appears to have introduced a bug that
causes the pypy gate tests to fail.  This applies a temporary workaround
that should restore pypy testing while the root cause of the problem is
researched.

Change-Id: I66597e40c1d2e57cca1292844d228af85214197d
Partial-Bug: 1290562
2014-03-18 11:37:57 -05:00
Jeremy Stanley
09bef81e9c Remove tox locale overrides
* tox.ini: The LANG and LANGUAGE 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.

Change-Id: I0f30b45033145c61ad2a9b232cb1178c48c7fc97
2014-02-10 03:21:02 +00:00
Russell Bryant
f6fdff657f Fix python 3.3 unit test job
Change-Id: Ibb253e51ec2412d71d04a1994cef4fb60e77f234
Closes-bug: 1277495
2014-02-09 17:49:29 -05:00
JUN JIE NAN
25041fe6fa Enable pep8 check for config.py in doc
Directory doc is excluded from pep8 check in tox.ini, since we
modified file doc/source/config.py, we should enable the check.

Change-Id: I057f1e6cb1c5f9a6a07043056078e4475f66f288
2014-01-03 13:53:53 +08:00
Sushil Kumar
953734d727 Enables H403 pep8 rules
Updates tox.ini to reduce ignored rules.

Updates code for H403 violation.

Change-Id: Iee7b34a27c62ce8cb0f26166b3c16e3386e2fecd
2013-12-14 15:16:20 +00:00
Sushil Kumar
3ecaeb416e Enables H306 pep8 rules
Updates tox.ini to reduce ignored rules.

Updates code for H306 violation.

Change-Id: I9beea02510a1122afb55ad3df3b37f770fe05134
2013-12-12 17:43:08 +00:00
Sushil Kumar
547f357b12 Enables E711,E721,E712 pep8 rules
Updates tox.ini to reduce ignored rules.

Updates novaclient/v1_1/shell.py and
novaclient/v3/shell.py for E712 violation.

Change-Id: Ibfd6a4ed19835e65cc9e27873699c31a801e99a8
2013-12-11 12:06:44 +00:00
Sushil Kumar
06b28391e7 Updates tox.ini to use new features
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 were not
asking for.

Original patch by Monty Taylor, talked about here:
http://lists.openstack.org/pipermail/openstack-dev/2013-September/015495.html

Change-Id: Iddf85d33b57f256d72756b516c23492e9600bedc
2013-12-11 04:29:29 +00:00
Chris Yeoh
50685437ed Enable hacking check for Apache 2.0 license
Removes H102 (license header not found) check from flake8
ignore list.

Adds missing apache license headers.

Change-Id: I109f23c6d8b2e3efb1dac7f764bd77e0d9d335f0
2013-12-06 10:47:41 +10:30
Jenkins
d6139aabda Merge "Added support for running the tests under PyPy with tox" 2013-08-29 12:03:49 +00:00
Alex Gaynor
d9782457fc Added support for running the tests under PyPy with tox
This is a precursor to having them run under check and gate.

Change-Id: I105404d45cd4be93909ea5a272fc7e7c0c6d78cb
2013-08-28 09:35:28 -07:00
Joe Gordon
e0e5c2dfe5 Fix and gate on H501, no locals for string formatting
Change-Id: I07e4a1a733639a343d4b3ee20927d50ba04bd7a3
2013-08-15 19:11:28 -04:00
Monty Taylor
ec5861644c Sync with global requirements
Change-Id: I8333e17d8edaa5853ac47f9d53de8c44d1c5d5cb
2013-08-05 17:50:29 -03:00
Dirk Mueller
af7ca70e3e Fix and enable gating on H402
End one-line docstrings with punctuation.
Change them to command style where necessary.

Change-Id: I8ff689c3a2f20d489286f80112c6dc95c97f2f31
2013-07-17 15:44:05 +02:00
Jenkins
f67c5e0cf9 Merge "python3: Introduce py33 to tox.ini" 2013-06-03 19:16:47 +00:00
Chuck Short
8820623d2a python3: Introduce py33 to tox.ini
Introduce py33 to tox.ini to make testing with
python3 easier.

Change-Id: I2f339a2ccf113ff14db64c2bbc67a93bd0270962
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-06-01 19:40:41 -05:00
Dirk Mueller
67c80558b1 Start using Hacking and PyFlakes
Only blacklisting those warnings that are numerous,
so that in principle Hacking and PyFlakes warnings
are tested. Fix the easy ones alongway.

Change-Id: I571f51ebf570ac114509f2dcd71cdce281e7c70a
2013-06-01 15:49:51 +02:00
Monty Taylor
3bbdcda9d2 Rename requires files to standard names.
The python community groks requirements.txt and test-requirements.txt as
reasonably standard files. We should use those filenames to make our
information more discoverable.

Fixes bug 1179008

Change-Id: I50a7c46f880e4257fa31d7d322d7bf70b0f5d3a6
2013-05-25 08:23:12 +02:00
Monty Taylor
9d4db6f740 Migrate to flake8.
Fixes bug 1172444.

Change-Id: I0d8faa0819738456a28aaf5cc859f510a2b3ed68
2013-05-25 08:22:39 +02:00
Roman Podolyaka
f08ac04a27 Migrate to pbr.
openstack.common.setup and openstack.common.version are now in the
standalone library pbr, so all projects using those two should
migrate.

Fixes bug 1179007.

Change-Id: I7ac1c37f0bf148619dffff8f454db05fc192e471
2013-05-19 10:00:38 +03:00
Andrew Laski
d7f1a71311 Don't check build/ for pep8 violations
There's no need to run pep8 on the build dir, and it contains E502 false
positives due to some part of the build process adding line
continuations in places that they're not needed.

Change-Id: I7ea19aea2b9e46503aa8acc06ce6b9d7ea18113a
2013-03-25 16:57:06 -04:00
Roman Podolyaka
f78617803c Use setuptools-git to include files from the repo
Fixes bug 1029511.

Change-Id: I5aef29ad10ac73a9645111f993621d596321ffcf
2013-03-22 23:06:08 +02:00
Joe Gordon
96630b8248 Upgrade to pep8 1.3.3
Also expand scope of what is covered by pep8 test

Change-Id: Ifc8924914b5a0d625bc8df6442ee85eb21459cde
2013-02-01 12:24:19 -08:00
Monty Taylor
7b2097e706 Migrate from nose to testr.
Run tests with testr for parallel execution.

Part of blueprint grizzly-testtools.

Change-Id: I38e8a2df12678002e19264a53bad26e80265c6e4
2013-01-29 14:22:42 -06:00
Brian Waldon
af634abb1e Lock pep8 at v1.1
We can't depend on pep8 not to add new rules and break our tests.

Change-Id: Iac5c79f7c00fcaeff3ef957d138754d63425a256
2012-05-24 07:13:16 -07:00