Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Updated: Comment #N
Problem/Motivation
The Drupal\system\Tests\Menu\MenuRouterTest class currently takes over 9 minutes to run (on my local machine). There are around 25 test methods, so that is that many Drupal test installations :/
Proposed resolution
Consolidate the actual test methods and proxy the current methods inside, so they don't do full Drupal installations each time.
Remaining tasks
Review, etc..
User interface changes
None
API changes
None
Related Issues
Comment | File | Size | Author |
---|---|---|---|
#7 | 2104123-7.patch | 24.22 KB | damiankloip |
#5 | 2104123-5.patch | 24.62 KB | damiankloip |
#5 | interdiff-2104123-5.txt | 13.27 KB | damiankloip |
#2 | d8.MenuRouterTest-refactor.patch | 24.56 KB | damiankloip |
Comments
Comment #1
damiankloip CreditAttribution: damiankloip commentedWhen I can actually upload the patch, I will.
Comment #2
damiankloip CreditAttribution: damiankloip commentedI didn't spend too much time on time on this, but running locally this brought this test class down to ~1:30 mins.
Comment #2.0
damiankloip CreditAttribution: damiankloip commentedUpdated issue summary.
Comment #3
dawehnerThis is really worth considering given the amount of time saved for the bot.
Comment #4
dawehnerThis has no visiblity on there in contrast to all other hunks in this patch.
Comment #5
damiankloip CreditAttribution: damiankloip commentedGood spot. Tim also wants the methods to be called doTest* instead, so let's change that too.
Comment #7
damiankloip CreditAttribution: damiankloip commentedForgot to rebase branch.
Comment #8
dawehnerGreat!!
Comment #9
webchickIMO this is a great idea, and a pattern we may want to employ in other places where there are several related tests but it's not a huge issue for the rest results of the previous test to "leak" into subsequent test runs. It manages to still keep the code nicely separated so that each test function is distinct and legible on its own.
Committed and pushed to 8.x. Thanks!
Comment #10.0
(not verified) CreditAttribution: commentedUpdated issue summary.