Problem/Motivation
Discovered whilst working on #2980750: [random test failure] Random failure in CommentStatisticsTest:
Currently the functional tests in the comment module use a lot of login/logout as an admin user solely to change settings.
However the methods that are used to change settings don't require admin permissions.
The change-a-comment-setting methods that are frequently surrounded by admin log in/out and can do without that are:
\Drupal\Tests\comment\Functional\CommentTestBase::setCommentAnonymous()
\Drupal\Tests\comment\Functional\CommentTestBase::setCommentPreview()
\Drupal\Tests\comment\Functional\CommentTestBase::setCommentForm()
\Drupal\Tests\comment\Functional\CommentTestBase::setCommentSubject()
\Drupal\Tests\comment\Functional\CommentTestBase::setCommentSettings()
user_role_change_permissions()
Steps to reproduce
Proposed resolution
Let's not log in/out as an admin user when we can change settings without needing admin power.
This should shave off a few seconds when running the tests.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3368175
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3368175-minimize-login-as
changes, plain diff MR !4218
Comments
Comment #3
spokjeComment #4
spokjeComment #5
smustgrave commentedSeeing as that didn't break any tests seems like a safe change.
Comment #6
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #7
spokjeRebased, back to RTBC
Comment #10
lauriiiCommitted 4bfd55f and pushed to 11.x. Thanks!
Comment #12
spokjeThanks @lauriii for the complementary reroll.
_tips hat_