Problem/Motivation

Some of the current calls to AssertLegacyTrait::assert(No)Text() in functional tests still have a message passed in, even if the methods do not take that in. We need to remove the messages from the calls and inline them as comments where appropriate.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3159788

Command icon 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:

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Status: Active » Needs review
StatusFileSize
new1.73 KB

Initial, discovery, patch.

Status: Needs review » Needs work

The last submitted patch, 2: 3159788-2.patch, failed testing. View results

mondrake’s picture

StatusFileSize
new33.85 KB
mondrake’s picture

StatusFileSize
new35.58 KB
mondrake’s picture

StatusFileSize
new96.49 KB
mondrake’s picture

StatusFileSize
new167.75 KB
ravi.shankar’s picture

Assigned: Unassigned » ravi.shankar

Working on this.

ravi.shankar’s picture

StatusFileSize
new231.13 KB
new63.1 KB
mondrake’s picture

@ravi.shankar be careful not to lose important context information when removing the message. In that case, a comment should be provided.

Looking at your interdiff,

  1. +++ b/core/modules/user/tests/src/Functional/UserCancelTest.php
    @@ -325,13 +325,13 @@ public function testUserAnonymize() {
    -    $this->assertText(t('Are you sure you want to cancel your account?'), 'Confirmation form to cancel account displayed.');
    +    $this->assertText(t('Are you sure you want to cancel your account?'));
    

    is ok because the message is just redundant, but

  2. +++ b/core/modules/user/tests/src/Functional/UserCreateTest.php
    @@ -108,16 +108,16 @@ public function testUserAdd() {
           $this->drupalGet('admin/people');
    -      $this->assertText($edit['name'], 'User found in list of users');
    +      $this->assertText($edit['name']);
           $user = user_load_by_name($name);
    
    +++ b/core/modules/user/tests/src/Functional/UserTimeZoneTest.php
    @@ -61,40 +61,40 @@ public function testUserTimeZone() {
         // Confirm date format and time zone.
         $this->drupalGet('node/' . $node1->id());
    -    $this->assertText('2007-03-09 21:00 0', 'Date should be PST.');
    +    $this->assertText('2007-03-09 21:00 0');
         $this->drupalGet('node/' . $node2->id());
    -    $this->assertText('2007-03-11 01:00 0', 'Date should be PST.');
    +    $this->assertText('2007-03-11 01:00 0');
         $this->drupalGet('node/' . $node3->id());
    -    $this->assertText('2007-03-20 21:00 1', 'Date should be PDT.');
    +    $this->assertText('2007-03-20 21:00 1');
    ...
         // Confirm date format and time zone.
         $this->drupalGet('node/' . $node1->id());
    -    $this->assertText('2007-03-10 02:00 1', 'Date should be Chile summer time; five hours ahead of PST.');
    +    $this->assertText('2007-03-10 02:00 1');
         $this->drupalGet('node/' . $node2->id());
    -    $this->assertText('2007-03-11 05:00 0', 'Date should be Chile time; four hours ahead of PST');
    +    $this->assertText('2007-03-11 05:00 0');
         $this->drupalGet('node/' . $node3->id());
    -    $this->assertText('2007-03-21 00:00 0', 'Date should be Chile time; three hours ahead of PDT.');
    +    $this->assertText('2007-03-21 00:00 0');
    

    are NOT OK because you are losing information (in the first case, that you are checking in a list, in the others 'why' a specific datetime is checked for). See the previous patches to see how to add an inline comment in that case. In case of doubt in a specific case, it's better add the comment anyway.

ravi.shankar’s picture

Thanks for reviewing @mondrake

I Will work on this.

mondrake’s picture

Assigned: ravi.shankar » mondrake

@ravi.shankar please unassign yourself from issues when you are not working on them. You currently are assigned on 7 active issues, which is unlikely you are concurrently working on.

mondrake’s picture

Assigned: mondrake » Unassigned
ravi.shankar’s picture

StatusFileSize
new259.68 KB

Sorry, I was bit busy with other things so I didn't get time to work on this issue.

Here I have tried to address comment #10 and fixed some more failed tests.

ravi.shankar’s picture

StatusFileSize
new30.82 KB

Forgot to add interdiff, so added here.

narendra.rajwar27’s picture

Working on it, will get back asap.

narendra.rajwar27’s picture

StatusFileSize
new320.63 KB
new57.14 KB
ravi.shankar’s picture

Working on this.

ravi.shankar’s picture

StatusFileSize
new436.24 KB
new116.36 KB

Let's wait for the testbot response.

mondrake’s picture

Status: Needs work » Needs review
StatusFileSize
new9.97 KB
new438.94 KB
mondrake’s picture

StatusFileSize
new440.79 KB
new3.99 KB

With proper deprecation message and deprecation tests.

mondrake’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
hardik_patel_12’s picture

Working on rerolling the patch.

hardik_patel_12’s picture

Status: Needs work » Needs review
StatusFileSize
new440.67 KB
new24.4 KB

Re-rolled the patch , kindly review.

quietone’s picture

Issue tags: -Needs reroll

@Hardik_Patel_12, thanks for the reroll. Please remove the 'needs reroll' tag when the reroll is done.

mondrake’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
kishor_kolekar’s picture

Status: Needs work » Needs review
StatusFileSize
new435.25 KB

Re-rolled the patch , please review

mondrake’s picture

Status: Needs review » Needs work
narendra.rajwar27’s picture

Working on the patch re-roll. Will update shortly.

siddhant.bhosale’s picture

narendra.rajwar27 can you please assign the issue to yourself if you are working on the issue.

narendra.rajwar27’s picture

Status: Needs work » Needs review
StatusFileSize
new435.18 KB
new3.03 KB

Adding patch after re-roll and reroll diff of patches. Since reroll diff is not an interdiff. Removing Needs reroll tag.
EDIT: Not removing tag yet. Let it get applied and pass the CI.

Thanks!!

Status: Needs review » Needs work

The last submitted patch, 31: 3159788-31.patch, failed testing. View results

narendra.rajwar27’s picture

Status: Needs work » Needs review
StatusFileSize
new440.88 KB
new5.88 KB

Fixing test case failure.

narendra.rajwar27’s picture

Issue tags: -Needs reroll
longwave’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Needs rerolling again, sorry.

ankithashetty’s picture

Assigned: Unassigned » ankithashetty

Working on re-roll.

ankithashetty’s picture

Assigned: ankithashetty » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new438.55 KB
new85.38 KB

Rerolled the patch in #33. Attached an diff_reroll_3159788_33-37.txt file as well. Kindly review.

Thank you!

Status: Needs review » Needs work

The last submitted patch, 37: 3159788-37.patch, failed testing. View results

hardik_patel_12’s picture

AssertLegacyTrait::assertNoText() with more than one argument is deprecated in drupal:8.2.0 and the method is removed from drupal:10.0.0. Use $this->assertSession()->responseNotContains() or $this->assertSession()->pageTextNotContains() instead. See https://www.drupal.org/node/3129738.

adityasingh’s picture

Issue tags: +Needs reroll

Tagging for patch reroll.

sarvjeetsingh’s picture

Assigned: Unassigned » sarvjeetsingh
sarvjeetsingh’s picture

Assigned: sarvjeetsingh » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new435.54 KB

Re-reolled the patch in #37. Please review.

Status: Needs review » Needs work

The last submitted patch, 42: 3159788-42.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

meena.bisht’s picture

Assigned: Unassigned » meena.bisht
meena.bisht’s picture

Assigned: meena.bisht » Unassigned
longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new436.87 KB
new2.27 KB

Fixed remaining instance and removed unused use statements.

mondrake’s picture

Status: Needs review » Needs work

Dammit, I just spent two hours reviewing with dreditor in light of #10, there are still so many cases where we lose important context information when removing the message. Then clicked on 'save' and 'paste' and puff - all lost.

I wonder if we can move this issue to merge request, and comment a bit more solidly in gitlab?

longwave’s picture

Oh no! Merge request seems like a good idea for such a large patch.

mondrake’s picture

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

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

shaktik’s picture

Status: Needs work » Needs review
StatusFileSize
new432.22 KB

Re-rolled the patch in #46 Kindly review.

Thank you!

Status: Needs review » Needs work

The last submitted patch, 52: 3159788-52.patch, failed testing. View results

ravi.shankar’s picture

Assigned: Unassigned » ravi.shankar
mondrake’s picture

Status: Needs work » Postponed
Issue tags: -Novice
Related issues: +#3145418: [November 9, 2020] Remove uses of t() in assertText() calls

Let's wait for #3145418: [November 9, 2020] Remove uses of t() in assertText() calls, and note that in this issue we no longer use patches, but rather we should git the issue fork and push changes to it.

ravi.shankar’s picture

Assigned: ravi.shankar » Unassigned
mondrake’s picture

Status: Postponed » Needs work
Issue tags: +Needs reroll

Please do not post patches, use the new merge request workflow instead.

mondrake’s picture

Issue tags: -Needs reroll

mondrake’s picture

Status: Needs work » Needs review
mondrake’s picture

Assigned: Unassigned » mondrake
Status: Needs review » Needs work

Reviewing to check losses of context by removing the message.

mondrake’s picture

Assigned: mondrake » Unassigned
Status: Needs work » Needs review

I finished my review.

longwave’s picture

Status: Needs review » Needs work

NW for review comments. The Gitlab interface is much nicer and feels a lot more reliable than dreditor!

mondrake’s picture

Status: Needs work » Needs review

Thanks for review @longwave! I have made some changes and commented over some of your comments, where I thinkwe should defer your suggestion to other issues to avoid scope creep. And yes, for large patches like this one the gitlab review workflow is certainly a big step forward.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

All review points addressed, three followups have been opened, I think this is ready to go.

mondrake’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll
mondrake’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs reroll
mondrake’s picture

Rerolled

catch’s picture

Status: Reviewed & tested by the community » Needs work

Overall looks good but I found a couple of nits (see PR).

mondrake’s picture

Status: Needs work » Reviewed & tested by the community

Done! Thanks

mondrake’s picture

  • catch committed 9ac7689 on 9.2.x
    Issue #3159788 by mondrake, ravi.shankar, narendra.rajwar27, longwave,...
catch’s picture

Version: 9.2.x-dev » 9.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.2.x and cherry-picked to 9.1.x, thanks!

  • catch committed b1e8878 on 9.1.x
    Issue #3159788 by mondrake, ravi.shankar, narendra.rajwar27, longwave,...

  • catch committed f7a814f on 9.1.x
    Revert "Issue #3159788 by mondrake, ravi.shankar, narendra.rajwar27,...
catch’s picture

Version: 9.1.x-dev » 9.2.x-dev
mondrake’s picture

@catch do we need a 9.1.x patch here, or we leave this with 9.2.x?

catch’s picture

Overall with phpunit changes I think it makes sense to backport them (without any deprecation message unsuppression) so that there are less conflicts between patches. So a 9.1.x patch is worth doing.

longwave’s picture

Version: 9.2.x-dev » 9.1.x-dev
Status: Fixed » Patch (to be ported)
mondrake’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new435.78 KB

Here's a 9.1 patch.

Status: Needs review » Needs work

The last submitted patch, 81: 3159788-81.patch, failed testing. View results

mondrake’s picture

Status: Needs work » Reviewed & tested by the community

Tentatively RTBC, this is just the 9.2.x commit + fix of #77.

  • catch committed 0578141 on 9.1.x
    Issue #3159788 by mondrake, ravi.shankar, narendra.rajwar27, longwave,...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the backport. Committed/pushed to 9.1.x now too.

Status: Fixed » Closed (fixed)

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