32 Commits

Author SHA1 Message Date
Dirk Mueller
cf6db82503 Enable gating on F811
Avoid name clashes of local variables with
imported modules.

Change-Id: I1c5508902f89ad5dd9d160a4d163cd91bec41333
2013-09-02 18:08:02 +02:00
John Griffith
eafb7c4a2c Add automated check of conf sample
This adds check_uptodate to run_tests and
tox.ini checks.

This also requires that we add novaclient to the
test-requires, since we try and poke at cinder/compute/nova.

There is another implementation in use to do this that
pulls in openstack.common.config.generator,
(see ceilometer project for a pretty slick impl), however
adding that also pulls in a rather large list of
updates and dependencies that quite frankly Cinder
doesn't need and the ones that we do use break
a number of things in Cinder.

There's also a number of additional options added
to generate_sample that I don't think we need right now.

In the future we'll probably want to go this route
but for now I'd just like to get automated checking
in place.

Change-Id: I91aa4d98f472ad5a3ece7773c75ee76d66adafc0
2013-08-26 17:10:48 -06:00
Jenkins
e0048c6924 Merge "Fix python 3 pep8 errors for print" 2013-08-22 21:23:26 +00:00
John Griffith
878ac164a3 Fix python 3 pep8 errors for print
The new auto-pulled requirements files exposed
python 3 compat issues in a number of modules.
We added these to tox.ini ignore temporarily,
this change updates the print routines in bin/cinder
and removes the debug cruft that was in the unit tests.

Will update requirements and test-requirements
appropriately in a follow up patch.

Change-Id: I76ea24f4dc1f61c4f8a1d202b0554c90daf2c9cc
2013-08-21 16:59:22 -06:00
Jenkins
a6bf9e8337 Merge "tox.ini: Change sitepackages to False" 2013-08-14 04:46:25 +00:00
John Griffith
1325fdde11 Add H233 to ignores in tox.ini
The auto-pull of updated libs added to devstack
will result in the python 3.3 print checks being
added which we're not ready for.

Temporarily add this to our tox.ini ignore list
until we have a chance to go through and fix these.

Change-Id: Ie6e0e28433e9b1240b94ed4a323a97a85e475a17
2013-08-10 12:26:58 -06:00
Emilien Macchi
cd9d4069e4 tox.ini: Change sitepackages to False
To avoid issues with tox, we should use packages installed in the venv
instead of one from local system.

Fix bug #1206947

Change-Id: I8fb2a7c36c92882dc0427706ac7b470a3f3fcf42
2013-07-31 16:56:39 +02:00
Dirk Mueller
c1da47d7ce Run flake8 also on cinder/*/openstack
exclude=openstack also matches cinder/api/openstack,
which is however not merged from oslo-incubator.
Exclude=common instead, and explicitely include
cinder/common

Change-Id: I331d8c0d17e519386ae72caeca8a336eecde3ad3
2013-06-27 23:34:31 +02:00
Dirk Mueller
a4817b30a4 Fix and enable gating on H401
H401  docstring should not start with a space

Change-Id: Iaf63af75b0534cae1bac3c931ef5f51f1644aec9
2013-06-25 16:26:43 +02:00
John Griffith
c7f56eca7b Add build directory to flake8 ignore dirs.
No need to run flake8 on the build dir, so add it
to ignore list.

Change-Id: I0f6d3d3b889616f12ae2c52bbc65e528f3786996
2013-06-19 23:19:54 -06:00
Dirk Mueller
53773aab99 Fix and enable gating on H403
Fix occurrences of
H403 - multi line docstring end on new line

Change-Id: I79a818095e9f64a18ded1686fb152b9d58f3c8b1
2013-06-18 23:19:13 +02:00
Jenkins
67249826cb Merge "Start using Pyflakes" 2013-06-16 16:46:27 +00:00
Michael Kerrin
930f5891b0 Fix up the test framework
When trying to test a bug the cinder test framework was
running all the tests when I just wanted one to run.

Instead of fixing this problem in nose I tried to move cinder to
testr. I copied a fair bit of code from nova to get this to work.
This way at least if some one makes an improvement to the nova
test framework cinder can improve here also.

Note that now all the tests a thread safe. Added a concurrency argument
to run_tests.sh that defaults to 1. You can specify your own level then
and take the risk of intermittent failures. Tell jenkins to use a
concurrency level of 1 to avoid failing gate jobs.

Note One of these tests is broken and I have disabled for now. There
is a bug for this here: https://bugs.launchpad.net/cinder/+bug/1173266

Note: cinder.api.openstack.FaultWrapper is deprecated and is causing
a circular import when I try and import cinder.tests.test_wsgi. This
is fixed by only importing the openstack.FaultWrapper during the
__init__ phase of the wsgi middleware.

Fixes: bug 1183434
Fixes: bug 1177924

Change-Id: I5e10b55c5b236eb81a6a3e0e9ea56af8ca4ef8e1
2013-06-14 14:02:17 +00:00
Dirk Mueller
83b2a51d87 Start using Pyflakes
Blacklist those pyflakes warnings that trigger
frequently. Fix the remaining one and start
gating on those that are enabled.

Change-Id: I92f27f8cf36615dfd465cbd903a9605f9cb78443
2013-06-09 11:27:32 +02:00
John Griffith
b7ceb409ec Remove E12 errors from tox.ini Flake ignores.
This removes the E12 from ignores and fixes up the
existing pep8 errors that we were ignoring.

Change-Id: I5d60f1eed768fcae01a708fcf9ea324844c6376d
2013-06-06 01:56:29 -06:00
Chuck Short
b51270ffbd python3: Introduce py33 to tox.ini
Introduce py33 to tox.ini to make testing
easier with python3.

Change-Id: I351fa475deffd75201e20e3629af6ed018b9ac7c
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-06-01 18:42:55 -05:00
Dirk Mueller
50667f178e Fix path for pylint Gate
Change-Id: Ibd36a2a0a7ebe572a4dd660a3e35378ae02b8187
2013-06-01 16:20:45 +02:00
Zhenguo Niu
15a907c491 Rename requires files to standard names.
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.

Change-Id: Ifb2735151dc8c7f89ec01d237226669f7051ffa8
Fixes: bug #1179008
2013-05-31 06:09:05 +08:00
John Griffith
e136c96988 Fix up hacking ignores a bit.
Add more explicit ignores to tox.ini hacking ignores until
we have a chance to fix up the imports and docstring errors
we've been ignoring.  This should give us everything we had
in the past (ie alphabetical import checks).

Also, update run_tests.sh to call flake8 and not the hacking.py
that is no longer there.

Change-Id: I6c82e958002255fd9f527b06bf0a68d148cc681e
2013-05-14 13:18:16 -06:00
Monty Taylor
c23f620f2c Use flake8 and hacking.
Fixes bug 1172444

Change-Id: I46b733bd16fa49c58c642348988233064d2b673b
2013-05-11 16:20:23 -04:00
Yun Mao
d75fafa88f Add pylint-based lintstack test to tox environment
lintstack is a pylint-based static analysis tool to find bugs
in Python code.

To run the test via tox: $ tox -e pylint
To run the test directly: $ tools/lintstack.sh

Change-Id: If155f47ed84eb820ac505ee741bdd18edd41b1eb
2013-05-10 07:22:05 -04:00
Dan Prince
cb904d0d4c Update tox.ini to support RHEL 6.x.
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
2013-03-08 08:56:48 -05:00
Monty Taylor
af5d4b3235 Use nose and openstack nose plugin.
It's a little silly since we're working on removing nose for testr,
but it turns out that the old test run wrapper was in use here, which was
causing all sorts of havoc.

Change-Id: Ib6e31547ec4921f91b6253a1798cb04ca6930c87
2013-03-07 14:14:08 -05:00
Mark McLoughlin
d5a17b4570 Use oslo-config-2013.1b3
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.

Add dependency_links to setup.py so that oslo-config can be installed
from the tarball URL specified in pip-requires.

Remove the 'deps = pep8==1.3.3' 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
2013-02-19 16:48:02 -08:00
Chuck Short
2adf688923 Add pyflakes
Add tox option to use pyflakes.

Change-Id: Ic77ec3f54cb89341d5b01feb3417e07f43d20c9c
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-01-02 08:44:42 -06:00
John Griffith
51418bdd5b Make pep8 checks a bit stricter.
Along with moving to pep8 1.3.3, we also want to standardize
on what we ignore. This patch get's us most of the way there
by setting the ignore list to:
N4,E125, E126, E711,E712.

Almost all changes made here are white-space/indentation changes.

The removal of Hacking N4 errors from the ignore list will
be handled in a seperate patch.

Change-Id: If45f156600485d23769449018590f60b4f69b0c5
2012-11-26 16:57:15 -07:00
Chuck Short
ceee1fdaf2 Pin pep8 1.3.3
Apart of making pep8 version standard across all openstack
projects.

Also fix tools/hacking.py so it is compliant for pep8 1.2
and beyond, taken from fbc4568 in the nova tree.

Change-Id: I801c98a01960fa113dae1b6174c1a06bb149fea3
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2012-11-20 09:10:01 -06:00
Dan Prince
5d986e3121 Make tox.ini run pep8/hacking checks on bin.
This updates the pep8 checks in our tox.ini file so that
we are also scanning the bin directory.

Additionally, it updates the main pep8 check so that it scans
cinder properly as well. Previously there were a bunch of files
getting skipped due to some of the pep8 pattern matching.

Change-Id: Ib47a590303409e62546a75625ee356c9fa7af6ad
2012-11-15 14:11:25 -05:00
John Griffith
a9c8212f69 Add action extensions to support nova integration.
* Adds VolumeActions extension to support key functions
    described in blueprint volume-decoupling
 * Adds snapshot translations to APIs
 * Should be back in sync with 7992
 * blueprint compat-extensions
 * sleepsonthefloor: Moved added snapshot attributes to extension, added tests
 * sleepsonthefloor: Lock pep8==1.1 in tox.ini

Change-Id: I9c6118cd434ca8b275d2386546923f932420b975
2012-06-26 14:35:56 -07:00
Monty Taylor
50792c2ff4 Fix up coverage and jenkins test running.
The docs job wasn't working because of an un-renamed file.
Coverage wasn't running in jenkins with the xml output file.
Remove the .cache.bundle support that we're moving away from.

Change-Id: I1140baa53dee8b14ac4d1f8549425a0fdd7a8425
2012-05-21 16:46:25 -04:00
Monty Taylor
1c52fb3041 Align the tox.ini file.
Change-Id: I0d1731f157d12bfcc1e4933dd71c49e9bda4116a
2012-05-03 21:45:20 -07:00
Jenkins
c53d8e343e Initial fork out of Nova. 2012-05-03 10:48:26 -07:00