zope.testrunner should only profile actual tests, not setup

Bug #159467 reported by Daniel Nouri
4
Affects Status Importance Assigned to Milestone
Zope 3
Won't Fix
Undecided
Unassigned
zope.testing
Invalid
Low
Roman Joost
zope.testrunner
Invalid
Low
Roman Joost

Bug Description

I'm trying to use the testrunner to profile my application. For this, it appears that layer setup code isn't really interesting. Thus, I've written this patch to defer calls to profile.enable() and profile.disable() to when the actual testing happens.

Revision history for this message
Daniel Nouri (daniel.nouri) wrote :
Tres Seaver (tseaver)
Changed in zope3:
status: New → Won't Fix
Tres Seaver (tseaver)
tags: added: bugday20100424
Changed in zope.testing:
importance: Undecided → Low
Revision history for this message
Roman Joost (romanofski) wrote :

I've had a look at this. Unfortunately the submitted patch doesn't apply anymore, because the code has already been refactored a lot.

Currently the profiler is enabled before the layer is setup:

    zope.testing.testrunner.profiling.py:125 (late_setup)

and stopped after all tests ran, but before the layer is teared down:

    zope.testing.testrunner.profiling.py:126 (early_teardown)

Please also check zope.testing.testrunner.feature.Feature for all the stages.

Now here's the thing: it looks like your suggested solution is only half implemented. To avoid the layer setup showing up, the profiler needs to be started/stopped multiple times (after/before each test_setup, test_teardown to be precise), but apparently this doesn't work with hotshot. I checked the python doc for hotshot and it appears to me, that it doesn't provide some kind of cumulative feature.

Did you intend with your patch to start/stop hotshot multiple times? If so, how is that supposed to work? If not, the profiler disable method should be set to "layer_setup".

Changed in zope.testing:
assignee: nobody → Roman Joost (romanofski-two)
status: New → Incomplete
Tres Seaver (tseaver)
Changed in zope.testrunner:
status: New → Incomplete
importance: Undecided → Low
assignee: nobody → Roman Joost (romanofski-two)
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope.testing project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope.testing.

Changed in zope.testing:
status: Incomplete → Invalid
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope.testrunner project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope.testrunner.

Changed in zope.testrunner:
status: Incomplete → Invalid
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.