Commit Graph

455 Commits

Author SHA1 Message Date
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
Johannes Erdfelt 254333a78d Avoid testtools 0.9.25
Fixes bug 1102400

testtools 0.9.25 introduces a new dependency on the 'extras' package, but
it does so in a way to prevents itself from being installed without the
'extras' package already installed.

Work around the problem for now by avoiding the problematic release.

Change-Id: Ib42ffc67f00db62f9b829069c00476632daae94f
2013-01-21 16:24:20 +00:00
Jenkins 888de921ee Merge "Fix multi line docstring tests in hacking.py" 2013-01-19 14:52:19 +00:00
Jenkins e03374725f Merge "don't allow crs in the code" 2013-01-18 17:51:06 +00:00
Yun Mao af5936f4aa Go back to the original branch after pylint check
Previously we save the current commit hash before running lintstack.
This is no problem for Jenkins but not very friendly if we run
lintstack locally. Every time after it's done, git is in detached
HEAD mode. This patch remembers the current branch name and
automatically go back to the branch if available. Otherwise we fall
back to the commit hash.

Part of blueprint lintstack

Change-Id: I145df3027022fc9a8302bc6da9ab300f677f3386
2013-01-17 18:01:43 -05:00
Joe Gordon 2704a40e57 Fix multi line docstring tests in hacking.py
* Fixes N403, along with docstring test
* Adds N404, multi line start
* Disable N403 and N404 until all cases are fixed
* Remove obsolote '--repeat' flag from tox.ini

Change-Id: Ibf6371efc1cdc764e66f6f7c5c4362440101f963
2013-01-17 13:24:31 -05:00
Jenkins bd8399bd2f Merge "Pull NovaWebSocketProxy class out of nova-novncproxy binary" 2013-01-17 11:59:12 +00:00
Sean Dague 6556b8650f don't allow crs in the code
triggered by this slipping into quantum, now that we have more windows
developers we should ensure that \r\n doesn't land in the code as
a line ending. This check prevents it.

Change-Id: I0a82be0e74915d3c3c25203db110d279580c148b
2013-01-16 18:41:54 -05:00
Jenkins 3c6daa9a0b Merge "Use testrepository setuptools support." 2013-01-16 17:19:37 +00:00
Daniel P. Berrange e71e8c2a89 Pull NovaWebSocketProxy class out of nova-novncproxy binary
To allow sharing of proxy code between nova-novncproxy and
nova-spicehtml5proxy, pull the NovaWebSocketProxy class
out of nova-novncproxy into a new nova/console/websocketproxy.py
file

Adds previously missing websockify dep to pip-requires.

Blueprint: libvirt-spice
Change-Id: If1334256680e7075598f00ce153cf6f021cc720f
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-01-16 10:19:37 +00:00
Monty Taylor a0c3e67cb5 Use testrepository setuptools support.
The previous false-positive bug was fixed upstream in 0.0.13.

Change-Id: Iceb07a511992249c104bbc7c34b7c35e01bd9fbd
2013-01-14 23:17:12 -08:00
James E. Blair 9576c6fdeb Revert "Use testr setuptools commands."
This reverts commit c945b71929
which caused the unit test command to always exit sucessfully.

Change-Id: I410cbc878675503f0ce6e50bddc4fd0552370c46
2013-01-14 14:05:50 -08:00