Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#10832 closed (fixed)

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

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

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 seanl 5 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 follow-up: Changed 5 years ago by kmtracey

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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 Changed 5 years ago by seanl

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.

comment:3 in reply to: ↑ 1 Changed 5 years ago by jbronn

  • 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 Changed 5 years ago by jbronn

  • Resolution set to fixed
  • Status changed from new to closed

(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 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.