rally-openstack/tests/hacking
Boris Pavlovic baae999bb4 Improve Rally Logging (part 1)
- Remove translations

  Nobody is using translations for Rally and I don't think that
  anybody is going to use it. Target auditory for Rally are
  developers/operators which usually know well english.
  For me this looks like waste of resources, performance
  degradation (cause we are calling _()), complexity
  (+1 thing that you need to know)

- Pass to log already formatted strings

  It's very bad because in case of wrong formatting, it
  doesn't fail instead just writes errors to the logs,
  as well information about trace is lost, so it's super
  hard to fix it

  Log wrapper doesn't allow to use LOG anymore for
  formatting strings

  All places are fixed

- Improve logging of exceptions

LOG.exception() already logs exception, which means it's bad idea to
pass str(e) to it. Instead we should provide clear description of what
happend. Improved few places to write warnings or exceptions in case
of different level of logs. In few places just use LOG.exception

- Part of log messages were improved and simplified

Change-Id: I800995395e1a8fec61da009906430bc5001e3779
2017-09-26 13:07:48 -07:00
..
README.rst Update the documentation links for doc migration 2017-07-14 13:44:43 +00:00
__init__.py Reorganize test module structure 2014-10-07 13:50:40 +00:00
checks.py Improve Rally Logging (part 1) 2017-09-26 13:07:48 -07:00

README.rst

Rally Style Commandments

Rally Specific Commandments

* [N30x] - Reserved for rules related to mock library
  • [N301] - Ensure that assert_* methods from mock library is used correctly
  • [N302] - Ensure that nonexistent "assert_called" is not used
  • [N303] - Ensure that nonexistent "assert_called_once" is not used
* [N310-N314] - Reserved for rules related to logging
  • [N310] - Ensure that rally.common.log is used as logging module
  • [N311] - Validate that debug level logs are not translated
  • [N312] - Validate correctness of debug on check.
  • [N313] - Validate that LOG.warning is used instead of deprecated LOG.warn.
* [N32x] - Reserved for rules related to assert* methods
  • [N320] - Ensure that assertTrue(isinstance(A, B)) is not used
  • [N321] - Ensure that assertEqual(type(A), B) is not used
  • [N322] - Ensure that assertEqual(A, None) and assertEqual(None, A) are not used
  • [N323] - Ensure that assertTrue/assertFalse(A in/not in B) are not used with collection contents
  • [N324] - Ensure that assertEqual(A in/not in B, True/False) and assertEqual(True/False, A in/not in B) are not used with collection contents
  • [N325] - Ensure that assertNotEqual(A, None) and assertNotEqual(None, A) are not used
  • [N326] - Ensure that assertEqual(A, True/False) and assertEqual(True/False, A) are not used
  • [N340] - Ensure that we are importing always from rally import objects
  • [N341] - Ensure that we are importing oslo_xyz packages instead of deprecated oslo.xyz ones
  • [N342] - Ensure that we load opts from correct paths only
  • [N350] - Ensure that single quotes are not used
  • [N351] - Ensure that data structs (i.e Lists and Dicts) are declared literally rather than using constructors
  • [N352] - Ensure that string formatting only uses a mapping if multiple mapping keys are used.
  • [N353] - Ensure that unicode() function is not uset because of absence in py3
  • [N354] - Ensure that :raises: Exception is not used
  • [N355] - Ensure that we use only "new-style" Python classes
  • [N356] - Ensure using dt as alias for datetime
* [N360-N370] - Reserved for rules related to CLI
  • [N360] - Ensure that CLI modules do not use rally.common.db
  • [N361] - Ensure that CLI modules do not use rally.common.objects