← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1331973] [NEW] Errors in code fail silently in unit tests

 

Public bug reported:

Looking at a recent review (https://review.openstack.org/#/c/100656/),
I've discovered that the unit test swallows some code errors and returns
no error. The reason is that checking for Action.allowed() is enclosed
in try:except, but the logged exception is not displayed in the unit
test results. Here is the code:

https://github.com/openstack/horizon/blob/master/horizon/tables/base.py#L1140

When commenting the try:except block, the unit test failed, and here is the fix that was needed to bring tests back to passed:
http://paste.openstack.org/show/84431/

Let's see how to change unittest verbosity and make the error messages
appear in unit tests result even if a test is passed. This is a must for
at least LOG.exception messages.

** Affects: horizon
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1331973

Title:
  Errors in code fail silently in unit tests

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  Looking at a recent review (https://review.openstack.org/#/c/100656/),
  I've discovered that the unit test swallows some code errors and
  returns no error. The reason is that checking for Action.allowed() is
  enclosed in try:except, but the logged exception is not displayed in
  the unit test results. Here is the code:

  https://github.com/openstack/horizon/blob/master/horizon/tables/base.py#L1140

  When commenting the try:except block, the unit test failed, and here is the fix that was needed to bring tests back to passed:
  http://paste.openstack.org/show/84431/

  Let's see how to change unittest verbosity and make the error messages
  appear in unit tests result even if a test is passed. This is a must
  for at least LOG.exception messages.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1331973/+subscriptions


Follow ups

References