radarsh / gradle-test-logger-plugin

A Gradle plugin for printing beautiful logs on the console while running tests
Apache License 2.0
848 stars 38 forks source link

Show execution time of whole test class #284

Open dbardbar opened 2 years ago

dbardbar commented 2 years ago

Description

Add ability to show execution time of whole test class.

Additional information

Showing test class time has several benefits: 1) Show full execution time, including time spent in @BeforeAll or @AfterAll 2) Ability to see at high-level where time is wasted, especially if having hundreds of tests, spread over several test classes. Looking at the high-level per-class time helps to find and optimize test run time.

radarsh commented 2 years ago

I've been thinking of an idea to print the top-5 or top-n slow tests across the whole project. This along with a few other metrics could form a statistics summary.

giriprashant7891 commented 1 year ago

I would also appreciate this feature. Currently, I'm unable to track the time taken by Springboot to initiate the context for the class, as the tracking is only done at a test level. If we are able to track at the class level, along with the initialization time, that would be fantastic!

renoth commented 3 months ago

This is absolutely necessary to find the slow tests in a project, otherwise the duration metric is not very useful for tests with long setup times.