Unit test leakage

Bug #1472459 reported by Richard Jones
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Confirmed
Medium
Unassigned

Bug Description

Running a subset of the test suite via:

   ./run_tests.sh openstack_dashboard.test.api_tests

results in a rest error:

 ======================================================================
 ERROR: test_url_for (openstack_dashboard.test.api_tests.base_tests.ApiHelperTests)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
  File "/Users/richard/src/openstack/horizon/openstack_dashboard/test/api_tests/base_tests.py", line 192, in test_url_for
    url = api_base.url_for(self.request, 'image')
  File "/Users/richard/src/openstack/horizon/openstack_dashboard/api/base.py", line 311, in url_for
    catalog = request.user.service_catalog
  File "/Users/richard/src/openstack/horizon/.venv/lib/python2.7/site-packages/django/utils/functional.py", line 225, in inner
    return func(self._wrapped, *args)
 AttributeError: 'AnonymousUser' object has no attribute 'service_catalog'
 ----------------------------------------------------------------------

which goes away when the scope of the tests is raised up to:

  ./run_tests.sh openstack_dashboard.test

which implies the setup of the tests in some other part of Horizon is causing a side-effect that's being relied upon in the api tests.

Update: this is reproducible in Pike by using:
  tox -e p27 openstack_dashboard.test.api_tests

Changed in horizon:
status: New → Confirmed
importance: Undecided → Medium
summary: - test setup leakage in current (2015-07-08) master HEAD
+ Unit test leakage
description: updated
Revision history for this message
Akihiro Motoki (amotoki) wrote :

I think this was fixed as bug 1805240 and bug 1806053.

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.