Commit Graph

466 Commits

Author SHA1 Message Date
Mark McLoughlin 341b59531f Unpin Cheetah dependency version
Fixes bug #1133216

We've been pinned to the same version of Cheetah since May 2011:

  Cheetah==2.4.4

this was released in December 2010 and there hasn't been a release since:

  https://pypi.python.org/pypi/Cheetah/2.4.4

There's no particular reason to believe a future release of Cheetah will break
us (only 6 commits since 2.4.4 and they all look like bugfixes), so we should
change to:

  Cheetah>=2.4.4

Change-Id: Id3b22b84d2d693776f89ccb1d0c99d4e42fcab62
2013-02-26 11:10:01 +00:00
Jenkins 032ee13648 Merge "Fix hacking.py to handle 'cannot import x'" 2013-02-26 06:07:05 +00:00
Joe Gordon 99308d4dd3 Fix hacking.py to handle 'cannot import x'
Fix missingImport logic to handle a module that cannot be imported, due
to a missing dependant module.

Due to the nature of this bug doctests cannot cover it.

Fix bug 1133103

Change-Id: Ia067bacc125b67e2d9e0cfc72495e4f13a8648ad
2013-02-25 19:47:29 -08:00
Stanislaw Pitucha f6015d8299 Remove function redefinitions
A number of tests have never been run due to another function having
the same name. Duplicate names have been changed and additionally
pyflakes check will now fail in such situations.

Also fix ovs ethernet driver test which was incorrect.

Change-Id: Icd93528395e65a24194a6ec5dfb8025a820d29b5
2013-02-21 22:35:13 +00:00
Jenkins 032308c792 Merge "Sync latest install_venv_common.py" 2013-02-20 15:22:27 +00:00
Mark McLoughlin b5fe418c81 Sync latest install_venv_common.py
Syncs:

  c78b2ab Avoid using cfg in install_venv_common

So that people don't need oslo-config installed to run install_venv

Change-Id: I05b69f043b276d5e6cd2df5d90bc679df6373383
2013-02-20 13:29:17 +00:00
Vishvananda Ishaya 7ca39a6039 Fix broken logging imports.
This fixes all of the files incorrectly importing logging directly
and removes the workaround in hacking.py that was due to improper
from nova.openstack.common.log import logging statements.

Change-Id: Icfc25dc148c4a7b5fa7f6a7b609cd6c3d94efee1
2013-02-19 21:16:32 -08:00
Vishvananda Ishaya 3b649422a6 Fix hacking test to handle namespace packages.
This removes our workaround for namespace packages and improves
detection of missing imports due to non-existent dependencies.

Fixes bug 1130411

Change-Id: I89ee8249580e395f786289792cdf74219d041f2f
2013-02-19 21:16:32 -08:00
Mark McLoughlin 706a137005 Use oslo-config-2013.1b4
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.1b4 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.

Make tools/hacking.py include oslo in IMPORT_EXCEPTIONS like it already
does for paste. It turns out imp.find_module() doesn't correct handle
namespace packages.

Retain dummy cfg.py file until keystoneclient middleware has been
updated (I18c450174277c8e2d15ed93879da6cd92074c27a).

Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
2013-02-19 21:16:32 -08:00
Jenkins 9d9bed9e68 Merge "Fix hacking tests on osx" 2013-02-19 03:38:29 +00:00
Vishvananda Ishaya d066a50e9a Fix hacking tests on osx
There were a few incompatibilities with the hacking tests and
OSX. Readlink -f doesn't work so use cd and pwd instead. Importing
a module with path separators doesn't work, so recursively import
the module. Finally the extra / in the find command was not needed.

Add a 'set -e' to run_pep8 to make sure test fails on any error

Ignore paste as it doesn't have an __init__ in its top level directory

Change-Id: Ifc66da7b872faa08f3be98f8b10486181ba77861
2013-02-18 12:12:23 -08:00
Jenkins 9e2b990f22 Merge "Fix script argument parsing." 2013-02-18 17:58:46 +00:00
Jenkins 235f9486d0 Merge "Update tools/regression_tester" 2013-02-16 01:35:05 +00:00
Rick Harris 0a93b563e9 Harmonize PEP8 checking between tox and run_tests.sh
Tox and run_tests.sh were running PEP8 checks against different
file-sets. This patch refactors the logic to determine which files to
run PEP8 checks on into `tools/run_pep8.sh` where it can be called by
both tox and `run_tests.sh`.

Additional fixes:

Some of our Python XenAPI Dom0 plugins don't end in *.py but should
still be checked by PEP8. This patches fixes the hacking.py violations
in the files and adds them back to the srcfiles list.

Merged tools/unused_imports.sh into tools/run_pep8.sh

Change-Id: Id5edd1acb644ab938beffc3473494a179d9d8cda
2013-02-15 00:39:58 +00:00
Brian Elliott cf51411531 Fix script argument parsing.
The vm_vdi_cleaner.py script's argument parsing was broken and unloved.

Change-Id: I1662534d65fd0e8472e092ed9f10d6cc059f1cab
2013-02-14 19:09:33 +00:00
Jenkins 53d8b4b252 Merge "Add "is not" test to hacking.py" 2013-02-14 04:27:46 +00:00
Attila Fazekas 5dd5625d97 Module import style checking changes
* Implementing the * import detection (it is disabled for now)
* New style relative import testing based on syntax rules
* Old style relative import testing based on module search
* Inspection based solution replaced by PYTHONPATH search
  in order to avoid module compile and initialization steps
  (code execution) in a syntax checking phase.

This solution is faster and safer, but does not able to recognize
modules added dynamically to the module scope.

Change-Id: Ifc871f4fdbcd4a9a736170ceb4475f4f2cbe66bc
2013-02-13 17:05:09 +01:00
Joe Gordon 339dd992b4 Add "is not" test to hacking.py
HACKING.rst was updated in I7534ef73e6fd525fd8f4bee594a4b37524699c08.
This adds hacking.py enforcement.

Change-Id: I5d75d536762449d0a7ae38213addd02aeceede0b
2013-02-12 17:46:23 -08:00
Joe Gordon 336eed6b24 Update tools/regression_tester
* Clarify wording (don't use 'success' and 'failure' instead use 'found'
  and 'no regression test')
* If don't pass gerrit review number run on current branch.  In
  preparation for running via jenkins.
* If no tests were changed, don't run any tests

Change-Id: I5e876e4e5071fc27461d2411fc33db1bf1724405
2013-02-12 17:13:21 -08:00
Jenkins 567050b091 Merge "replace ssh-keygen -m with a python equivalent" 2013-02-12 06:51:42 +00:00
Jenkins 20424b9879 Merge "support reloctable venv roots in testing framework" 2013-02-11 18:11:24 +00:00
Jenkins bce3806efe Merge "Add regression testing tool" 2013-02-07 23:41:19 +00:00
Chet Burgess 4c891b9243 support reloctable venv roots in testing framework
run_tests.sh, with_venv.sh, and the install_venv.py scripts now
support relocating the venv root to another location.

All 3 scripts now support new envinroment variables to configure
the location of the venv and the tools directory. To maintain
compatability the defaults are set to the current values.

venv_path = Location of the virtualenv directory
	Default: $(pwd)

venv_name = Name of the virtualenv directory
	Default: .venv

tools_path = Location of the tools directory
	Default: $(pwd)

Additionally the run_tests.sh script also takes these value as
arguments and will pass them along accordingly.

--virtual-env-path <path>   Location of the virtualenv directory
                             Default: $(pwd)
--virtual-env-name <name>   Name of the virtualenv directory
                             Default: .venv
--tools-path <dir>          Location of the tools directory
                             Default: $(pwd)

DocImpact

Change-Id: I1be036058227206ecca342f692cd3d6aadb24069
Fixes: bug #1116942
2013-02-07 12:38:45 -08:00
Joe Gordon 56b7cc79c6 Add regression testing tool
Tool detects if a gerrit patch contains tests to detect a regression

Usage: ./tools/regression_tester.py gerrit_review_number

Change-Id: I6353d1efda73fe5fc3098f928b6da9a28eb40590
2013-02-07 00:24:11 +00:00
Matthew Treinish cacc8ff92d Sync latest install_venv_common from oslo.
This commit syncs in the latest version of install_venv_common
from oslo, which fixes the import issue that was previously
addressed by change: I8a3df02a51c2c777d8f47cb8bc72d0644ae47095
which gets reverted by this commit.

Change-Id: I910610da5a4c413711819ca39627cb9ee94814ef
2013-02-06 16:26:08 -05:00
Davanum Srinivas 8d3933d3a1 replace ssh-keygen -m with a python equivalent
When running on latest released versions of Debian and RHEL/CentOS
we get Encryption failure with "ssh-keygen: illegal option -- m"

Fixes LP# 1102501

Change-Id: Ia54bf8f3e8d51c8baa09ba67d2e18ad214316989
NOTE: new dependency on pyasn1 python module
2013-02-05 10:49:11 -05:00
Kurt Taylor 5dcf4dd9b2 Added Postgres CI opportunistic test case
Added test case and support functions for CI opportunistic testing
using a PostgreSQL database, as part of our postgresql as a first
class citizen effort.

rebased again on top of test migration with data framework

clean up debug, and ensure pg will fail to connect gracefully

fix previous migration test which was inserting a key by id, which
postgresql doesn't like, as it doesn't adjust the autoincrement
counter.

added driver to connection string for mysql

Updated comment to expose how to do this on pg easily

Fixes:
bug 1084567

Change-Id: If0bfe5cf748f6d5724d17082be6d18b6f96f6ee4
2013-02-04 16:42:33 -05:00
Matthew Treinish 38c7fa2ab9 Fix import for install_venv.py
On systems that don't use devstack the nova directory
doesn't automatically get added to the python path. This
breaks tools/install_venv_common.py which imports from
nova.openstack.common. This fixes the issue by manually
adding the nova root directory to the python path before
tools/install_venv_common.py is imported.

Change-Id: I8a3df02a51c2c777d8f47cb8bc72d0644ae47095
2013-02-04 10:14:32 -05:00
Jenkins 922f81c18b Merge "import tools/flakes from oslo" 2013-02-02 16:30:17 +00:00
Joe Gordon 2cd4687683 Add 'not in' test to tools/hacking.py
N901: Use the 'not in' operator for collection membership evaluation

Change-Id: Ie156359d85dd089d68eb214f1569f27577800e17
2013-01-31 16:07:09 -08:00
Joe Gordon 64ded79907 import tools/flakes from oslo
Change-Id: Id6d99fe1fd39e8c061f591e9a82058aea9664674
2013-01-31 12:29:14 -08:00
Jenkins 4de4877f74 Merge "Use install_venv_common.py from oslo." 2013-01-31 02:54:43 +00:00
Jenkins d87c4517cc Merge "Add version constraint for cinder" 2013-01-29 21:24:42 +00:00
Joe Gordon 8af6c6b885 Make sure there are no unused import
Remove all currently unused imports
Prevent future unused imports

Change-Id: I6ac26d5c71b79952a7732db300355a00310c712e
2013-01-28 21:37:32 +00:00
Matthew Treinish c69ce047ad Use install_venv_common.py from oslo.
This syncs install_venv_common.py from oslo and reworks the
tools/install_venv.py script to use the new library.

Change-Id: I020eae1ec9e3a6aae0ecc7825c0ef723ab247f39
2013-01-28 13:57:59 -05:00
Jenkins 592d46aeb8 Merge "Add version constraint for coverage" 2013-01-28 15:17:38 +00:00
Jenkins f9012e39ee Merge "Fix hacking N302 import only modules" 2013-01-24 22:59:13 +00:00
Jenkins 113880fe16 Merge "Make failures in the periodic tests more detailed." 2013-01-24 17:38:45 +00:00
Joe Gordon 4845fc2720 Fix hacking N302 import only modules
* Includes some general tools/hacking cleanup
* Fix several N302 cases
* Disable N302 until all cases are fixed

Change-Id: Iddba07ff13e10dc41a6930749044bb8c0572d279
2013-01-24 09:52:58 -05:00
Robert Collins 65f9d214d0 Make failures in the periodic tests more detailed.
The current tests are very opaque when something fails. This change makes the
failure easier to understand without a debugger. The testtools version is
bumped to get a new HasLength matcher.

Change-Id: Iceafa70f88a8cc31a1b0ba912fe32a9fef1b2f18
2013-01-24 21:54:49 +13:00
Jenkins b1a2b077f1 Merge "xenapi: Add cleanup_sm_locks script" 2013-01-23 17:30:55 +00:00
Stanislaw Pitucha 8087e8d610 Add version constraint for coverage
Python coverage lower than 3.6 causes issues when running the whole
test suite. Some arguments are randomly mixed up with script names,
resulting in unittest failures like this:

UnexpectedMethodCallError: Unexpected method call.  unexpected:-  expected:+
- exists.__call__('/tmp/buildd/.../nova/virt/images.py') -> None
+ exists.__call__('/some/path') -> True

Change-Id: Iadb6d046e3acc75c6ed5abffcfc1abda82aeee4f
2013-01-23 13:11:41 +00:00
Jenkins a8a0826ea6 Merge "Go back to the original branch after pylint check" 2013-01-23 13:10:50 +00:00
Jenkins bb108c6bd3 Merge "Sync latest cfg from oslo-incubator" 2013-01-23 12:52:12 +00:00
Jenkins 5309d3cebd Merge "Cleanup of extract_opts.py" 2013-01-23 06:03:50 +00:00
Rick Harris c8f0720511 xenapi: Add cleanup_sm_locks script
XenServer 5.6 and 6.0 don't appear to be cleaning up sm locks when using
a FileSR. When enough locks accumulate, this causes image related
operations to fail.

This cleanup script is a stop-gap solution that can be run against all
of the dom0's in the cluster to prevent too many locks from
accumulating.

We can remove this script when the root-cause is fixed upstream.

References 1103158

Change-Id: I798bcfeb727a59003910b82d331fdbe031c4a2b4
2013-01-22 23:15:54 +00:00
Stanislaw Pitucha 5cba7edfae Add version constraint for cinder
Cinder client usage requires the "retries" parameter introduced in
cinderclient-1.0.1. This should be a constraint in pip-requires.

Change-Id: I36e8a363c9d4bb7cc4ecfda85644fc4284f17471
2013-01-22 13:05:03 +00:00
Zhongyue Luo 4a04aacef3 Cleanup of extract_opts.py
Moved global variables to the top.
Removed once used variables
Used option type definitions in OPT_TYPES

Change-Id: Ia0bf39933bac84dbf432e6b4590ceb2527e6889c
2013-01-22 14:14:55 +08:00
Robert Collins bd422b2d1f Unpin testtools.
Change-Id: If760a7b6f8771d9f9ac2722c300032e715e34151
2013-01-22 13:17:04 +13:00
Mark McLoughlin 8d5891e5bc Sync latest cfg from oslo-incubator
The main change is:

  c5984ba Move logging config options into the log module

Re-generate nova.conf.sample to reflect the options move.

Change-Id: I3913ea54465658d93dc56e014dfe5d911b0541d6
2013-01-21 16:57:32 +00:00