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

Files: 
CommentFileSizeAuthor
#7 2104123-7.patch24.22 KBdamiankloip
PASSED: [[SimpleTest]]: [MySQL] 58,343 pass(es).
[ View ]
#5 2104123-5.patch24.62 KBdamiankloip
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 2104123-5.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#5 interdiff-2104123-5.txt13.27 KBdamiankloip
#2 d8.MenuRouterTest-refactor.patch24.56 KBdamiankloip
PASSED: [[SimpleTest]]: [MySQL] 58,714 pass(es).
[ View ]

Comments

When I can actually upload the patch, I will.

Status:Active» Needs review
StatusFileSize
new24.56 KB
PASSED: [[SimpleTest]]: [MySQL] 58,714 pass(es).
[ View ]

I didn't spend too much time on time on this, but running locally this brought this test class down to ~1:30 mins.

Issue summary:View changes

Updated issue summary.

Status:Needs review» Reviewed & tested by the community

This is really worth considering given the amount of time saved for the bot.

Status:Reviewed & tested by the community» Needs work

+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php
@@ -633,4 +491,201 @@ public function testMenuOnRoute() {
+  function _testExoticPath() {

This has no visiblity on there in contrast to all other hunks in this patch.

Status:Needs work» Needs review
StatusFileSize
new13.27 KB
new24.62 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 2104123-5.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Good spot. Tim also wants the methods to be called doTest* instead, so let's change that too.

Status:Needs review» Needs work

The last submitted patch, 2104123-5.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new24.22 KB
PASSED: [[SimpleTest]]: [MySQL] 58,343 pass(es).
[ View ]

Forgot to rebase branch.

Status:Needs review» Reviewed & tested by the community

Great!!

Status:Reviewed & tested by the community» Fixed

IMO 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!

Status:Fixed» Closed (fixed)

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

Issue summary:View changes

Updated issue summary.