learningequality / ka-lite

KA Lite: lightweight web server for serving core Khan Academy content (videos and exercises) without needing internet connectivity
https://learningequality.org/ka-lite/
Other
458 stars 304 forks source link

"test" command from the command-line on Distributed server #1930

Closed him-28 closed 10 years ago

him-28 commented 10 years ago

Branch: nalanda-rct1

Command : ./manage.py test

Current Behaviour :

DEBUG:kalite:Cache location = /tmp/kalite_web_cache_himanshu/34c707c6a5cb2e5719f4f6b5a49e41d8f283ae3a/
INFO:kalite:Purging pyc files
INFO:kalite:Failed to get dubbed video mappings; defaulting to empty.
Creating test database for alias 'default'...
..................................................................................................................................................................................................................................................................................................................................................................Fs.sINFO:kalite:Downloading language pack for lang_code=de, software_version=0.12.0
Downloading language pack 'de'
INFO:kalite:Retrieving language pack: de
Unpacking language pack 'de'
INFO:kalite:Unpacking new translations
Error: File is not a zip file
INFO:kalite:Cancelling process languagepackdownload
Es....F........F.F...E........F.EEFFFF.s..........................................................................................[][]Installed 16 object(s) from 1 fixture(s)
...INFO:kalite:Ignoring non-language pack de in /home/himanshu/sap/sap/ka-lite/locale/
Fs.....s.Superuser created successfully.
.Superuser created successfully.
.Superuser created successfully.
.INFO:kalite:Cancelling stage test_stage2 of process test_process
.INFO:kalite:Cancelling process test_process
.......INFO:kalite:Cancelling stage test_stage of process test_process
.INFO:kalite:Cancelling process test_process
.....INFO:kalite:Failed to get dubbed video mappings; defaulting to empty.
...WARNING:kalite:No unicode test for UpdateProgressLog; write one soon!
.Created 1 VideoFile models (and marked them as complete, since the files exist)
INFO:kalite:Failed to get dubbed video mappings; defaulting to empty.
.sCreated 1 VideoFile models (and marked them as complete, since the files exist)
INFO:kalite:Failed to get dubbed video mappings; defaulting to empty.
.INFO:kalite:Failed to get dubbed video mappings; defaulting to empty.
Created 1 VideoFile models (and marked them as complete, since the files exist)
INFO:kalite:Failed to get dubbed video mappings; defaulting to empty.
...sss........................
======================================================================
ERROR: test_delete_language_pack (kalite.distributed.tests.browser_tests.language_packs.LanguagePackTest)
Test to check whether a language pack is deleted successfully or not
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/browser_tests/language_packs.py", line 39, in test_delete_language_pack
    call_command("languagepackdownload", lang_code="de")
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/django/core/management/__init__.py", line 150, in call_command
    return klass.execute(*args, **defaults)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/fle_utils/django_utils/command.py", line 199, in execute
    super(LocaleAwareCommand, self).execute(*args, **kwargs)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/fle_utils/chronograph/management/croncommand.py", line 41, in execute
    super(CronCommand, self).execute(*args, **kwargs)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/django/core/management/base.py", line 240, in execute
    output = self.handle(*args, **options)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/updates/management/commands/languagepackdownload.py", line 82, in handle
    unpack_language(lang_code, zip_filepath=zip_filepath)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/updates/management/commands/languagepackdownload.py", line 123, in unpack_language
    z = zipfile.ZipFile(zip_fp or (zip_data and StringIO(zip_data)) or open(zip_filepath, "rb"))
  File "/usr/lib/python2.7/zipfile.py", line 766, in __init__
    self._RealGetContents()
  File "/usr/lib/python2.7/zipfile.py", line 807, in _RealGetContents
    raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file

======================================================================
ERROR: test_browser_add_facility (kalite.distributed.tests.browser_tests.distributed.TestAddFacility)
Add a facility
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/browser_tests/distributed.py", line 39, in test_browser_add_facility
    add_facility_url = self.reverse("add_facility")
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/testing/base.py", line 44, in reverse
    return self.live_server_url + reverse(url_name, args=args, kwargs=kwargs)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/django/core/urlresolvers.py", line 476, in reverse
    return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/django/core/urlresolvers.py", line 396, in _reverse_with_prefix
    "arguments '%s' not found." % (lookup_view_s, args, kwargs))
NoReverseMatch: Reverse for 'add_facility' with arguments '()' and keyword arguments '{}' not found.

======================================================================
ERROR: test_no_groups_no_users (kalite.distributed.tests.browser_tests.control_panel.TestUserManagement)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/browser_tests/control_panel.py", line 29, in test_no_groups_no_users
    self.assertEqual(self.browser.find_element_by_css_selector('div#groups p.no-data').text, "No Groups at this Facility", "Does not report no groups with no groups.")
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/selenium/webdriver/remote/webdriver.py", line 365, in find_element_by_css_selector
    return self.find_element(by=By.CSS_SELECTOR, value=css_selector)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/selenium/webdriver/remote/webdriver.py", line 681, in find_element
    {'using': by, 'value': value})['value']
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/selenium/webdriver/remote/webdriver.py", line 164, in execute
    self.error_handler.check_response(response)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/selenium/webdriver/remote/errorhandler.py", line 164, in check_response
    raise exception_class(message, screen, stacktrace)
NoSuchElementException: Message: u'Unable to locate element: {"method":"css selector","selector":"div#groups p.no-data"}' ; Stacktrace: 
    at FirefoxDriver.prototype.findElementInternal_ (file:///tmp/tmpmNirSu/extensions/fxdriver@googlecode.com/components/driver_component.js:8860)
    at FirefoxDriver.prototype.findElement (file:///tmp/tmpmNirSu/extensions/fxdriver@googlecode.com/components/driver_component.js:8869)
    at DelayedCommand.prototype.executeInternal_/h (file:///tmp/tmpmNirSu/extensions/fxdriver@googlecode.com/components/command_processor.js:10831)
    at DelayedCommand.prototype.executeInternal_ (file:///tmp/tmpmNirSu/extensions/fxdriver@googlecode.com/components/command_processor.js:10836)
    at DelayedCommand.prototype.execute/< (file:///tmp/tmpmNirSu/extensions/fxdriver@googlecode.com/components/command_processor.js:10778) 

======================================================================
ERROR: test_urls (kalite.distributed.tests.url_tests.UrlTestCases)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/url_tests.py", line 34, in test_urls
    self.validate_url('/securesync/add/student/', status_code=302)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/url_tests.py", line 23, in validate_url
    resp = Client().get(url)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/django/test/client.py", line 439, in get
    response = super(Client, self).get(path, data=data, **extra)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/django/test/client.py", line 244, in get
    return self.request(**r)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/facility/views.py", line 72, in add_facility_student
    return edit_facility_user(request, id="new", is_teacher=False)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/facility/decorators.py", line 80, in wrapper_fn
    return handler(request, *args, facility=facility, **kwargs)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/facility/decorators.py", line 103, in inner_fn
    return HttpResponseRedirect(reverse("add_facility"))
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/django/core/urlresolvers.py", line 476, in reverse
    return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/django/core/urlresolvers.py", line 396, in _reverse_with_prefix
    "arguments '%s' not found." % (lookup_view_s, args, kwargs))
NoReverseMatch: Reverse for 'add_facility' with arguments '()' and keyword arguments '{}' not found.

======================================================================
FAIL: test_cache_across_clients (kalite.distributed.tests.cache_tests.CachingTest)
Show that caching is accessible across all clients
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/cache_tests.py", line 70, in test_cache_across_clients
    self.assertTrue(caching.has_cache_key(path=video_path), "expect: Cache key exists after urllib get")
AssertionError: expect: Cache key exists after urllib get

======================================================================
FAIL: test_am_online (kalite.distributed.tests.internet_tests.OnlineTests)
The only thing I'm guaranteed to have online?  Myself.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/internet_tests.py", line 15, in test_am_online
    self.assertTrue(am_i_online(self.live_server_url), "Basic GET on myself")
AssertionError: Basic GET on myself

======================================================================
FAIL: test_query_status_admin (kalite.distributed.tests.browser_tests.query_tests.QueryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/browser_tests/query_tests.py", line 56, in test_query_status_admin
    self.browse_to(self.reverse("status"))
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/django/test/testcases.py", line 274, in __exit__
    executed, self.num
AssertionError: 6 queries executed, 9 expected

======================================================================
FAIL: test_query_status_teacher (kalite.distributed.tests.browser_tests.query_tests.QueryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/browser_tests/query_tests.py", line 62, in test_query_status_teacher
    self.browse_to(self.reverse("status"))
  File "/home/himanshu/sap/sap/ka-lite/kalite/../python-packages/django/test/testcases.py", line 274, in __exit__
    executed, self.num
AssertionError: 6 queries executed, 4 expected

======================================================================
FAIL: test_groups_one_group_one_user_in_group_no_ungrouped_no_group_selected (kalite.distributed.tests.browser_tests.control_panel.TestUserManagement)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/browser_tests/control_panel.py", line 64, in test_groups_one_group_one_user_in_group_no_ungrouped_no_group_selected
    self.assertEqual(self.browser.find_element_by_xpath("//div[@id='students']/table/tbody/tr/td[1]").text, "test_user", "Does not show user in list.")
AssertionError: Does not show user in list.

======================================================================
FAIL: test_login_mixed (kalite.distributed.tests.browser_tests.distributed.UserRegistrationCaseTest)
Tests that a user can login with the uppercased version of the email address that was registered
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/browser_tests/distributed.py", line 92, in test_login_mixed
    self.browser_register_user(username=self.username.lower(), password=self.password)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/browser_tests/base.py", line 79, in browser_register_user
    self.browser_form_fill(Keys.TAB) # skip language
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/testing/browser.py", line 227, in browser_form_fill
    self.browser_next_form_element()
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/testing/browser.py", line 212, in browser_next_form_element
    self.assertLessEqual(num_tabs, max_tabs, "# of tabs exceeded max # of tabs (orig element: tag '%s' text '%s')." % (cur_element.tag_name, cur_element.text))
AssertionError: # of tabs exceeded max # of tabs (orig element: tag 'input' text '').

======================================================================
FAIL: test_login_two_users_different_cases (kalite.distributed.tests.browser_tests.distributed.UserRegistrationCaseTest)
Tests that a user cannot re-register with the uppercased version of an email address that was registered
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/browser_tests/distributed.py", line 124, in test_login_two_users_different_cases
    self.browser_register_user(username=user1_uname, password=user1_password, first_name=user1_fname)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/browser_tests/base.py", line 79, in browser_register_user
    self.browser_form_fill(Keys.TAB) # skip language
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/testing/browser.py", line 227, in browser_form_fill
    self.browser_next_form_element()
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/testing/browser.py", line 212, in browser_next_form_element
    self.assertLessEqual(num_tabs, max_tabs, "# of tabs exceeded max # of tabs (orig element: tag '%s' text '%s')." % (cur_element.tag_name, cur_element.text))
AssertionError: # of tabs exceeded max # of tabs (orig element: tag 'input' text '').

======================================================================
FAIL: test_register_login_exact (kalite.distributed.tests.browser_tests.distributed.UserRegistrationCaseTest)
Tests that a user can login with the exact same email address as registered
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/browser_tests/distributed.py", line 81, in test_register_login_exact
    self.browser_register_user(username=self.username.lower(), password=self.password)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/browser_tests/base.py", line 79, in browser_register_user
    self.browser_form_fill(Keys.TAB) # skip language
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/testing/browser.py", line 227, in browser_form_fill
    self.browser_next_form_element()
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/testing/browser.py", line 212, in browser_next_form_element
    self.assertLessEqual(num_tabs, max_tabs, "# of tabs exceeded max # of tabs (orig element: tag '%s' text '%s')." % (cur_element.tag_name, cur_element.text))
AssertionError: # of tabs exceeded max # of tabs (orig element: tag 'input' text '').

======================================================================
FAIL: test_register_mixed (kalite.distributed.tests.browser_tests.distributed.UserRegistrationCaseTest)
Tests that a user cannot re-register with the uppercased version of an email address that was registered
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/browser_tests/distributed.py", line 103, in test_register_mixed
    self.browser_register_user(username=self.username.lower(), password=self.password)
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/distributed/tests/browser_tests/base.py", line 79, in browser_register_user
    self.browser_form_fill(Keys.TAB) # skip language
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/testing/browser.py", line 227, in browser_form_fill
    self.browser_next_form_element()
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/testing/browser.py", line 212, in browser_next_form_element
    self.assertLessEqual(num_tabs, max_tabs, "# of tabs exceeded max # of tabs (orig element: tag '%s' text '%s')." % (cur_element.tag_name, cur_element.text))
AssertionError: # of tabs exceeded max # of tabs (orig element: tag 'input' text '').

======================================================================
FAIL: test_am_online (kalite.main.tests.internet_tests.OnlineTests)
The only thing I'm guaranteed to have online?  Myself.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/himanshu/sap/sap/ka-lite/kalite/../kalite/main/tests/internet_tests.py", line 15, in test_am_online
    self.assertTrue(am_i_online(self.live_server_url), "Basic GET on myself")
AssertionError: Basic GET on myself

----------------------------------------------------------------------
Ran 554 tests in 327.903s

FAILED (failures=10, errors=4, skipped=10)
Destroying test database for alias 'default'...
bcipolli commented 10 years ago

Please retry after pulling the latest code and re-open with any current issues.