Unit tests fail when run from symlinked directory

Bug #1266220 reported by Ana Krivokapić
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Ana Krivokapić

Bug Description

E.g, horizon git tree is located at /opt/stack/horizon, and there is a symlink in user's home directory which points to the horizon git tree: ~/horizon -> /opt/stack/horizon. Then cd ~/horizon followed by ./run_tests.sh fails:

FAIL: test_customize_dashboard (horizon.test.tests.base.CustomPanelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/akrivoka/horizon/horizon/test/tests/base.py", line 382, in test_customize_dashboard
    self.assertEqual(cats.name, "WildCats")
AssertionError: 'Cats' != 'WildCats'
    "'Cats' != 'WildCats'" = '%s != %s' % (safe_repr('Cats'), safe_repr('WildCats'))
    "'Cats' != 'WildCats'" = self._formatMessage("'Cats' != 'WildCats'", "'Cats' != 'WildCats'")
>> raise self.failureException("'Cats' != 'WildCats'")

======================================================================
FAIL: test_customized_permissions (horizon.test.tests.base.CustomPermissionsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/akrivoka/horizon/horizon/test/tests/base.py", line 420, in test_customized_permissions
    self.assertEqual(resp.status_code, 302)
AssertionError: 200 != 302
    '200 != 302' = '%s != %s' % (safe_repr(200), safe_repr(302))
    '200 != 302' = self._formatMessage('200 != 302', '200 != 302')
>> raise self.failureException('200 != 302')

Changed in horizon:
assignee: nobody → Ana Krivokapić (akrivoka)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/65000

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/65000
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=c49fcd3bd92341855ff6e9257cb1750f27224b0e
Submitter: Jenkins
Branch: master

commit c49fcd3bd92341855ff6e9257cb1750f27224b0e
Author: Ana Krivokapic <email address hidden>
Date: Sun Jan 5 17:03:43 2014 +0100

    Make running of unit tests more robust

    Unit tests would fail if run from a symlinked directory.
    To fix this, this patch adds the -P switch to the pwd command,
    to make sure all files are referred to by their actual paths
    and not symlinks.

    Change-Id: Ib7087c11f9dc2c44be3aca8cf94db227a2db72f3
    Closes-Bug: #1266220

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-2 → 2014.1
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.