Problem/Motivation

gitlab collects and displays the amount of time each test method takes to run, which is useful.

However, Drupal core pipelines run concurrently by class, and test classes can have anything from one test method to hundreds of test method (invocations) via data providers. There is not currently an easy way to see how long any particular test class takes to run.

Wish I'd thought of this at the beginning of trying to optimize pipeline runs instead of when a lot of the work is done, since it probably would have saved hours trying to identify the slowest tests, however better late than never.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Drupal\Tests\comment\Functional\CommentPagerTest               5 passes   47s                                      
Drupal\Tests\config_translation\Functional\ConfigTranslation   2 passes   23s                                      
Drupal\Tests\comment\Functional\CommentPreviewTest             3 passes   48s                                      
Drupal\Tests\contact\Functional\ContactSitewideTest            2 passes   22s                                      
Drupal\Tests\contact\Functional\ContactStorageTest             3 passes   27s                                      
Drupal\Tests\contact\Functional\ContactPersonalTest            6 passes   29s                                      
Drupal\Tests\config_translation\Functional\ConfigTranslation   4 passes   38s                                      
Drupal\Tests\config_translation\Functional\ConfigTranslation   2 passes   39s                                      
Test run duration: 4 min 6 sec

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3465132

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

catch created an issue. See original summary.

catch’s picture

Issue summary: View changes
spokje’s picture

Status: Needs review » Reviewed & tested by the community

Nice!

Code changes make sense, idea makes (very much) sense, green tests => RTBC for me.

Wish I'd thought of this at the beginning of trying to optimize pipeline runs instead of when a lot of the work is done, since it probably would have saved hours trying to identify the slowest tests, however better late than never.

Nobody thought of this until now, although whilst reading the IS it all seems so obvious.
Blinded by the obvious perhaps...

mondrake’s picture

fwiw… well, #2905007: Allow run-tests.sh to report skipped/incomplete PHPUnit tests attempted this, but then it was stopped in the basis that the script would go in GitLab CI.

mondrake’s picture

If run-tests.sh remains, then IMHO reporting skipped/risky/incomplete would still be useful in PHPUnit times. Now it’s only pass/fail/exception which is very simpletest-ish.

catch’s picture

Re-opened #2905007: Allow run-tests.sh to report skipped/incomplete PHPUnit tests since we'll be using run-tests.sh for a while yet.

mondrake’s picture

Hairsplitting... it would be more sccurate to report the timing of execution that is included in the JUnit log.

nod_’s picture

Status: Reviewed & tested by the community » Needs work

small naming detail

catch’s picture

Status: Needs work » Needs review

Renamed to duration.

catch’s picture

Status: Needs review » Reviewed & tested by the community

Markes sense.

  • nod_ committed aea2e68e on 11.0.x
    Issue #3465132 by catch, Spokje, nod_: Show test run time by class in...

  • nod_ committed cab9c0a9 on 11.x
    Issue #3465132 by catch, Spokje, nod_: Show test run time by class in...
nod_’s picture

Version: 11.x-dev » 11.0.x-dev
Status: Reviewed & tested by the community » Fixed

Committed cab9c0a and pushed to 11.x. Thanks!
Committed aea2e68 and pushed to 11.0.x. Thanks!

Doesn't cherry pick to 10.4.x but I'm guessing we can get all the infos we need from the latest branches

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.