No way to use pdb (or gdb or other debuggers) via testrepository

Bug #606769 reported by James Westby
This bug report is a duplicate of:  Bug #902881: no way to drop into a debugger safely. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Testrepository
Triaged
Wishlist
Unassigned

Bug Description

pdb is hard to use within a test when run under testrepository, due to both subunit, and testrepositories own consumption of the output.

Parallel testing makes that more complex as well.

Tags: testr-run
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 606769] [NEW] Should have a way to run python tests in-process

perhaps two bugs - 'use pdb' and '???' whatever the second issue
(which isn't clear from your description) is.

Revision history for this message
Jonathan Lange (jml) wrote : Re: Should have a way to run python tests in-process

The second issue is related to bug 613129 – testr run uses the system "testr" to run load.

tags: added: testr-run
Revision history for this message
Robert Collins (lifeless) wrote :

jml - that seems a different issue.

I'm marking this incomplete pending feeback from james.

Changed in testrepository:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
James Westby (james-w) wrote :

If you have this as your test command

  python -m subunit.run $IDLIST

and you run testr with a different python version, then the system python will
still be used to run the tests.

If you are trying to do something like test with python2.4 then this makes it difficult,
or at least I think it could be easier.

Thanks,

James

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 606769] Re: Should have a way to run python tests in-process

So generally then - you want:
 - to write a generic command (python, ruby, perl)
 - run a different version of that command (python2.4, python2.5 etc)

The testr commands are shell scripts, you should be able to do
test_command=PYTHONPATH=. ${PYTHON:-python} -m subunit.run
testtools.tests.test_suite

and then export PYTHON=python2.4 before running testr.

However there is a separate bug preventing that due to my naive use of
string.Template.

summary: - Should have a way to run python tests in-process
+ No way to run python tests in-process
Revision history for this message
Robert Collins (lifeless) wrote :

Testr itself has this in its .testr.conf now:
test_command=${PYTHON:-python} -m subunit.run $LISTOPT $IDOPTION testrepository.tests.test_suite

so the multiple versions thing is thoroughly supported.

I'm going to retitle this about use of debuggers. It needs subunit support - basically moving out of line buffered mode, I think.

summary: - No way to run python tests in-process
+ No way to use pdb (or gdb or other debuggers) via testrepository
description: updated
Revision history for this message
Robert Collins (lifeless) wrote :

Duped on the other bug which has a much shorter history, easier to read ;)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.