OpenNTI / nti.dataserver

Other
0 stars 0 forks source link

Still missing dependencies #362

Open jamadden opened 4 years ago

jamadden commented 4 years ago

In a CPython buildout, if I run bin/zope-testrunner —test-path=sources/nti.dataserver/src I get 1049 tests, 0 failures, 0 errors. This takes 10 minutes on my laptop.

However, if I run bin/compattest-nti.dataserver, which only includes the declared and transitive dependencies, I get 1049 tests, 13 failures, 13 errors and 10 skipped[1]. This takes 3 minutes.

This indicates that we're still missing dependencies needed for those tests to run. It's not entirely obvious off the bat which dependencies might those be; the errors are all over the place: A 404 instead of a 403 accessing a community, getting too many items back, a missing account creation link, etc.

FWIW, some profiling suggests that a lot of the extra time may be spent in SQLAlchemy, in turn suggesting that just having nti.analytics around to be imported/configured slows down the tests by up to a factor of 3.

[1] The test report for isolated tests:

Tests with errors:
   test_community_admin_restricted_forum (nti.app.forums.tests.test_application_community_forums.TestApplicationCommunityForums)
   test_set_entity_creation_site (nti.app.users.tests.test_admin_views.TestAdminViews)
   test_set_user_creation_site_in_site (nti.app.users.tests.test_admin_views.TestAdminViews)
   test_user_update_site_admin (nti.app.users.tests.test_admin_views.TestAdminViews)
   test_community_admin (nti.app.users.tests.test_community_views.TestCommunityViews)
   testVocabularyGetView (nti.app.vocabularyregistry.tests.test_views.TestViews)
   testVocabularyUpdateView (nti.app.vocabularyregistry.tests.test_views.TestViews)
   testVocabularyDetailsView (nti.app.vocabularyregistry.tests.test_views.TestVocabularyDetailsView)
   test_authenticate (nti.app.vocabularyregistry.tests.test_views.TestVocabularyDetailsView)
   test_authenticate (nti.app.vocabularyregistry.tests.test_views.TestVocabularyListView)
   test_sort_assessments (nti.appserver.tests.test_ugd_query_views.TestApplicationUGDQueryViews)
   test_remove_sites (nti.dataserver.utils.tests.test_remove_site.TestRemoveSite)
   test_community_admin (nti.dataserver.users.tests.test_users.TestCommunity)

Tests with failures:
   test_user_update (nti.app.users.tests.test_admin_views.TestAdminViews)
   test_communities_workspace (nti.app.users.tests.test_community_views.TestCommunityViews)
   test_community_auto_subscribe (nti.app.users.tests.test_community_views.TestCommunityViews)
   test_create_list_community (nti.app.users.tests.test_community_views.TestCommunityViews)
   test_membership_management (nti.app.users.tests.test_community_views.TestCommunityViews)
   test_user_info_extract_json_view (nti.app.users.tests.test_profile_views.TestUserInfoExtractView)
   testVocabularyListView (nti.app.vocabularyregistry.tests.test_views.TestVocabularyListView)
   test_brand (nti.appserver.brand.tests.test_externalization.TestExternalization)
   test_logon_ping_demo_site_policy (nti.appserver.tests.test_application.TestApplication)
   test_user_search_filtering_by_site (nti.appserver.tests.test_application_usersearch.TestApplicationUserSearch)
   test_mallowstreet_account_creation (nti.appserver.tests.test_logon.TestApplicationLogon)
   test_relevant_view_quiz (nti.appserver.tests.test_relevant_ugd_views.TestRelevantUGDView)
   test_handshake_existing_user_with_pass (nti.appserver.tests.test_logon.TestLogonViews)
Total: 1049 tests, 13 failures, 13 errors and 10 skipped in 3 minutes 14.127 seconds.
jamadden commented 4 years ago

Adding nti.app.sites.alpha, .demo, .mathcounts, and .prmia fixes all the failures (while still letting the analytics related packages stay out).