← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1328589] [NEW] Tests fails with non english locale settings

 

Public bug reported:


When the locale environment setting uses a language other than english, some Keystone tests fails.


	$> locale -a
	C
	C.UTF-8
	en_US.utf8
	fr_BE.utf8
	fr_FR
	fr_FR.iso88591
	fr_FR.utf8
	POSIX

	$> LANG=en_US.utf8 ./run_tests.sh
	[ ... ]
	Ran 3283 tests in 158.885s
	OK

	$>LANG=fr_FR.utf8 ./run_tests.sh
	[ ... ]
	Ran 3286 tests in 161.606s
	FAILED (failures=3)


There are 3 failing tests:
 - keystone.tests.test_backend_ldap.LDAPIdentity.test_wrong_ldap_scope
 - keystone.tests.test_backend_ldap.LDAPIdentityEnabledEmulation.test_wrong_ldap_scope
 - keystone.tests.test_wsgi.LocalizedResponseTest.test_get_localized_response

The two first are in fact only one test (called twice).
The test compares two string values, but they don't match because one of them is translated.


The last test fails because the message exception.NotFound.message_format is translated, in keystone/tests/test_wsgi.py line 356

# keystone/tests/test_wsgi.py
354:            class LangTranslator(object):
355:                def ugettext(self, msgid):
                             # This condition is broken if exception.NotFound.message_format is translated.
356:                    if msgid == exception.NotFound.message_format:
357:                        return xlated_msg_fmt
358:                    return msgid
359:
360:                gettext = ugettext

** Affects: keystone
     Importance: Undecided
         Status: New

** Attachment added: "result of ./tools/with_venv.sh testr failing"
   https://bugs.launchpad.net/bugs/1328589/+attachment/4128997/+files/log.txt

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1328589

Title:
  Tests fails with non english locale settings

Status in OpenStack Identity (Keystone):
  New

Bug description:
  
  When the locale environment setting uses a language other than english, some Keystone tests fails.

  
  	$> locale -a
  	C
  	C.UTF-8
  	en_US.utf8
  	fr_BE.utf8
  	fr_FR
  	fr_FR.iso88591
  	fr_FR.utf8
  	POSIX

  	$> LANG=en_US.utf8 ./run_tests.sh
  	[ ... ]
  	Ran 3283 tests in 158.885s
  	OK

  	$>LANG=fr_FR.utf8 ./run_tests.sh
  	[ ... ]
  	Ran 3286 tests in 161.606s
  	FAILED (failures=3)

  
  There are 3 failing tests:
   - keystone.tests.test_backend_ldap.LDAPIdentity.test_wrong_ldap_scope
   - keystone.tests.test_backend_ldap.LDAPIdentityEnabledEmulation.test_wrong_ldap_scope
   - keystone.tests.test_wsgi.LocalizedResponseTest.test_get_localized_response

  The two first are in fact only one test (called twice).
  The test compares two string values, but they don't match because one of them is translated.

  
  The last test fails because the message exception.NotFound.message_format is translated, in keystone/tests/test_wsgi.py line 356

  # keystone/tests/test_wsgi.py
  354:            class LangTranslator(object):
  355:                def ugettext(self, msgid):
                               # This condition is broken if exception.NotFound.message_format is translated.
  356:                    if msgid == exception.NotFound.message_format:
  357:                        return xlated_msg_fmt
  358:                    return msgid
  359:
  360:                gettext = ugettext

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


Follow ups

References