Commit Graph

31 Commits

Author SHA1 Message Date
Monty Taylor c945b71929 Use testr setuptools commands.
Replace the embedded shell scripts with setuptools commands provided by
upstream. Cleans up a few warnings that this cause tox to show.

Change-Id: I9eb47142eafb6ed038b358b94984462ca1632542
2013-01-12 13:33:42 -08:00
Sean Dague edca0c2a3d make runtests -p act more like tox
now that all the N402 fixes are in, start enforcing it

Change-Id: I9d495849bf698e5af142d0ccafe551ac0e8a600c
2013-01-10 08:57:49 -05:00
Jenkins fa4696ff03 Merge "fix N401 errors, stop ignoring all N4* errors" 2013-01-09 01:01:57 +00:00
Sean Dague 37bfdd3b38 fix N401 errors, stop ignoring all N4* errors
We had previously been ignoring all our custom N4xx hacking.py
errors. This fixes all the N401 errors "doc strings
should not start with a space" and reduces the ignore set down
to N402 only "single line docstrings should end with period".

It also fixes the N401 parser to catch only docstrings, and
not tripple quoted string blocks used later on in a function.

Clean up a few of the more crazy uses of """ in our code

Clean up additional funky comments to make indents a bit more
consistent, and pull in lines when possible.

Change-Id: I9040a1d2ca7efda83bd5e425b95d1408b5b63577
2013-01-07 21:39:58 -05:00
Clark Boylan 7224fde0f0 Invert test stream capture logic for debugging.
Previously the default test behavior was to capture stdout and stderr.
Make the new default to not capture stdout and stderr then set
.testr.conf to always capture these streams when running tests under
testr.

The motiviation behind this change is that you will want these streams
to be captured when running under testr, but when not running under
testr you may not want to capture them. An example of this would be
running `python -m testtools.run test_name` with a change to test_name
to invoke the python debugger (capturing stdout and stderr interferes
with normal debugger functionality).

Also, only invoke the test timeout by default when running under testr.
This is done for the same reason as above. When running a test under the
debugger the timeout interferes with debugging.

Change-Id: I42cbbdadb2f221ec439e92a6800d14e8436bb77b
2013-01-07 11:03:30 -08:00
Clark Boylan 4abc8cc64f Use testr to run nova unittests.
Convert nova from using nosetests to testr for its test runner. Some
tests had to be modified to get them to run properly under testr.

run_tests.sh has been updated to run testr instead of nosetests.

Coverage is collected by running subunit.run under coverage.py when the
coverage environment is selected.

Note that you will need to rebuild your virtualenvs as nose is being
removed from the dependency lists and is being replaced by testr. Tests
will run in different processes once this test is merged so you cannot
use test classes to pass information between tests. Each test should be
a proper independent unit. Additionally the -x and -d flags to
run_tests.sh have been removed as there are currently no decent
approximations for those functions.

Change-Id: I019ca098972ca749b195f59968cf21edd5ba9109
2012-12-14 14:22:20 -08:00
Joe Gordon a44ace3196 Fix pep8 exclude logic for 1.3.3
* With pep8 1.3.3 the exclude logic monkey patch broke causing
  tools/hacking to run on openstack/common code
* Also add .git to exclude list

Fix bug 1086410

Change-Id: Ifc50ac1963c50c338432bbb4b1e15cdf58ed2128
2012-12-06 11:19:17 +02:00
Joe Gordon 65ee45c641 Add pyflakes option to tox
* Uses pyflakes wrapper to ignore gettext errors
* Based on: https://bugs.launchpad.net/pyflakes/+bug/844592

Change-Id: I4fd947176f5258f89f517acf5dda2ded4a2da15e
2012-12-04 11:53:29 +02:00
Chuck Short 560e5cd84e Pin pep8 to 1.3.3
Apart of making pep8 version standard across all openstack
projects.

With this change we ignore E712 since it is normal to use
"column == True" in sqlalchemy.

Change-Id: I73a162847a79558cb158112878033edf18039805
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2012-11-19 21:20:42 -06:00
Yun Mao add01f874a Upgrade pylint version to 0.26.0
Upgrade pylint to reduce false positives in lintstack.

Change-Id: I10ab7a46c6a70daf9151f03cd9fea3c4851e6ebb
2012-11-12 10:14:35 -05:00
Dan Prince f0437edd8b Make tox.ini run pep8/hacking checks on bin.
This updates the pep8 hacking checks in our tox.ini file so that
we are also scanning the bin directory for HACKING violations.

Change-Id: I4b010ef4dd799f0afe0fcd56c823a611021e8f60
2012-11-09 12:28:46 -05:00
Joe Gordon c39dbb53bc Fix and enable pep8 E502, E712
pep8 E502 and E712 were temporarily disabld when upgrading to pep8 1.2

Change-Id: If5158304cb8e73ef844dea9f726df6f8fe305269
2012-10-22 13:47:36 -07:00
Joe Gordon fbc4568eb0 Update tools hacking for pep8 1.2 and beyond
* https://github.com/jcrocholl/pep8/commit/b9f72b16011aac981ce9e3a47fd0ffb1d3d2e085
  broke tools/hacking.py
* Upgrade pep8 to 1.2 and disable the following new tests: E12,E711,E712,E721,E502

Change-Id: I32a8808c6c9cccfedcc4d2a26649333aca1cd713
2012-10-01 16:33:35 -07:00
James E. Blair 6e9f3bb10a Revert "Add full test environment."
This reverts commit 30e513309f.

The python mysql module was removed from test-requires in favor
of test-options, but the work to actually use that was never
completed.  Revert the change so that mysql testing is actually
performed again.

Change-Id: Iaf35811cc748272229260f2dab95520995a69b44
2012-09-28 13:04:53 -07:00
Joe Gordon 0876cf5bc5 Do not run pylint by default
pylint creates some files, and leaves git in a detached HEAD.

pylint can still be run via 'tox -epylint'

Change-Id: Ic0193f2488f1c6eb4a9f0fabbe24ac9869239890
2012-08-28 15:14:11 -07:00
Yun Mao 09eb54c48f Add lintstack error checker based on pylint
Add a new silent test target lintstack based on pylint in Jenkins.
lintstack will compare the pylint errors between HEAD and HEAD~1,
filter out known false positives and report violations in pylint
original parseable format for Jenkins to consume.

Change-Id: Ic2962cb42a174bfe9535aea88475ff4ede3bf9ff
2012-08-24 15:36:47 -04:00
Jian Wen 55b37bef9b Disable I18N in Nova's test suites
Messages translated into other language like Chinese cause some
unit tests to fail.

Fixes LP bug #1037946.

Change-Id: I01d04333d28bab52d6f424432524b206f3845fba
2012-08-18 00:00:00 +08:00
Monty Taylor b71e86d4d7 Fix broken pep8 exclude processing.
First of all, our pep8 exclude was excluding openstack, to trap
for not doing pep8 checks on openstack/common, which comes from elsewhere.
But, pep8 strips filenames down to basename when doing exclude checks on
them, which makes no sense. To fix this, grab the two functions from pep8,
fix them, and monkeypatch them from within hacking.py.

Patch has been submitted upstream as:

  https://github.com/jcrocholl/pep8/pull/111

Also, changed the exclude to catch just openstack/common.

Change-Id: If0b18ae828e74203f84a8b6f8b4ba0100b3bbc59
2012-08-03 12:15:44 -05:00
Joe Gordon 9b66e81d2b Use all deps for tools/hacking.py tests in tox
tools/hacking needs pip modules to accuratly run nova_import_module_only

Change-Id: I19eb624cc32a15438666e5710394a77d13b50763
2012-07-13 16:13:24 -07:00
Dan Prince 1ef88fdd5b Exclude openstack-common from pep8 checks.
Updates tox.ini and run_tests.sh to exclude openstack-common code
from pep8 checks.

Fixes LP Bug #1020792

Change-Id: I6bb9747f86f7677f0e9c4169c04d6f3fbd4b3480
2012-07-13 13:59:56 -04:00
Monty Taylor 8d8d3b4296 Run hacking tests as part of the gate.
Nova has additional pep8 "plugins" that they expect to run as part of the
gate. This patch will run tools/hacking.py instead of pep8 directly. Also,
it fixes the hacking violaions in contrib, plugins and smoketests.

Fixes bug 1010136

Change-Id: I86d8789218c197d5d4a43d1201465d340646a395
2012-07-02 08:50:41 -04:00
Jenkins 1a2a3519ee Merge "Use setuptools-git plugin for MANIFEST." 2012-06-28 21:38:53 +00:00
Monty Taylor 204a42c76f Use setuptools-git plugin for MANIFEST.
Instead of a hard-coded MANIFEST.in to list non-code files to be included in
the tarball, use the setuptools-git plugin to ensure that every file that's
in git will wind up in the tarball. The only things needed in MANIFEST.in
now are files that are generated as part of the sdist run.

Change-Id: I76df685d58f7b56977d859e8df92e845f450b3e4
2012-06-28 07:42:48 -07:00
Monty Taylor 30e513309f Add full test environment.
Add a tox environment that will install all of the optional
packages and which will run with system site packages enabled
so that we pick up those tests as well. This should allow us
to run expansive tests on jenkins that aren't normally required
locally, but which are possible.

Change-Id: Iabd61874061e24950d4d2082a2fba158b4601624
2012-06-25 14:00:31 -05:00
Monty Taylor cf34a60157 Finalize tox config.
Shrink tox.ini to the new short version.
Fix the test cases to be able to be run in nosetets plus the
openstack.nose_plugin, which finally removes the need for
nova/testing/runner.py
Also, now we'll just output directly to stdout, which will
make nose collect the trace logging directly and either output
it at the end of the run, or inject it into the xunit output
appropriately.

Change-Id: I1456e18a11a840145492038108bdfe812c8230d1
2012-06-07 12:15:42 -04:00
Monty Taylor e79356b86a Run coverage tests via xcover for jenkins.
In the jenkins jobs, we need to run coverage with xunit output so that
jenkins can parse it.

Change-Id: Ie4cfec6f89d6b37554b5345cde92f982397915e2
2012-05-25 15:36:50 -04:00
Brian Waldon 317378f742 Update pep8 dependency to v1.1
The latest release of pep8 adds stricter rules for extraneous
whitespace within lines. This patch also addresses these new
violations acoss the codebase.

Change-Id: Ib7e50281870473df1704ed50868c5c2e26bdb02e
2012-05-24 06:59:05 -07:00
Dan Prince e3d7d3a805 Nail pep8 dependencies to 1.0.1.
Nails the pep8 deps for tox and test-requires to 1.0.1.
Fixes an issues causing pep8 failures due to a new pep8 release.

Change-Id: I30be4909f052c29834afbfddba6007045afa519b
2012-05-24 09:42:50 -04:00
Monty Taylor b279d8a547 Allow sitepackages on jenkins.
Since our overall environment on the jenkins slaves is controlled,
it's safe to allow site-packages. BUT - more importantly, it's the
only way to get python-libvirt to be accessed.

Change-Id: I1181127a134afdfc1de58d0ab819395bb8995647
2012-05-07 14:07:18 -07:00
Monty Taylor ff3f92008c Add missing directive to tox.ini.
Change-Id: Ib6d178af62f631de76e66c2bb6c07fd6b277fa97
2012-02-25 17:09:47 -08:00
Monty Taylor 51210081a8 Support tox-based unittests.
Change-Id: I6a0a616a979688595762e6b772d77a14f1968070
2012-02-20 11:54:37 -08:00