osuosl / ganeti_webmgr

Ganeti Web Manager is a Django based web application that allows administrators and clients access to their ganeti clusters. It includes a permissions and quota system that allows administrators to grant access to both clusters and virtual machines. It also includes user groups for structuring access to organizations.
https://code.osuosl.org/projects/ganeti-webmgr
GNU General Public License v2.0
64 stars 32 forks source link

Fix failing/erroring tests #33

Open iankronquist opened 9 years ago

iankronquist commented 9 years ago

Some tests fail because my configuration isn't right. I'm trying to figure out what the right configuration is.

These tests are failing on Travis:

======================================================================
ERROR: test_site_profile_not_available (django.contrib.auth.tests.models.ProfileTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/Django-1.4.20-py2.7.egg/django/contrib/auth/tests/models.py", line 29, in test_site_profile_not_available
    del settings.AUTH_PROFILE_MODULE
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/Django-1.4.20-py2.7.egg/django/utils/functional.py", line 215, in __delattr__
    delattr(self._wrapped, name)
AttributeError: AUTH_PROFILE_MODULE
======================================================================
ERROR: test_management_command (registration.tests.RegistrationModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django_registration-0.7-py2.7.egg/registration/tests.py", line 141, in test_management_command
    management.call_command('cleanupregistration')
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/Django-1.4.20-py2.7.egg/django/core/management/__init__.py", line 136, in call_command
    raise CommandError("Unknown command: %r" % name)
CommandError: Unknown command: 'cleanupregistration'
----------------------------------------------------------------------

FAILED (errors=2, skipped=3)
tschuy commented 9 years ago

I'll take a look into these.

iankronquist commented 9 years ago

These tests are failing for both of us on the workstations:

ERROR: test_site_profile_not_available (django.contrib.auth.tests.models.ProfileTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tschuy/.gwm/local/lib/python2.7/site-packages/django/contrib/auth/tests/models.py", line 29, in test_site_profile_not_available
    del settings.AUTH_PROFILE_MODULE
  File "/home/tschuy/.gwm/local/lib/python2.7/site-packages/django/utils/functional.py", line 215, in __delattr__
    delattr(self._wrapped, name)
AttributeError: AUTH_PROFILE_MODULE

======================================================================
FAIL: test_get_users (object_permissions.tests.permissions.TestModelPermissions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tschuy/.gwm/local/lib/python2.7/site-packages/object_permissions/tests/permissions.py", line 353, in test_get_users
    self.assertFalse(user1 in get_users(object0))
AssertionError: True is not false

======================================================================
FAIL: test_get_users_all (object_permissions.tests.permissions.TestModelPermissions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tschuy/.gwm/local/lib/python2.7/site-packages/object_permissions/tests/permissions.py", line 463, in test_get_users_all
    self.assertFalse(user1 in get_users_all(object0, ['Perm1']))
AssertionError: True is not false

======================================================================
FAIL: test_get_users_any (object_permissions.tests.permissions.TestModelPermissions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tschuy/.gwm/local/lib/python2.7/site-packages/object_permissions/tests/permissions.py", line 367, in test_get_users_any
    self.assertFalse(user1 in get_users_any(object0, ['Perm1']))
AssertionError: True is not false

======================================================================
FAIL: test_view_ssh_keys (ganeti_webmgr.clusters.tests.views.TestClusterViews)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tschuy/projects/ganeti_webmgr/ganeti_webmgr/clusters/tests/views.py", line 872, in test_view_ssh_keys
    self.assertEqual(len(json.loads(response.content)), 0)
AssertionError: 3 != 0

----------------------------------------------------------------------
Ran 999 tests in 171.596s

FAILED (failures=4, errors=1, skipped=3)
iankronquist commented 9 years ago

I kicked off a special travis build with some special lines to determine how the state of the travis test environment differs from the workstations. Next I need to run the same commands on the workstation and do a compare and contrast to see what's different. https://travis-ci.org/osuosl/ganeti_webmgr/builds/63412080

tschuy commented 9 years ago

diff for pip freeze on travis vs on workstaiton: https://pastebin.osuosl.org/26536/

Upgrading my local workstation venv to match does not solve any of the problems.

tschuy commented 9 years ago

I've updated the tests in django_object_permissions (first time the code's been touched in two years) from assertFalse(thing in thing) to assertIn to see exactly what the issue is.

======================================================================
FAIL: test_get_users (object_permissions.tests.permissions.TestModelPermissions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tschuy/projects/django_object_permissions/object_permissions/tests/permissions.py", line 353, in test_get_users
    self.assertNotIn(user1, get_users(object0))
AssertionError: <User: tester2> unexpectedly found in [<User: tester>, <User: tester2>]

======================================================================
FAIL: test_get_users_all (object_permissions.tests.permissions.TestModelPermissions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tschuy/projects/django_object_permissions/object_permissions/tests/permissions.py", line 463, in test_get_users_all
    self.assertNotIn(user1, get_users_all(object0, ['Perm1']))
AssertionError: <User: tester2> unexpectedly found in [<User: tester>, <User: tester2>]

======================================================================
FAIL: test_get_users_any (object_permissions.tests.permissions.TestModelPermissions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tschuy/projects/django_object_permissions/object_permissions/tests/permissions.py", line 367, in test_get_users_any
    self.assertNotIn(user1, get_users_any(object0, ['Perm1']))
AssertionError: <User: tester2> unexpectedly found in [<User: tester>, <User: tester2>]
iankronquist commented 9 years ago

This test is failing intermittently on travis:

................................................................................................................................E....................................................................................................................................................s

======================================================================

ERROR: test_field_initial_values (ganeti_webmgr.virtualmachines.tests.forms.modify.TestHvmModifyVirtualMachineForm)

----------------------------------------------------------------------

Traceback (most recent call last):

  File "/home/travis/build/osuosl/ganeti_webmgr/ganeti_webmgr/virtualmachines/tests/forms/modify.py", line 300, in test_field_initial_values

    self.assertEqual(form.fields[field].initial, hvparams[field])

KeyError: 'boot_order'

----------------------------------------------------------------------

Ran 278 tests in 193.354s

FAILED (errors=1, skipped=1)
tschuy commented 9 years ago

I've fixed the only failure on travis. now we need to figure out why our workstations fail some of the other tests.