85 Commits

Author SHA1 Message Date
Joe Gordon
f8437e37d4 Enable checking for imports in alphabetical order
And fix existing alphabetical ordering problems

Change-Id: I3ab887e118adc8022c84ff7230e7cc2d261804f6
2012-05-22 10:44:00 -07:00
Lorin Hochstein
190b4e27c8 Ignore common code in coverage calculations.
Ignore nova/openstack/common code when calculating coverage.

We do this because the unit tests for the common code are in a
different repository.

Change-Id: I0103b8acfc4cdaace68a18b1d1723a13595debe2
2012-04-28 22:06:07 -04:00
Jenkins
9bd0504bd3 Merge "Scope coverage report generation to nova module." 2012-04-25 07:09:13 +00:00
Joe Gordon
7ee0d7848d Improved tools/hacking.py
* cleaner output
* fix bug 980009
* Fix N201
* N306: alphabetical order imports
* N401: docstring start
* N402: one line docstring start
* N403: multi line docstring end
* Until fixed, N40* will be disabled by default

Change-Id: I9addafdaa7a1f8fb950e14a5409f661dec6c7b87
2012-04-24 09:29:43 -07:00
Renier Morales
bcb53dfc6a Scope coverage report generation to nova module.
Coverage report generation was not using --include filters.
This resulted in generating a report that included all external
dependencies. Some of these may include problematic characters for
utf8 decoding. In the odd case this was found, coverage would fail
with a UnicodeDecodeError.

Fixes bug #987077.

Change-Id: I276698e65ac1037972209a406058168433cd826b
2012-04-24 07:58:25 -04:00
Dan Prince
2b490fd2ef Exclude xenapi plugins from pep8/hacking checks.
Fixes LP Bug #987055.

Change-Id: I7132b88c5e0a90b16d0f8e35df45b82e7991280f
2012-04-22 21:11:03 -04:00
Johannes Erdfelt
c808df7005 Make run_tests.sh just a little bit less verbose
Change-Id: I9d4dc11083cb51040677eeda2d28d4b23539a304
2012-04-12 17:01:58 +00:00
Yuriy Taraday
07bbe57754 Run tools/hacking.py instead of pep8 mandatory.
Change-Id: I81db73588ece36dec4dba90b9841ed6d0fac6a8f
2012-04-10 13:18:32 +04:00
Rick Harris
203d51f0e4 Remove unecessary --repeat option for pep8.
Fixes bug 977489

--repeat became the default in 0.7; since we're now requiring 1.0 or
above, this can go away.

Change-Id: I85ee8ab274594ce96ece6610247dfd8a6f082af5
2012-04-09 20:43:50 +00:00
Brian Elliott
549616d122 bug 968452
Update test-requires to use pep8>=1.0.  Removed PEP8 warning suppression
around 3-arg raises.

Change-Id: Ib4ed42adc167aa1e8078619a36b409b76b9f5d73
2012-04-09 19:06:03 +00:00
Hengqing Hu
9a042d3c50 Remove trailing whitespaces in regular file
Fixes bug #945346

Change-Id: I07a303c2e503e50d7138585c683e0d1310339276
2012-03-07 13:43:37 +08:00
Jason Kölker
a7df900895 Monkey patch migrate < 0.7.3
* Works around migrate issue 72 [1] by monkey patching migrate prior
  to import.
* Removes previous workaround
* Refactor test config to work under nosetests directly
* Fixes LP940407

1: https://code.google.com/p/sqlalchemy-migrate/issues/detail?id=72

Change-Id: I219e4cecf8bb2e34ae238ac270428f496378ee61
2012-02-24 21:55:52 -06:00
Jenkins
0c6765a71a Merge "Make database downgrade works" 2012-02-23 02:52:43 +00:00
Joe Gordon
1fc7c0c534 Clarify use of Use of deprecated md5 library
See Invalid bug 937463 for more details
Also change run_tests.sh to ignore more '*.pyc' files

Change-Id: I8c8ded902833fe4268966ff7a9630daaaad43a19
2012-02-21 09:06:08 -08:00
Monty Taylor
f86ec68be7 Stop ignoring E202.
There is absolutely no reason to ignore E202 in the pep8 checks.

Change-Id: I4abf767639dd94e9e8b7b4a405b4a702a554b876
2012-02-20 12:21:59 -08:00
Jenkins
52fbabc8af Merge "run_tests.sh fix" 2012-02-17 17:31:51 +00:00
Hengqing Hu
8e825c4024 Make database downgrade works
Fixes bug #854905

Use sqlalchemy reflection whenever possible:
    http://sqlalchemy-migrate.readthedocs.org/en/latest/versioning.html

Work around sqlalchemy-migrate sqlite 'bool column not deletable' issue:
    http://code.google.com/p/sqlalchemy-migrate/issues/detail?id=143
    Add following sql scripts for sqlite:
        002_sqlite_downgrade.sql
        015_sqlite_downgrade.sql
        033_sqlite_downgrade.sql
        050_sqlite_downgrade.sql
        068_sqlite_downgrade.sql

Work around sqlalchemy-migrate sqlite 'table with foreign key column not
deletable' issue:
    http://code.google.com/p/sqlalchemy-migrate/issues/detail?id=94
    Add following sql scripts for sqlite:
        003_sqlite_downgrade.sql
        006_sqlite_downgrade.sql
        007_sqlite_downgrade.sql
        012_sqlite_upgrade.sql
        013_sqlite_downgrade.sql
        020_sqlite_downgrade.sql
        030_sqlite_downgrade.sql
        038_sqlite_downgrade.sql
        042_sqlite_downgrade.sql
        053_sqlite_downgrade.sql
        067_sqlite_downgrade.sql

Work around sqlalchemy-migrate 'migrate drops engine reference' issue:
    http://code.google.com/p/sqlalchemy-migrate/issues/detail?id=72

Add following sql scripts for long primary key to work with utf-8
mysql table:
    072_mysql_upgrade.sql

Add following sql scripts for postgresql:
    002_postgresql_downgrade.sql

Add snake walk test cases for database migration based on glance migration
test.

Change-Id: Ib454ecb4662bbf47736c1b12d9a4f969f180ceb6
2012-02-17 18:30:09 +08:00
Joe Gordon
a1890ea22f clean pyc files before running unit tests
Change-Id: If7ad58f131d8b780125df7ecb5c4081014064f72
2012-02-13 17:58:52 -08:00
Zhongyue Luo
e6c07cbc8b run_tests.sh fix
Fixes bug #929369

Fix "api-paste.ini* to "*api-paste.ini*" and
remove duplicate definitions of srcfiles.

Change-Id: I859783457d6c5df3f6e998e752cad648ca109b9c
2012-02-14 01:18:49 +00:00
Armando Migliaccio
61e6f4e34a bug 929428: pep8 validation on all xapi plugins
check every python file under <nova_root>/plugins/xenserver/.
Ignore patch files.

Change-Id: Ib1170ddabe03de746aae570d30b133aaffb09c88
2012-02-09 10:32:24 +00:00
Zhongyue Luo
6b2fbd44f9 pep8 check on api-paste.ini when using devstack
Fixes bug #928976

Avoid pep8 check on api-paste.ini

Change-Id: I14e84e3c704c4e90d87c73e484d8eb3b63803743
2012-02-08 11:44:39 -05:00
Thierry Carrez
71410724cd Remove ajaxterm from Nova
Removes copy of ajaxterm code, nova-ajax-console-proxy,
and support for get_ajax_console from Nova proper.

Implements blueprint remove-ajaxterm
Fixes bug 917963

Change-Id: I2c0ff427c53c0f63a18b10475d6b4cbe9a085d83
2012-02-07 21:14:31 +01:00
Joe Gordon
9a08e00548 Add HACKING compliance testing to run_test.sh
Tests so far:
N101 TODO format
N201 Except format
N301 One import per line
N302 import only modules
N303 Invalid Import
N304 Relative Import

Change-Id: I33c021b842e7199b1f5f1f699ea17f7fa5f8ca49
2012-01-24 10:54:17 -08:00
Rick Harris
8480d74fa1 Making pep8 output less verbose.
Fixes bug #904559

Change-Id: I078b060483890bf8bfc9b78d3174370dea4d6bbc
2011-12-14 20:59:33 -06:00
James E. Blair
5235106e95 Rename .nova-venv to .venv.
This simplifies a number of Jenkins jobs which currently, other
than directory names, could be the same for all OpenStack
projects. By renaming the virtualenv directory, the redundant
Jenkins virtualenv build and copy jobs can be eliminated.

Change-Id: Ieaf1dac3207ecb34b911c7edcd2086809abdf49e
2011-12-08 15:17:51 -08:00
Jenkins
0b28e574af Merge "First steps towards consolidating testing infrastructure" 2011-12-07 18:13:48 +00:00
Duncan McGreggor
f845891184 First steps towards consolidating testing infrastructure
This commit begins to implement blueprint consolidate-testing-infrastructure by
adding a 'testing' subpackage and moving some modules into it.

Change-Id: I04bf860bc386bd2016e7dbc5a6f6ef7379a855bb
2011-12-06 09:37:57 -08:00
Mark McLoughlin
0bbb0e8cb1 Remove some remnants of ChangeLog and vcsversion.py generation
Since moving to bzr, we no longer generate ChangeLog and vcsversion.py
and since commit deb31cb55 we no longer even have the bzr specific code
for generating them. So, let's just remove any references to them.

Change-Id: I4f96b9be48e289f9129ae8e3ad4cbc1b22db07d2
2011-12-06 12:08:43 +00:00
Lorin Hochstein
b08bd96ce5 Optional --no-site-packages in venv
Added a flag to run_tests.sh to allow user to optionally install venv with --no-site-packages.

This fixes bug 880905

Change-Id: Ic645e0ec56c90b72fef526ebc9f55975d446e2ae
2011-10-30 11:06:10 -04:00
Rick Harris
f225ea4f2f Deallocate ip if build fails.
Fixes LP837687

Change-Id: I7c0ea900225024e69a0265c430724930ce7b892d
2011-09-30 10:33:15 -05:00
Monty Taylor
21dcf669c7 Fix outstanding pep8 errors for a clean trunk.
Also, add an option to run_tests.sh to skip running pep8. We have a separate
job in Jenkins which runs pep8, so there's no need to spin our wheels on it
during the test run.

Change-Id: I552330994e55a36fa96b63658493ed30e2720c85
2011-09-23 10:26:22 -04:00
Ewan Mellor
07cbdbedca Bug #835952: pep8 failures do not cause the tests to fail
Add set -eu to run_tests.sh.  This will cause it to fail whenever anything
goes wrong, which is exactly what we want in a test script.

To do this, I had to remove the use of the "let" keyword, which has a bizarre
exit status in bash.

I also removed the "|| exit" after run_tests, which means that this script
will now exit with status 1, not status 0, if run_tests fails.
2011-08-28 16:19:55 +05:30
Christopher MacGown
91eaa64750 Fix ugly little violations before someone says anything 2011-08-12 14:33:27 -07:00
Christopher MacGown
3f82580b98 Merge config_drive with trunk 2011-08-12 14:23:10 -07:00
Christopher MacGown
d963e25906 Config-Drive happiness, minus smoketest 2011-07-22 20:29:37 -07:00
Lorin Hochstein
85ba5628d6 Slight indentation change 2011-07-21 10:47:34 -04:00
Lorin Hochstein
6e59df9151 Added call to second coverage invocation 2011-07-21 10:43:20 -04:00
Lorin Hochstein
eed00e5c82 Fixed an issue where was invoked before it was defined in the case of a venv 2011-07-21 10:30:55 -04:00
Lorin Hochstein
90c8a7c73d Zapped an extra newline 2011-07-19 11:04:36 -04:00
Lorin Hochstein
05751530cd Add support for generating local code coverage report 2011-07-19 10:52:38 -04:00
Thierry Carrez
7c270b077a Silence warning in case tests.sqlite doesn't exist 2011-07-04 17:31:24 +02:00
Vishvananda Ishaya
c6e220af60 change the default to recreate the db but allow -n for faster tests 2011-06-29 07:47:51 -07:00
Vishvananda Ishaya
9978d656d2 only create the db if it doesn't exist, add an option -r to run_tests.py to delete it 2011-06-25 17:26:38 -07:00
Rick Harris
43dd1ec608 Showing elapsed time is now default 2011-06-15 01:21:11 +00:00
Rick Harris
e20444542a Ensuring pep8 runs even when nose optons are passed 2011-06-15 01:16:53 +00:00
Rick Harris
3368a35ff9 Removing seconds unit 2011-06-15 00:08:19 +00:00
Rick Harris
00071a6e0b Adds --show-elapsed option for run_tests 2011-06-14 01:21:08 +00:00
Alex Meade
d4742cf850 Added virtual environment to PEP8 tests 2011-06-07 16:08:25 -04:00
Justin Shepherd
67148b1093 Added opt-out system for excluding files/dirs from pep8 (using GLOBIGNORE). 2011-05-16 20:08:51 -05:00
Justin Shepherd
e2a1258458 Removed tools/clean_vlans and tools/nova-debug from pep8 tests as they are shell scripts 2011-05-16 08:26:39 -05:00