yunojuno / django-juno-testrunner

A more useful (and slightly more glamorous) test runner for Django 1.6+ from the folks at YunoJuno
MIT License
7 stars 9 forks source link

Log test run times (ms) #12

Closed hugorodgerbrown closed 9 years ago

hugorodgerbrown commented 9 years ago

Using the current output it's very hard to see which tests take the longest time to run. It would be really helpful to have a configuration switch (LOG_TEST_RUNTIMES?) that would then log to a file a parseable list of all tests, the runtime (in ms), and the results, e.g.

project.app.tests.test_one,123456,PASS
project.app.tests.test_two,7891234,PASS
project.app.tests.test_three,123456,ERROR
...
nealtodd commented 9 years ago

I had the same need, so I came up with this as something quick and dirty: https://gist.github.com/nealtodd/2baa040d945c3bd9f1c7

It just summarises the longest tests at the end of the run, and I was only interested in 1s resolution to help decide which tests to best focus on optimising in order to reduce the 10min wait for the suite to complete.

Sits on top of juno-testrunner rather than part of it, but feel free to borrow/steal any of it Hugo :)

hugorodgerbrown commented 9 years ago

Thank Neal - I think I may just do that.