Commit Graph

90 Commits

Author SHA1 Message Date
Stephen Finucane 450bacb04a Retire gantt
Change-Id: I8b84f777bf977d2a3dbba4b2ef61c9380205a049
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2019-01-11 10:44:08 +00:00
Ondřej Nový 172af7533c Deprecated tox -downloadcache option removed
Caching is enabled by default from pip version 6.0

More info:
https://testrun.org/tox/latest/config.html#confval-downloadcache=path
https://pip.pypa.io/en/stable/reference/pip_install/#caching

Change-Id: Icd9decce432257947586d1355102f8c53a36e12b
2015-12-11 21:16:33 +01:00
Monty Taylor 19a539910f Make it abundantly clear that Gantt is dead
There is still confusion. Delete the files.

Change-Id: I00e4d9a644743afe5e8567c7dc2b20feef5c97bb
2015-03-31 15:32:27 -04:00
Jeremy Stanley 0f6aa7e63e Remove tox locale overrides
* tox.ini: The LANG, LANGUAGE and LC_ALL environment overrides were
introduced originally during the testr migration in an attempt to be
conservative about the possibility that locale settings in the
calling environment could cause consistency problems for test runs.
In actuality, this should be unnecessary and any place where it does
cause issues ought to be considered an actual bug. Also, having
these in the configuration actively causes older pip to have
problems with non-ASCII content in some package metadata files under
Python 3, so drop it now.

Change-Id: I4c13666af09758e5dcff026c555220f9069d84de
Closes-Bug: #1277495
2014-02-10 02:59:40 +00:00
Don Dugger 989a2d04bb Get gantt to pass unit tests
Mostly a matter of having the appropriate modules imported from
the gantt tree rather than the nova tree.

Note that code can still import from the nova tree but this is only
for non-scheduler related files.  Ultimately we will remove all
nova references from the gantt code but that is a future project.

With these changes we can now have Jenkins gate on the unit tests.

Change-Id: I3bcc9742cc9ab4188f67c2aa66ad97eca2bc08bb
2014-02-06 09:07:42 -07:00
Don Dugger e62cc17eb7 Add/remove nova files
Delete files that are not needed.

Add back in some nova files that are needed.

Also, resync the gantt/version.py from the nova tree, we
need the new version of this file.

Change-Id: I48ab670502417d588eb8ffd6044667ed5a9e1560
2014-02-06 09:05:43 -07:00
Don Dugger 71411726d6 Change various nova references to gantt in config files
This file was copied from the nova tree, remove some nova specific info.

Need to keep the gettextutils reference.

Update the setup.cfg file also.

Change-Id: I0cb66e6620900fd318f45d758a94f95b144e006a
Signed-off-by: Don Dugger <donald.d.dugger@intel.com>
2014-01-05 14:46:46 -07:00
Joe Gordon a4883260df Minimal changes to get gantt passing the gate
This is the smallest set of changes needed to unwedge the gate. Because
the gate is wedged all these changes need to be in a single patch in
order to fix it.

* point .gitreview at correct repo

pep8
* Don't run tools/config/check_uptodate.sh, we don't even have a config
  file to check yet.
* gantt, doesn't have any local hacking checks yet so remove that
  section from tox.ini
* Update import_exceptions in tox.ini

pylint
* copy lintstack code in from nova.

docs
* add gantt version code, copied in from nova

Change-Id: I1d7adb5bf1bf383a2f8543dda6eb4cdeb26f3b9a
2013-12-26 22:36:27 -08:00
Chris Yeoh f16b9875f3 Don't gate on E125
E125 overreaches on what pep8 specifies. See
https://github.com/jcrocholl/pep8/issues/126

In practice E125 can be a pain as compliance requires
manual indenting if using emacs and refactoring tools
don't always get it right.

There's a bit of a discussion about it here (on a tempest
changeset):

https://review.openstack.org/#/c/36788/

Change-Id: Ic73ab3c4a47f33de9145e0c7db2d8674230c2fe0
2013-11-26 23:11:45 +10:30
lawrancejing fc2498fd3a Remove extra space in tox.ini
Change-Id: I19060db8622e5747ab19a11a8eafe3144d61abe9
2013-10-24 12:54:17 +08:00
Mark McLoughlin 289c56141b Remove obsolete redhat-eventlet.patch
See I62ce43a330d7ae94eda4c7498782a655e63747fa for the gorey details on
why this exists.

As of this fix:

https://github.com/eventlet/eventlet/pull/34

which was released in eventlet 0.13, we no longer need the patch.

This has now been removed from oslo-incubator, so this is really just
syncing that removal.

Change-Id: I84267f3c6726cb2e750f615e107c48b12c6ed353
2013-10-09 21:34:58 +01:00
jmeridth 64048beac3 xenapi: fix pep8 violations in nova plugins
Removed plugins/xenserver from tox.ini excludes list, ran tox -e pep8, and
fixed violations.

Fixes: bug 1197893
Change-Id: I8e0116304b07d54c49a01202b3ce6d3426097bb4
2013-09-17 16:44:59 +00:00
Robert Collins 674cfc73f1 Ignore H803 from Hacking.
H803 checks for a period in commit messages, something the community
clearly rejected as a sensible check: periods in commit messages
should neither be rejected or required.

Change-Id: I866928c638d23a307f4c11b7cb947e88f90f1ab2
2013-09-13 13:56:35 +12:00
Jenkins 84ddc2a711 Merge "Have tox install via setup.py develop" 2013-09-04 04:46:27 +00:00
Joe Gordon a395699145 Fix and gate on H302 (import only modules)
H302 is already part of the OpenStack style guide, and we only had a few
violations.  This fixes and gates on H302, so there is one less thing
for a reviewer to worry about.

gettext import line is ignored using hacking 0.7's import_exceptions
option.

Reason for import only modules 'The namespace management convention is
simple. The source of each identifier is indicated in a consistent way;
x.Obj says that object Obj is defined in module x.'
http://google-styleguide.googlecode.com/svn/trunk/pyguide.html

Change-Id: I53e8039f1dd2ebf8ab5fcf5a561feb3ca3363107
2013-08-29 12:01:07 -04:00
Monty Taylor d2a0777899 Have tox install via setup.py develop
tox 1.6 was released, which means that we can now take advantage of the
feature we added to it - which is using setup.py develop to install the
code into the virtualenv. The logic was taken from run_tests.sh - so the
performance issues around using tox vs. using install_venv should now be
gone.

run_tests.sh is still needed to handle the ui switching between
parallel, single and debug modes to testr.

Change-Id: Ida5e440d1bdb9f8e9031277ea53a02d2ef171438
2013-08-16 14:17:46 -04:00
Jenkins 46dfb3b140 Merge "Fix H501: Do not use locals() for string formatting" 2013-08-13 13:51:04 +00:00
Jenkins 1ab37e1ed2 Merge "Add note why E712 is ignored" 2013-08-11 11:04:31 +00:00
Dirk Mueller e33da68e3f Fix H501: Do not use locals() for string formatting
Change-Id: Ide587d3311c22f698a82eeee210c5bdbe24eb484
2013-08-10 13:53:00 +02:00
Boris Pavlovic 8ad823f5dd Finish DB session cleanup
Remove session parameter from:
 agent_build_get_by_triple()
 bw_usage_update()
They are never called with session parameter

Rename aggregate_get_query() -> _aggregate_get_query()
because it is private method

Enable N309

implement blueprint db-session-cleanup

Change-Id: Idd43d230105cb140d8825a251f03a58ea28cce90
2013-08-06 10:27:10 +04:00
Joe Gordon 89b65ef1ce Fix and Gate on H303 (no wildcard imports)
Wildcard imports make reading code unnecessarily confusing because they
make it harder to see where a functions comes from.  We had two types of
wildcard imports in the code. Unneeded ones in test files that are just
removed, and some that we actually want which are kept using the '#
noqa' comment to tell flake8 to skip specific checks (such as H303)
for that line.

Change-Id: Id4705011579659fd74a4aaa05ac541e9694c483e
2013-07-30 14:34:31 -07:00
Alex Gaynor feeda2559d Enabled hacking check for Python3 compatible print (H233)
Also fixed all violators of this check.

Change-Id: Id87ff6f44ab76fc59b18d5da739df475400e1259
2013-07-29 15:26:56 -07:00
Alex Gaynor c06a70b84a Enabled the hacking warning for Py3 compatible octal literals (H232)
Also fixed violations thereof.

Change-Id: I581a33385fc47a6c92c8933e0ed63fd688806c03
2013-07-29 14:32:59 -07:00
Alex Gaynor 1bebb3feaf Remove the monkey patching of _ into the builtins
Previous _ was monkey patched into builtins whenever
certain modules were imported. This removes that and
simply imports it when it is needed.

Change-Id: I0af2c6d8a230e94440d655d13cab9107ac20d13c
2013-07-26 07:31:17 -07:00
Joe Gordon 9c13b52926 Add note why E712 is ignored
According to the commit message in
560e5cd84ef2c1a6427c78d35eedc66445e1f77f we ignore E712 because '
With this change we ignore E712 since it is normal to use
"column == True" in sqlalchemy.'

Add note in tox.ini explaining this.

Change-Id: I393e13b1430aae46f958311875678bd99e17b13c
2013-07-25 21:47:39 -04:00
Joe Gordon 7ad71514b1 Start using hacking 0.6
So we can start using new hacking 0.6 checks.

Since hacking 0.6 pins pep8, pyflakes and flake8 they can be removed
from test-requires. For any unfixed checks list them in tox.ini

Fix a H103, 'Header does not match Apache 2.0 License notice' that
leaked in

Change-Id: I652fe3270f1c37afdd386bfae7c4b27b6abcfa06
2013-07-25 12:15:17 -04:00
Zhongyue Luo 1a5a3b32ea Sync sample config file generator with Oslo
The sample generator tool in Oslo is located in tools/config therefore
this patch moves the files in tools/conf to tools/config. The reason
Oslo chose 'config' is because the generator.py module is located in
the openstack.common.config package and update.py looks for the
corresponding directory in tools when it syncs the 'config' package.

./update.sh --module config --base nova --dest-dir $NOVA_HOME --nodep

Since every thing moved to tools/config, changes had to happen on
the tox.ini file and check_update.sh

Change-Id: Icbd467888cc7f16fa3694ed2b93548d0285461b5
2013-07-23 13:03:34 +08:00
Julien Danjou 0ff7ebe5b4 Check that the configuration file sample is up to date
We added this check recently to Ceilometer, and it helps a lot to keep this
file always up to date and not falling behind.

Change-Id: I5ad2c6366032a39c2e55dd11a16b9f1780ab9ed0
2013-07-18 20:22:43 +02:00
Monty Taylor 695fc4112a Add -U to the command line for pip
Since we have site-packages=True in nova, the existence of system
packages of the wrong version can cause nova to not install what
you expect into the tox virtualenv. Adding -U into the deps list
causes it to get appended into the command line, which causes pip
to do what we want and install what we asked for.

Change-Id: I4f388e07caf31ab870f22d261e856a205ebb36c0
2013-07-11 21:14:43 -04:00
John Garbutt 339b974352 Ensure flake8 tests run on all api code
We need to exclude the plugins/xenserver directory
because the python2.4 code can't use as in except clauses.
The existing exclude directory accidentally included some
code in nova/api/openstack/compute/plugins and the related
tests. This code is now included in the flake8 tests,
and the current violations have been fixed up.

Fixes bug 1197858

Change-Id: Ib5f1b65d5d793f0f5854e898ca3ce751e43ef233
2013-07-09 09:52:44 +01:00
Joe Gordon 8e67191084 Fix and gate on E125
E125 continuation line does not distinguish itself from next logical
line.

E125 makes code more readable, and fixing all the existing issues allows
us to gate on this, making this one less thing reviewers have to check
for.

Fix was made using https://github.com/hhatto/autopep8

Change-Id: Ie569fd74fb84d220ceb87e37b1b1f39143bba80f
2013-07-04 08:49:45 +02:00
Devananda van der Veen 918e3cceaf Add HACKING check for db session param
Add a HACKING check to enforce that public db/api and db/sqlalchemy/api
methods to not accept a 'session' parameter.

This check is initially disabled, since it is failing ~24 times right
now, but will be enabled once bp/db-session-cleanup is complete.

Change-Id: Ib89eea58555032dd142d4e21e62d66e2726f0d06
2013-07-02 03:11:24 -07:00
Dirk Mueller a0483e3485 Fix and enable H403 tests
Multi-line doc-strings should end on a new, separate line.

Change-Id: I4cf0cfe92b634ef77971863a4df41ef43531bc20
2013-06-12 22:07:23 +02:00
Jenkins 630fb1f068 Merge "Delete unused bin directory" 2013-06-05 18:26:47 +00:00
Joe Gordon 0ecb71e625 Delete unused bin directory
Delete last bits of bin/.  With the move to entrypoints these aren't
needed anymore.

Update CONF.bindir to default to
  os.path.join(sys.prefix, 'local', 'bin')

Part of blueprint entrypoints-plugins

Change-Id: I95250d3779433e7b85aaa889a873b16c86a7d2be
2013-06-03 11:15:33 -07:00
Chuck Short 5d63ac7849 python3: Add py33 to tox.ini
Introduce py33 to tox.ini to make testing with
python3 easier.

Change-Id: I3f966efc1a845aaa8e317d810bd6a1366acd323c
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-06-01 16:46:25 -05:00
Joe Gordon f493a2d0b2 Add posargs support to flake8 call
Add posargs to flake8 call in tox.ini, with this you can pass arguments
directly into flake8 using the following notation
  tox -epep8 -- --FLAKE8-ARG

Change-Id: I1296eac3df46438ef050bf99ca33eb38d3b02efa
2013-05-28 23:04:44 +02:00
Joe Gordon d0648892ce Enumerate Flake8 E12x ignores
Instead of ignoring all E12x errors, ignore only the failing ones,
so its easy to fix each one separately.

Change-Id: Id365f4d61be56b51823ead8c7c1948e034ea609b
2013-05-28 23:04:44 +02:00
Joe Gordon f41962260b Fix and enable flake8 F823
F823 local variable 'blah' (defined in enclosing scope on line xx)
referenced before assignment

Change-Id: I721e1339ef023558032980bbf59e8dc44b391d52
2013-05-28 23:04:44 +02:00
Joe Gordon f6db010d10 Fix and enable flake8 F812
F812 list comprehension redefines

List comprehension don't have scope so redefining variables can lead to
unexpected behaviors

Change-Id: I85484dfcd4fa391195ea7be75aadc7897da4739c
2013-05-28 23:04:35 +02:00
Joe Gordon d9f010737e Enumerate Flake8 Fxxx ignores
Instead of ignoring all Fxxx errors, ignore only the failing ones, so
its easy to fix each one separately.

Change-Id: I4ccc1d38247fb76b6dad4388b76c6e8d696f081f
2013-05-28 13:28:36 +02:00
Joe Gordon 7f6a15fe8f Enable flake8 E721
We already pass the test, so just remove from ignore list

Change-Id: I28bfeb99d9841532133a3825f7336e7b712d6561
2013-05-28 13:28:36 +02:00
Ruby Loo ffd8bfe37f 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: I68ece8406fb1d4e082a42db8e76e17b1aaa7e775
Fixes: bug #1179008
2013-05-22 20:12:08 +00:00
Monty Taylor fd103c7035 Switch to flake8+hacking.
Remove a bunch of local custom scripts. Replace with configurable
external tools.
Use local hacking checks for nova specifics.

Change-Id: I75a01375ba0ec36d2ff05abc47abe0a3f225eda5
2013-05-17 12:54:12 -07:00
Clark Boylan a1df7309bc Enable tox use of site-packages for libvirt.
Enable the use of site-packages in tox which will allow the use of the
system install of libvirt while testing.

Hardcode the libvirt host UUID for tests that check this UUID when
system libvirt is being used. Without this hardcoding eight tests
would fail when using the system libvirt install.

Partially fixes bug #1113181

Change-Id: I59c5fbd45639962c0963298203c39759b6ca2d11
2013-03-19 12:11:10 +02:00
Dan Prince 8103a3f88d 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.

Change-Id: I3e2b07c3f718e4aede5c5f231ff0cdb7721ec885
2013-03-07 11:25:25 -05:00
Mark McLoughlin 038427a541 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
Rick Harris 5b9ba054a6 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
Attila Fazekas 672cd79b9e 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
Anita Kuno fc3b02fd3b Added the build directory to the tox.ini list pep8 ignores.
Change-Id: Ie3c0d5ce021058de8ac868c736660fa0c75b5af5
2013-02-07 21:44:17 +00:00