Code

Opened 7 years ago

Closed 7 years ago

#3253 closed enhancement (fixed)

[patch] runtests.py should exit with nonzero status for failure or error

Reported by: mir@… Owned by: adrian
Component: Testing framework Version:
Severity: normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I propose to change the testing system so that for failures, runtests.py or manage.py test return with status code 1 in case of failures. This makes it easier to use the test system automatically.

The attached patch makes django.test.simple.run_tests return the number of failures and uses this return value in runtests.py and manage.py test.

Since I use the test system only for django itself, I didn't check whether it actually works for manage.py test.

Attachments (2)

runtests.diff (3.6 KB) - added by mir@… 7 years ago.
the patch
test_errors.diff (345 bytes) - added by paulegan@… 7 years ago.
Return value should count errors as well as failures

Download all attachments as: .zip

Change History (9)

Changed 7 years ago by mir@…

the patch

comment:1 Changed 7 years ago by mir@…

  • Type changed from defect to enhancement

comment:2 Changed 7 years ago by Simon G. <dev@…>

  • Triage Stage changed from Unreviewed to Design decision needed

comment:3 Changed 7 years ago by anonymous

  • Triage Stage changed from Design decision needed to Ready for checkin

#3576 is a duplicate (without patch) that has been promoted to Accepted, so I promote this one.

comment:4 Changed 7 years ago by mir@…

Last one was me.

comment:5 Changed 7 years ago by russellm

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

(In [4608]) Fixed #3253 -- Exposed the number of failed tests as a return code in manage.py and runtests.py.

Changed 7 years ago by paulegan@…

Return value should count errors as well as failures

comment:6 Changed 7 years ago by paulegan@…

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Summary changed from [patch] runtests.py should exit with nonzero status for failures to [patch] runtests.py should exit with nonzero status for failure or error

Test run does not exit status >0 on error.

See attachment:test_errors.diff

comment:7 Changed 7 years ago by russellm

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

(In [4850]) Fixed #3253 -- Included test errors in the return code.

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.