The test code isn't part of the service.
Corresponding cinder change: I7b18453269cfc57bfbc9bd143d72948e88e60836
Change-Id: I71cc8b3154828f4aeea0afdf3fb59a79b8a8e707
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Update local hacking checks for new flake8.
Many tests are failing, so disable all that fail and fix most of them in a
followup.
Change-Id: I34a767406ed9110fc6e0cf5015b88cf1e7f43801
The hacking "[H203] Use assertIs(Not)None to check for None" is already enabled
in tox. But the local hacking M312 is also avaliable, there is no need to check
twice here for the same check.
Change-Id: I56e19c6dd8905e439247c3b142e74913b5d0d7a6
Closes-Bug: #1710426
Added hacking check to ensure that UUIDs are not generated
by uuid4() since we should do this using oslo_utils.uuidutils.
Based on this nova change [1].
[1] I73ee63fbd4f451d3aa5dc1a2a734d68c308b4440
Change-Id: Ic7783c29fbd838c827ccc8ee44aa757fef8e9169
Logging format arguments are not supposed to be tuples, but
are rather to be supplied separately - i.e., use
LOG.debug('%s is %s', arg1, arg2)
instead of
LOG.debug('%s is %s', (arg1, arg2))
Rid the manila codebase of this logging format error and
add a hacking check for this. The hacking check will not
catch all corner cases but should help prevent this error
in most cases.
Change-Id: Ibea39f1f90c0444eae5cfcd6090b2a00d84ab923
Closes-Bug: #1585394
So change [1] skips this check in python34 tests.
Replace CheckForStrExc with CheckForStrUnicodeEx
and quit skipping unit test for this hacking check.
Partially-Implements: bp py3-compatibility
[1] Id3d196d6006e7b2e5e56343bd7ba207c5196b61d
Change-Id: I9fdd035a61715039b737bf65df5c5636e8a55f54
Several bugs have been raised and fixed to convert
assertEqual(None, *) with assertIsNone in tests.
Install a hacking rule to prevent new occurrences of
this problem.
Change-Id: Ib157f911e2f6a90d21c3886b3139f9b109962052
Manila unit tests contain several occurences of
assertEqual(True, ...) instead of assertTrue(...).
Fix these occurences and add hacking check so new
occurences don't creep into the codebase.
Closes-Bug: #1584948
Change-Id: Ib586590b9efcb5253e8c09ee735a8ffb62b44d74
Hacking rule for underscore imports _() are not working correctly.
It also matches _.* imports like "import _LE"
See review: https://review.openstack.org/#/c/270754/
Change-Id: Ibdef35e1896882a8dfe3165dba989255639e61ba
PEP-0274 introduced dict comprehensions to replace dict constructor
with a sequence of length-2 sequences, these are benefits copied
from [1]:
The dictionary constructor approach has two distinct disadvantages
from the proposed syntax though. First, it isn't as legible as a
dict comprehension. Second, it forces the programmer to create an
in-core list object first, which could be expensive.
Manila does not support python 2.6, we can leverage this.
There is deep dive about PEP-0274[2] and basic tests about
performance[3].
Note: This commit doesn't handle dict constructor with kwagrs.
This commit also adds a hacking rule.
[1]http://legacy.python.org/dev/peps/pep-0274/
[2]http://doughellmann.com/2012/11/12/the-performance-impact-of-using
-dict-instead-of-in-cpython-2-7-2.html
[3]http://paste.openstack.org/show/480757/
Change-Id: I87d26a46ef0d494f92afb1d3bebda2797a12413c
Closes-Bug: #1524771
From the hacking guidelines, the numbers should be M3xx. N333
should be M333. Fix it.
Change-Id: I67b8d0e15fa6c68ab59774864165941051ab8649
Closes-Bug: #1524808
Make use of the Tempest plugin interface instead of copying Manila
files into Tempest. This will remove the burden to port Manila
tests onto Tempest master recurrently.
This ports all existing Manila Tempest test to the new structure.
It uses manila_tempest_tests as new top folder for all Tempest
tests. It follow the model of Heat (see [1]).
[1]: https://github.com/openstack/heat/tree/master/heat_integrationtests
Change-Id: Ie5ed64a6777ed1acf8dd56522c26705ae897596d
Partly-implements: bp tempest-plugin-interface
Depends-On: I26dd32b1de8cceeaa6dc674092efec683df71889
The oslo team is recommending everyone to switch to the
non-namespaced versions of libraries. Updating the hacking
rule to include a check to prevent oslo.* import from
creeping back in.
oslo.messaging is the only exception because this package doesn't
currently support non-namespaced imports.
Change-Id: I3987e651bc880c8ffa7c0105df0298679dcd3a43
LOG.warn etc. should be translated separately and thus messages need to
be marked with _LW for LOG.warn, _LI for LOG.info and _LE for LOG.errors
and LOG.exception.
Mark all LOG invocations with proper translation marker.
Use ',' instead of '%' when adding variables to log messages to allow
lazy evaluation.
Add new hacking checks for these.
Change-Id: I31d3ee50f30c63d7d647b1c2b1eae50bf96f0c74
Add manila specific hacking checks (copied over from nova) to test:
- [M319] Validate that debug level logs are not translated.
- [M323] Ensure that the _() function is explicitly imported to ensure
proper translations.
- [M325] str() cannot be used on an exception. Remove use or use
six.text_type()
- [M326] Translated messages cannot be concatenated. String should be
included in translated message.
Also include some tests for the above (copied from nova and adjusted).
Rework HACKING.rst to remove the content that is in the global hacking
file and add in the manila specific rules.
Change-Id: I530609a183c81ba942623b73d5f62cd338b04211