Now that test runs don't take eons locally, I was able to sort out how to convert most of the remaining comment test classes to the testing profile. After this patch only two remaining comment tests use standard, and in both cases I think it's reasonably justifiable.

CommentFileSizeAuthor
more-comment-tests.patch7.53 KBxjm

Comments

xjm’s picture

Couple points that may require explanation:

+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.phpundefined
@@ -69,7 +69,6 @@ function setUp() {
       'edit own comments',
       'post comments',
       'skip comment approval',
-      'access comments',
       'access content',

The diff here is misleading. I'd accidentally listed the permission twice in the previous patch, so this just removes the duplicate.

+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentNewIndicatorTest.phpundefined
@@ -41,8 +32,6 @@ public function testCommentNewCommentsIndicator() {
-    $count = $this->xpath('//div[@id=:id]/div[@class=:class]/ul/li', array(':id' => 'node-' . $this->node->nid, ':class' => 'link-wrapper'));
-    $this->assertTrue(count($count) == 1, 'One child found');

@@ -75,8 +64,6 @@ public function testCommentNewCommentsIndicator() {
-    $count = $this->xpath('//div[@id=:id]/div[@class=:class]/ul/li', array(':id' => 'node-' . $this->node->nid, ':class' => 'link-wrapper'));
-    $this->assertTrue(count($count) == 2, print_r($count, TRUE));

These assertions were completely superfluous and assumed specific markup and a very specific environment configuration completely unrelated to whether and when the "new comments" link and marker are rendered. So, I removed them.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for #1, that was very helpful.
Looks good.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Yay, faster tests!

Committed and pushed to 8.x.

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