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
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:
- 3465132-show-test-run
changes, plain diff MR !9013
Comments
Comment #3
catchWorks:
https://git.drupalcode.org/project/drupal/-/jobs/2297579
https://git.drupalcode.org/project/drupal/-/jobs/2297584
https://git.drupalcode.org/project/drupal/-/jobs/2297591
Comment #4
catchComment #5
spokjeNice!
Code changes make sense, idea makes (very much) sense, green tests => RTBC for me.
Nobody thought of this until now, although whilst reading the IS it all seems so obvious.
Blinded by the obvious perhaps...
Comment #6
mondrakefwiw… 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.
Comment #7
mondrakeIf 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.
Comment #8
catchRe-opened #2905007: Allow run-tests.sh to report skipped/incomplete PHPUnit tests since we'll be using run-tests.sh for a while yet.
Comment #9
mondrakeHairsplitting... it would be more sccurate to report the timing of execution that is included in the JUnit log.
Comment #10
nod_small naming detail
Comment #11
catchRenamed to duration.
Comment #12
catchMarkes sense.
Comment #16
nod_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