Skip to content

Running individual test cases may fail? #995

Closed
kezabelle opened this Issue Sep 6, 2011 · 7 comments

3 participants

@kezabelle

Using develop on 9fb62e1, doing ./runtests.sh -f yields hundreds of dots, and then the celebratory Ran 355 tests in 349.566s

Running certain other test cases individually, some fail. Specifically, so far, I've got PlaceholderTestCase and RenderingTestCase as problems, supplying them as arguments (eg: ./runtests.sh -f <RenderingTestCase|PlaceholderTestCase>). I'm assuming these fail because they're unfortunately coupled to something else, but I've not looked into it further, and it could easily just be another quirk of my doing things on OSX :)

FAIL: test_details_view (cms.tests.rendering.RenderingTestCase)
Traceback (most recent call last):
  File "~/django-cms/cms/tests/rendering.py", line 135, in test_details_view
    self.assertEqual(r, u'|'+self.test_data['text_main']+u'|'+self.test_data['text_sub']+u'|')
AssertionError: u'|||' != u'|RenderingTestCase-main|RenderingTestCase-sub|'
Ran 3 tests in 3.061s

and

ERROR: test_fieldsets (cms.tests.placeholder.PlaceholderTestCase)
Traceback (most recent call last):
  File "~/django-cms/cms/tests/placeholder.py", line 98, in test_fieldsets
    ainstance = admin.site._registry[model]
KeyError: <class 'project.placeholderapp.models.Example1'>
Ran 1 test in 0.103s```
@ojii
ojii commented Sep 6, 2011

confirmed. looks like some tests leak state

@ojii ojii pushed a commit to ojii/django-cms that referenced this issue Sep 6, 2011
Jonas Obrist Fixed a part of #995 55ef6ef
@ojii
ojii commented Sep 6, 2011

"Fun" fact: running RenderinTestCase standalone fails, running eg test_show_uncached_placeholder on that test case standalone passes... some serious leaking going on here

@ojii
ojii commented Sep 6, 2011

Tagged 2.2, this is a testing-internal issue and unless this proves to be an issue beyond the test suite, this ticket will not force another RC and does not block a final release

@chrisglass

Thanks for reporting, I hate leaking tests.

@kezabelle

Right, I've modified the runtests script to go over each testcase individually, based on an array of:

AdminFieldsetTests
AdminListFilterTests
AdminTests
NoDBAdminTests
PluginPermissionTests
AdminFormsTests
PythonAPITests
ApphooksTestCase
DocsTestCase
FormsTestCase
MailTestCase
ManagementTestCase
BaseMenuTest
FixturesMenuTests
MenuTests
AdvancedSoftrootTests
ShowMenuBelowIdTests
ViewPermissionMenuTests
MenuUtilsTests
MiddlewareTestCase
MultilingualTestCase
NavExtenderTestCase
PagesTestCase
NoAdminPageTests
PreviousFilteredSiblingsTests
PermissionModeratorTests
PatricksMoveTest
ModeratorSwitchCommandTest
ViewPermissionTests
PlaceholderTestCase
PlaceholderActionTests
PlaceholderModelTests
PlaceholderAdminTest
PlaceholderPluginPermissionTests
PlaceholderConfTests
PluginsTestBaseCase
PluginsTestCase
FileSystemPluginTests
PluginManyToManyTestCase
SekizaiTests
LinkPluginTestCase
NoDatabasePluginTests
PoTest
PublisherTestCase
RenderingTestCase
ReversionTestCase
ReversionFileFieldTests
SecurityTests
SettingsTests
SiteTestCase
TemplatetagTests
TemplatetagDatabaseTests
ToolbarTests
ToolbarModeratorTests
ToolbarNoModeratorTests
UrlutilsTestCase
ViewTests

That list itself was collected via $ grep -R -P 'class .+?Test' cms/tests/ from the git clone root.

Additionally to the two previously outlined, the following produced errors individually, but not when the entire suite is run.

test_show_submenu_num_queries (cms.tests.menu.ShowSubMenuCheck)
test_not_in_navigation_num_queries (cms.tests.menu.ShowMenuBelowIdTests)
test_get_page_by_untyped_arg_none (cms.tests.templatetags.TemplatetagDatabaseTests)
test_show_toolbar_with_edit (cms.tests.toolbar.ToolbarTests)

The first two of those appeared to be query count differences, the latter two were to do with WSGIRequest not having current_page, and user I think.

@chrisglass

Whow, thanks.

@ojii
ojii commented Sep 8, 2011

Came to the conclusion that CMSTestCase.get_request has to die (in a fire)

@ojii ojii pushed a commit that closed this issue Sep 10, 2011
Jonas Obrist Fixed #995 5877965
@ojii ojii closed this in 5877965 Sep 10, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.