behave-django icon indicating copy to clipboard operation
behave-django copied to clipboard

How to generate test execution time breakdown

Open xiaoleATRI opened this issue 6 years ago • 3 comments

Hi, @mixxorz:

I want to have a logging about the test execution to analyze where the most of time has been consumed.

the list of timestamps could be as following:

  1. Time to set up the environment
  2. Time to create the database
  3. Time to load fixtures
  4. Time to execute test steps
  5. Time to destroy the database

Currently, I can use behave API to know the time spent in each step, scenario, feature but I don't know how to calculate the time in creation and deletion of database

Thanks

xiaoleATRI avatar Mar 08 '18 01:03 xiaoleATRI

Why do you not use the logging functionality and exclude logging (or at least the diagnostic categories / loggers) from being captured in behave ?

Then you only need to inject the logging statements that do the work at the correct places. The problem may be that part of the logging statement locations are in behave-django (@mixxorz @bittner ), I assume !?!

jenisys avatar Mar 10 '18 06:03 jenisys

The problem may be that part of the logging statement locations are in behave-django

Not sure that we do anything with logging. All that behave-django does is make sure that Django infrastructure is fired up and then run behave, passing in all command line parameters.

EDIT: I think, I get what you mean. Setting up and shutting down Django happens inside behave-django. This is where @xiaoleATRI wants to jump in to measure timings. :confused:

bittner avatar Mar 10 '18 07:03 bittner

If anyone is interested to add a performance measuring feature to behave-django a PR is welcome!

bittner avatar Apr 05 '19 09:04 bittner