Problem/Motivation

This is a followup for #731724: Convert comment settings into a field to make them work with CMI and non-node entities and #1812034: Only use standard profile where necessary in comment.module tests (10% bot speed-up).

Currently, the comment module tests are slow, bloated, fragile, and tightly coupled.

Proposed resolution

Once comment is decoupled from node, we can clean up the existing tests. Tasks:

  • Use more unit tests.
  • Use more API calls instead of performing every single CRUD operation through the UI.
  • Use test entities instead of nodes for testing basic comment functionality.
  • Remove the Views dependency added in #1806334: Replace the node listing at /node with a view from CommentNewIndicatorTest and CommentLinksTest, and test comment teaser rendering with a test implementation or direct API call instead of the frontpage node listing. (See #1847554: Decouple SummaryLengthTest from the node frontpage (and make it a bit faster).)
  • Use a proper xpath to check for the rendering of specific comments or comment elements instead of the weird regex in CommentTestBase::commentExists(). (See CommentThreadingTest::assertParentLink() for an example.)
  • Remove all the unnecessary debug() stuff.

Remaining tasks

This can happen later, and it doesn't make much sense to do it before #731724: Convert comment settings into a field to make them work with CMI and non-node entities, since that issue has already resolved its test failures. We can file individual issues for the above tasks then.

CommentFileSizeAuthor
#7 irc_log.txt4.16 KBandypost
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xjm’s picture

Issue summary: View changes

Updated issue summary.

Gaelan’s picture

I think this is a D9 issue now. Right?

xjm’s picture

@Gaelan Nah, changes to automated tests don't break backwards compatibility, so we can add them whenever. In this case, the issue we're waiting on is also still in progress for D8 because of its importance.

andypost’s picture

Status: Postponed » Active
andypost’s picture

Comment module - API changes
#2113323: Rename Comment::permalink() to not be ambiguous with ::uri()
- #2010202-14: Deprecate comment_uri()
#2028025: Expand CommentInterface to provide methods
#2188287: Split CommentManager in two
#2169361: Convert COMMENT_HIDDEN & COMMENT_CLOSED & COMMENT_OPEN to a constant on the comment field interface Assigned to: larowlan
#2097123: Deprecate comment_num_new() in favour of method on CommentManager Assigned to: roderik
#2156089: Remove comment_get_thread() in favour of method on CommentStorage Assigned to: roderik
#2068331: Convert comment SQL queries to the Entity Query API Assigned to: roderik

History module (api clean-up)
#1029708: History table for any entity
#2081585: [META] Modernize the History module

Comment statistics - nice to have
#2101183: Move {comment_entity_statistics} to proper service Assigned to: larowlan
#148849: Refactor {comment_entity_statistics} into performant Field Assigned to: David Strauss

Markup-twig
#2031883: Markup for: comment.html.twig
#1962846: Use field instance name for header of comment list, drop comment-wrapper template

UX
#1903138: Move global comment permissions to comment-type level
#2099421: Add an administrative description for a comment field
#1901110: Improve the UX for comment bundle pages and comment field settings

Entity
#2028025: Expand CommentInterface to provide methods
#2078387: Add an EntityOwnerInterface
#2099105: Clean-up render cache when permission changes

Fields
#1963340: Change field UI so that adding a field is a separate task
#552604: Adding new fields leads to a confusing "Field settings" form
#1875974: Abstract 'component type' specific code out of EntityDisplay

Clean-up - fixed
#2083895: Clean-up comment module doc blocks
#1978904: Convert comment_admin() to a Controller
#1975962: Move comment_links() into CommentRenderController
#1397282: Set comment #default_value to 'Hidden' for new node types

#2151427: Convert COMMENT_NOT_PUBLISHED & COMMENT_PUBLISHED to a constant on the comment interface
#2054993: Remove (untested, unused, broken) comment_get_recent() vs #1938062: Convert the recent_comments block to a view
#2111357: Get rid of comment_count_unpublished() in favor of CommentStorage method
#2157695: Remove unused _comment_get_modes()
#2157703: Deprecate comment_int_to_alphadecimal() & comment_alphadecimal_to_int() in favour of methods in Number component

andypost’s picture

Issue summary: View changes

Updated issue summary.

larowlan’s picture

Lets do this

andypost’s picture

Suppose #4 better move to subject or do we need separate issue

andypost’s picture

Discussed with catch at IRC, the suggestion is to preserve all old stuff by marking deprecated

larowlan’s picture

For the record, I agree with points in #4

larowlan’s picture

larowlan’s picture

anyone mind if we re-title this 'Comment/Forum/History path to beta'?

andypost’s picture

awesome idea, I just editing comment to not send notifications to all followers

sun’s picture

@andypost: Editing an existing comment on a meta issue defeats the purpose of a meta issue though. Most people who follow a meta issue do so with the intention to get notified when additional issues arise or to learn about new conclusions that are being drawn.

It would be best to move the comment in #4 into the issue summary.

That said, I've the impression that comment #4 suddenly started to re-purpose this meta issue to have a different goal than the original issue summary. → All issues that were originally referenced in the issue summary are closed as fixed already. So it might actually make most sense to move that comment into a new meta issue and mark this meta issue here as fixed, because apparently, all tasks of the original meta issue are done. ;)

andypost’s picture

andypost’s picture

andypost’s picture

xjm’s picture

Status: Fixed » Active

As far as I know the comment module tests still suffer all the deficiencies listed in the summary.

andypost’s picture

andypost’s picture

attiks’s picture

Not sure if this is the right place to mention it, but #2496699: Allow comments to be attached to entities using a string primary key

andypost’s picture

Yep, the related issue exposes non tested views handler, so it should be fixed here of in separate issue

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.