Unit tests broken when using oslo.context from master

Bug #1657499 reported by Javier Peña
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
oslo.context
Fix Released
Undecided
Unassigned
oslo.log
Fix Released
High
Joshua Harlow

Bug Description

Unit tests fail when the master oslo.context is used instead of the tagged version (2.12.0). The following errors are shown:

======================================================================
FAIL: oslo_log.tests.unit.test_log.ContextFormatterTestCase.test_user_identity_logging
tags: worker-4
----------------------------------------------------------------------
Empty attachments:
  stderr

stdout: {{{HAS CONTEXT [99 - - - - -]: test}}}

Traceback (most recent call last):
  File "/tmp/oslo.log/oslo_log/tests/unit/test_log.py", line 620, in test_user_identity_logging
    self.assertEqual(expected, self.stream.getvalue())
  File "/tmp/kk/lib/python2.7/site-packages/testtools/testcase.py", line 411, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/tmp/kk/lib/python2.7/site-packages/testtools/testcase.py", line 498, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: !=:
reference = u'''\
HAS CONTEXT [99 myuser mytenant mydomain myuserdomain myprojectdomain]: test
'''
actual = u'''\
HAS CONTEXT [99 - - - - -]: test
'''
======================================================================
FAIL: oslo_log.tests.unit.test_log.ContextFormatterTestCase.test_user_identity_logging_set_format
tags: worker-4
----------------------------------------------------------------------
Empty attachments:
  stderr

stdout: {{{HAS CONTEXT [99 - -]: test}}}

Traceback (most recent call last):
  File "/tmp/oslo.log/oslo_log/tests/unit/test_log.py", line 636, in test_user_identity_logging_set_format
    self.assertEqual(expected, self.stream.getvalue())
  File "/tmp/kk/lib/python2.7/site-packages/testtools/testcase.py", line 411, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/tmp/kk/lib/python2.7/site-packages/testtools/testcase.py", line 498, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: !=:
reference = u'''\
HAS CONTEXT [99 myuser mytenant]: test
'''
actual = u'''\
HAS CONTEXT [99 - -]: test
'''
======================================================================
FAIL: oslo_log.tests.unit.test_log.DomainTestCase.test_domain_in_log_msg
tags: worker-4
----------------------------------------------------------------------
Empty attachments:
  stderr

stdout: {{{[req-1a0253f5-b5e6-4829-a17e-d2cea195418d]: - - - - - info}}}

Traceback (most recent call last):
  File "/tmp/oslo.log/oslo_log/tests/unit/test_log.py", line 936, in test_domain_in_log_msg
    (ctxt.request_id, user_identity)))
  File "/tmp/oslo.log/oslo_log/tests/unit/test_log.py", line 924, in _validate_keys
    self.assertEqual(infoexpected, self.stream.getvalue())
  File "/tmp/kk/lib/python2.7/site-packages/testtools/testcase.py", line 411, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/tmp/kk/lib/python2.7/site-packages/testtools/testcase.py", line 498, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: !=:
reference = u'''\
[req-1a0253f5-b5e6-4829-a17e-d2cea195418d]: myuser mytenant mydomain myuserdomain myprojectdomain info
'''
actual = u'''\
[req-1a0253f5-b5e6-4829-a17e-d2cea195418d]: - - - - - info
'''
Ran 155 tests in 6.051s (-0.010s)
FAILED (id=10, failures=3)

Revision history for this message
Javier Peña (jpena-c) wrote :

Checking the oslo.context history, this commit is the one that breaks unit tests: https://github.com/openstack/oslo.context/commit/1c421837db4ad4026d89afb6f7f49e8e259ee7ca

Joshua Harlow (harlowja)
Changed in oslo.context:
status: New → Confirmed
Revision history for this message
Joshua Harlow (harlowja) wrote :
Changed in oslo.log:
assignee: nobody → Joshua Harlow (harlowja)
status: New → Confirmed
importance: Undecided → High
Changed in oslo.context:
status: Confirmed → Fix Committed
Changed in oslo.log:
status: Confirmed → Fix Committed
Changed in oslo.log:
status: Fix Committed → Fix Released
Changed in oslo.context:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.