Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#10832 closed (fixed)

GIS test runner (run_tests) should reorder test suite like django.test.simple.run_tests

Reported by: Sean Legassick Owned by: jbronn
Component: GIS Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The GIS test runner should re-order tests so that django.test.testcases.TestCase subclasses come first, and other TestCase subclasses afterwards. These deals with an issue where TransactionTestCase tests that don't clean up the database before finishing can interfere with the correct running of TestCase tests. The attached patch uses the reorder_tests function from the django.tests.simple module in the same way as django.tests.simple.run_tests.

Attachments (1)

10832-gis-test-runner-reorders-test-suite.diff (760 bytes ) - added by Sean Legassick 16 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Karen Tracey, 16 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

I think the patch is correct but someone who knows something about gis (I did not even realize it had its own test runner) should verify. Particularly as there are apparently already some ordering requirements for gis testing in order to avoid segfaults...hopefully moving the TestCase tests to the front do not conflict with that?

comment:2 by Sean Legassick, 16 years ago

Gis actually has two test runners, one (run_gis_tests) used to test the gis codebase itself, another (run_tests) for use by external GIS-enabled projects in order to run their own tests (there is some extra setup of the test DB required to enable GIS functionality). It's the former that has particular ordering requirements to prevent segfaults, whereas my patch only affects the latter.

However I agree that it would be good to get Justin or another GIS core dev to verify that this is an appropriate change.

in reply to:  1 comment:3 by jbronn, 16 years ago

Owner: changed from nobody to jbronn

Replying to kmtracey:

Particularly as there are apparently already some ordering requirements for gis testing in order to avoid segfaults...hopefully moving the TestCase tests to the front do not conflict with that?

That segfault-prevention ordering was only needed when using the SpatiaLite 2.3 beta version. Fortunately, the 2.3 stable release and recent improvements in the way GeoDjango retrieves SRID information have made this ordering requirement moot, and I'll remove it when I patch this ticket.

comment:4 by jbronn, 16 years ago

Resolution: fixed
Status: newclosed

(In r10602) Fixed #10832 -- now use reorder_suite in GeoDjango test runner, thanks seanl for ticket & patch; restored original ordering of GEOS tests, as placing last no longer necessary.

comment:5 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top