Most of the parts for oslo-incubator have moved to
oslo libraries. Cinder only had imageutils.py and
_i18n.py remaining in cinder/openstack/common. I
was to able remove both of these remaining incubator
components.
oslo_utils now has imageutils available. I moved
cinder/image/image_utils.py to use the new
imageutils from oslo_utils and updated all the other
places that were using the old imageutils import.
_i18n was only being used in scheduler/base_filter.py
which appears to have been accidentally left when the
scheduler was previously pulled out of incubator. I
fixed this oversight.
Finally, this patch deletes cinder/openstack/common
cinder/openstack and the openstack-common.conf file.
Change-Id: I8fe0b5d6c278715620f93f682289df7ae60dbeba
Closes-bug: 1517861
Adds --checkonly to tools/config/check_uptodate.sh.
This allows verifying that a configuration file was
generated.
We have had a number of issues introduced which
have caused config file generation to fail since we
removed the sample config file check in the gate.
This does not add back checks to ensure that the file
has been updated, it only checks to ensure that it is
still possible to update the sample file.
Change-Id: I2e0e376fbdec5a1bb584c6739231649e1d0f5d8e
This commit adds the pretty_tox.sh script and the usage of
subunit-trace to the cinder unit test jobs. This also updates the
run_tests.sh script to use subunit-trace so it'll have consistent
output formatting with the tox job.
Change-Id: I8ceafb476dc488b388c7f63501ef48128d8383d2
The following patch changes how cinder scripts are
installed and unit tested. This patch moves all the
cinder scripts from bin into cinder/cmd and creates
entry_points for those scripts in setup.cfg. When
cinder is installed, these scripts will be installed
under /usr/local/bin by pbr.
DocImpact: 'host' config option for multiple-storage backends
in cinder.conf is renamed to 'backend_host' in order to avoid
a naming conflict with the 'host' to locate redis
Change-Id: If82cf0c58d765bf79dbf721ca95c10a468940cab
Implements: blueprint unit-test-cases-for-cinder-scripts
We recently removed the checkupdate tests for sample.conf
here Ie4e25a8cd36782007a8934cc4573632f5215c2b1
To stop gating on this as it's just a big fat
pain when external libs change.
Instead, we'll start generating this in an external
job and publishing somewhere.
Funny thing though, we actually have a direct call in
run_tests.sh as well.
This patch removes the second call in run_tests.sh
Change-Id: Iaef411e254186fbba80c21903d6f94538a808d93
The path to this repo is added to PYTHONPATH when the coverage flag is
specified so that the cinder entry points are discovered.
Change-Id: Ie33a63c6ecd443b900fa7bed3a1ec5b6bb0065e6
Closes-Bug: #1364347
"run_tests.sh -p" always checks every file for errors even though you
have probably only changed a handful. This patch adds "run_tests.sh -8"
which only checks the files that were modified in the HEAD commit or
the current working tree.
Copied from Matthew's work in Nova here:
https://review.openstack.org/#/c/110746/15
Change-Id: I84f6a522da5352a703caa59975643043ec1911fe
Co-Authored-By: Matthew Gilliard <matthew.gilliard@gmail.com>
This sync pulls the latest Oslo config code over
to Cinder. This sync is needed to include a fix
to config generator which is needed as part of
the work to enabled i18n messages. Config generator
was failing when lazy message translation was enabled.
The following changes are included with this patch. Each
patch includes the file(s) the patch touches:
-> c178e56 Add basic Python 3 tests
--> cinder/openstack/common/__init__.py
-> 12bcdb7 Remove vim header
--> cinder/openstack/common/__init__.py
-> 547ab34 Fix Copyright Headers - Rename LLC to Foundation
--> cinder/openstack/common/__init__.py
-> 44b6ea3 Import oslo.config configuration file generator
--> cinder/openstack/common/config/__init__.py
-> dd9aa2b Remove unused variables
--> cinder/openstack/common/config/generator.py
-> 5dce17b Use entry points to discover options in libraries
--> tools/config/generate_sample.sh
--> cinder/openstack/common/config/generator.py
-> e8e636c generator: add an EXTRA_LIBRARIES env variable
--> cinder/openstack/common/config/generator.py
-> e3dddd7 generator: use EXTRA_* env vars in the bash script
--> tools/config/generate_sample.sh
--> cinder/openstack/common/config/generator.py
-> 6da13e8 generator: rename EXTRA_MODULES_FILE to RC_FILE
--> tools/config/generate_sample.sh
-> 763eedf Fix DictOpt support in config sample generator
--> cinder/openstack/common/config/generator.py
-> e839886 Config generator fails with lazy messages
--> cinder/openstack/common/config/generator.py
-> 343686b Add check_uptodate to tools/config
--> tools/config/check_uptodate.sh
Oslo version:
-> 0f24d82 Fix migration.db_version when no tables
-> Date: Sat, 22 Feb 2014 00:32:18 +0000
Change-Id: I26a95fe96b08d6340b0fce1b9e2949c8e661a946
Closes-Bug: 1280826
Related-bp: i18n-messages
tools/conf/check_uptodate.sh is added in run_tests.sh
For simple, run "run_tests.sh -p" will call it, and get following error:
Failed to collect options from module
cinder.volume.drivers.san.hp.hp_3par_common: No module named hp3parclient
Actually, the hp3parclient is listed in test-requirements.txt, and it is
installed in venv.
the check_uptodate.sh should run in venv to get correct result.
update the error message to update the cindier.conf.sample correctly.
-----------
Test method
-----------
$ pwd
/opt/stack/cinder
$ source .venv/bin/activate; tools/conf/generate_sample.sh
(.venv)$ deactivate
$ ./run_tests.sh -p
Running flake8 ...
// no error emitted here
Fixes Bug #1219197
Change-Id: I9b3eaf3c1a5eb395eefed28bb907685cdef147aa
In run_tests.sh, function init_testr will initialize testr if the
directory .testrepository is not existed. Actually, testr will do
the check before run the test:
In Python package testrepository, setuptools_command.py:Testr.run
68 def run(self):
69 """Set up testr repo, then run testr"""
70 if not os.path.isdir(".testrepository"):
71 self._run_testr("init")
So, init_testr can be removed safely.
Fixes Bug #1216820
Change-Id: Id9815033c0cb0e1aa6693a4c14bf9a5d490c8883
This adds check_uptodate to run_tests and
tox.ini checks.
This also requires that we add novaclient to the
test-requires, since we try and poke at cinder/compute/nova.
There is another implementation in use to do this that
pulls in openstack.common.config.generator,
(see ceilometer project for a pretty slick impl), however
adding that also pulls in a rather large list of
updates and dependencies that quite frankly Cinder
doesn't need and the ones that we do use break
a number of things in Cinder.
There's also a number of additional options added
to generate_sample that I don't think we need right now.
In the future we'll probably want to go this route
but for now I'd just like to get automated checking
in place.
Change-Id: I91aa4d98f472ad5a3ece7773c75ee76d66adafc0
run_tests.sh -N -p
it will call the flake8 installed on your host to detect PEP8, and
the flake8 plugin "OpenStack hacking" may not installed on your
host, so this command may not detect the OpenStack Style Commandment
supplied by hacking(e.g H202).
run_tests.sh -p
it will call the flake8 from virtual env, flake8 plugin "OpenStack
hacking" installed in virtual env will be triggered.
The result from "run_tests.sh -p" should be trusted, and jenkins uses
virtual env to run flake8 too.
When "-N" is enabled, emit warning to remind user.
Bug #1208584
Change-Id: Ie08e5fa2b44088dad135e11583c046650d65df1e
If doing run_tests.sh -N -p we only check cinder*
This patch adds a directive to also check the files
in bin/
Change-Id: Ia68073e16067df978475db058c9c0693f35df81c
When trying to test a bug the cinder test framework was
running all the tests when I just wanted one to run.
Instead of fixing this problem in nose I tried to move cinder to
testr. I copied a fair bit of code from nova to get this to work.
This way at least if some one makes an improvement to the nova
test framework cinder can improve here also.
Note that now all the tests a thread safe. Added a concurrency argument
to run_tests.sh that defaults to 1. You can specify your own level then
and take the risk of intermittent failures. Tell jenkins to use a
concurrency level of 1 to avoid failing gate jobs.
Note One of these tests is broken and I have disabled for now. There
is a bug for this here: https://bugs.launchpad.net/cinder/+bug/1173266
Note: cinder.api.openstack.FaultWrapper is deprecated and is causing
a circular import when I try and import cinder.tests.test_wsgi. This
is fixed by only importing the openstack.FaultWrapper during the
__init__ phase of the wsgi middleware.
Fixes: bug 1183434
Fixes: bug 1177924
Change-Id: I5e10b55c5b236eb81a6a3e0e9ea56af8ca4ef8e1
Even though we're moving to testr and this will eventually
go away, we should maintain our ability to run and debug
individual tests until the broader change is released.
This just adds some text around the nosetests call
to get us back where we were.
Fixes bug: 1181996
Change-Id: Id0082ca8954664679430cc602425b1fadd29151b
Add more explicit ignores to tox.ini hacking ignores until
we have a chance to fix up the imports and docstring errors
we've been ignoring. This should give us everything we had
in the past (ie alphabetical import checks).
Also, update run_tests.sh to call flake8 and not the hacking.py
that is no longer there.
Change-Id: I6c82e958002255fd9f527b06bf0a68d148cc681e
It's a little silly since we're working on removing nose for testr,
but it turns out that the old test run wrapper was in use here, which was
causing all sorts of havoc.
Change-Id: Ib6e31547ec4921f91b6253a1798cb04ca6930c87
the set -e was suppressing all the echo information about why
run_tests.sh was failing, which makes it quite hard to figure out
what is going on.
Change-Id: Ie210ee5b5e9ff0028a89da520580db7cd1d9f03a
This commit adds an update option to run_tests.sh. This option
is used to rerun install_venv.py on an already installed venv.
This will then just update out of date packages with pip.
Change-Id: I96dc6940f536feb810d57b3316e9d712aa750d93
Along with moving to pep8 1.3.3, we also want to standardize
on what we ignore. This patch get's us most of the way there
by setting the ignore list to:
N4,E125, E126, E711,E712.
Almost all changes made here are white-space/indentation changes.
The removal of Hacking N4 errors from the ignore list will
be handled in a seperate patch.
Change-Id: If45f156600485d23769449018590f60b4f69b0c5
Apart of making pep8 version standard across all openstack
projects.
Also fix tools/hacking.py so it is compliant for pep8 1.2
and beyond, taken from fbc4568 in the nova tree.
Change-Id: I801c98a01960fa113dae1b6174c1a06bb149fea3
Signed-off-by: Chuck Short <chuck.short@canonical.com>
In commit
https://github.com/openstack/cinder/commit/
50792c2ff41fdc7e73b3e3c51f4510366debfd14,
the committer wanted to add an option in run_tests.sh for generating XML
coverage report, but ended up accidentally overriding the default nose
option -x. But, the usage message still showed that using option -x will
'Stop running tests after the first error or failure'. So, I changed the
option to generate XML report to -X (capitalized 'x'). So now both -x and
-X options are available, with different purposes.
Fixes bug 1070047
Change-Id: Ie8c30c14629d4811d6db74f3eea9cdecb1d27c8a
Pep8 test reports issue on openstack-common modules, which would
fail CI test. Pep8 test should skip openstack-common and assuming
they are problem-free code. Even it's not, bug/fix should go to
openstack-common first, then resync back to Cinder. Therefore,
Cinder should skip pep8 test for openstack-common code.
Fix bug #1027774
Change-Id: I22c45542401022a6bad9f2320e8657f972915f69
The docs job wasn't working because of an un-renamed file.
Coverage wasn't running in jenkins with the xml output file.
Remove the .cache.bundle support that we're moving away from.
Change-Id: I1140baa53dee8b14ac4d1f8549425a0fdd7a8425