Opened 4 years ago
Closed 4 years ago
#32591 closed Cleanup/optimization (fixed)
Change DiscoverRunner always to run _FailedTest "tests" first
Reported by: | Chris Jerdonek | Owned by: | Chris Jerdonek |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | DiscoverRunner, _FailedTest |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently, DiscoverRunner
's default test order is to run _FailedTest
objects in a last "catch-all" test-type group, and to order them in no particular way within that last group. Since Django already knows those tests have failed, it seems like it would be better for the user if Django always ran / reported those failed tests first. That would give the user quicker feedback. Also, when --failfast
is used, it would result in tests failing faster (namely right away), instead of possibly waiting for many tests to complete before getting to the _FailedTest
.
This could be implemented by changing reorder_tests() to prepend its list of classes with a bin for _FailedTest
objects.
Change History (4)
comment:1 by , 4 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 4 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Hey Chris — I'm happy to accept this.
With pytest I find the
-x --lf
combo to be quite effective. (That's not quite what you're proposing here I think, since--lf
will select only the tests that previously failed — but "Carry on if all those passed" is probably better behaviour...)I don't know if folks will have thoughts on the exact behaviour they're after, but I suspect we'll find out in review 😀
Thanks.