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
andCommentLinksTest
, 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()
. (SeeCommentThreadingTest::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.
Comment | File | Size | Author |
---|---|---|---|
#7 | irc_log.txt | 4.16 KB | andypost |
Comments
Comment #0.0
xjmUpdated issue summary.
Comment #1
Gaelan CreditAttribution: Gaelan commentedI think this is a D9 issue now. Right?
Comment #2
xjm@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.
Comment #3
andypostComment #4
andypostComment 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
Comment #4.0
andypostUpdated issue summary.
Comment #5
larowlanLets do this
Comment #6
andypostSuppose #4 better move to subject or do we need separate issue
Comment #7
andypostDiscussed with catch at IRC, the suggestion is to preserve all old stuff by marking deprecated
Comment #8
larowlanFor the record, I agree with points in #4
Comment #9
larowlanAnd #1976172: Comment entity acquired and releases the different locks
And #2156089: Remove comment_get_thread() in favour of method on CommentStorage
Comment #10
larowlananyone mind if we re-title this 'Comment/Forum/History path to beta'?
Comment #11
andypostawesome idea, I just editing comment to not send notifications to all followers
Comment #12
sun@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. ;)
Comment #13
andypostFiled #2191565: [META] Comment/Forum/History path to beta
Comment #14
andypostComment #15
andypostfixed reference
Comment #16
xjmAs far as I know the comment module tests still suffer all the deficiencies listed in the summary.
Comment #17
andypostComment #18
andypostAlso tests should be extended for case #1181750-16: Removal of "Hidden" option in comment settings form may break programmatic form submissions
Comment #19
attiks CreditAttribution: attiks at Attiks commentedNot sure if this is the right place to mention it, but #2496699: Allow comments to be attached to entities using a string primary key
Comment #20
andypostYep, the related issue exposes non tested views handler, so it should be fixed here of in separate issue