Problem/Motivation
This a followup to #3087061: Move existing assertions of IdConflict page to new test files.
The Upgrade tests adds content for testing the IdConflict form. There are now new tests just for that page and the Upgrade tests should not be adding content before the migration because migrations should run on an fresh install.
Steps to reproduce
Proposed resolution
Remove the creation of content before the upgrade.
This issue was already RTBC when #3259355: Always do a full phpstan analysis on DrupalCI was committed, so update code/phpstan-baseline.neon to allow a few more instances of an existing PHPStan exception. (See #17 and #18 for more details.) The problem comes from a trait that this issue adds in two more places, so this issue does not make it much harder to fix it.
Remaining tasks
Keep patch up to date
Commit
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #68 | 3266491-nr-bot.txt | 90 bytes | needs-review-queue-bot |
Issue fork drupal-3266491
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:
- 3266491-10.4-add-content-in
changes, plain diff MR !7882
- 3266491-add-content-in
changes, plain diff MR !7261
Comments
Comment #2
quietone commentedDuring testing I discovered that an activation email is only sent when a user is created before the upgrade runs. Since this patch removes the creation of content before the upgrade I considered removing the use of the test_mail_collector and the assertions on the emails sent. But that doesn't make sense, it is better to leave this in to ensure that any future changes does not change that number of emails sent.
Comment #4
quietone commentedDarn, I missed one.
Comment #5
mikelutzThis makes sense to me.
Comment #6
benjifisherThe patch for this issue needs a reroll after #3265424: Move migrate related aggregator tests to the module in preparation of removal in d10. I am adding the Novice tag for the reroll.
Comment #7
andregp commentedI'll work on this reroll
Comment #8
andregp commentedHere is the reroll for D9.4
Comment #10
quietone commentedFailure in Drupal\Tests\quickedit\FunctionalJavascript\LayoutBuilderQuickEditTest::testQuickEditIgnoresDuplicateFields so restoring RTBC
Comment #11
benjifisher@quietone:
I notice that the patch in #8 removes two @todo comments referring to #3267040: Remove @todo in migration functional tests. Can we close that issue as outdated?
@andregp:
I forgot to mention: there are separate patches in #4 for 9.4.x and 10.0.x. Can you reroll the 10.0.x version as well?
Comment #12
quietone commented@benjifisher, thanks for following up correctly.
Comment #13
andregp commented@benjifisher, sorry, I thought that as the D10 patch was still green it didn't need a reroll. I'll work on it.
Comment #14
andregp commentedHere's the reroll for D10 with a diff.
I'm also re-sending the same the patch file (for D9.4) from #8, just to keep everything in the same comment.
Comment #15
benjifisher@andregp:
Thanks for the reroll!
I compared the 10.0.x patch in #14 to both the 9.4.x patch in #8 and the 10.0.x patch in #4. The reroll looks good to me, so back to RTBC.
The testbot automatically re-tests patches (or MRs) for RTBC issues every two days, but it only runs one test per issue. Look for the little bot icon. The patch in #4 for 10.0.x was not being re-tested, so you saw the green from the one time it was tested.
@quietone:
I still wonder whether we can close #3267040: Remove @todo in migration functional tests since the patches in #10 and #14 remove the @todo comments.
Comment #16
benjifisherComment #17
benjifisherThis issue needs work. I think the reason is that Drupal's PHPStan rules just got stricter.
The patch in #10 uses
CreateTestContentEntitiesTraitin two test classes. That trait definesinstallEntitySchemas(), which callsinstallEntitySchema()(singular). Even though the trait's method is never called, PHPStan complains ifinstallEntitySchema()is not defined.I am not sure what the right fix is. Here are some possible approaches:
installEntitySchema()in the test classes, either directly or indirectly. For example, they could extend a base class or use a trait that defines it.CreateTestContentEntitiesTraitinto two (or more) more granular traits, and update every class that uses the trait.installEntitySchemas()in something likeif (method_exists(static::class, 'installEntitySchema')) { ... }(untested).Comment #18
danflanagan8Hmmm, this is a toughie!
To get myself up to speed, here are some facts. There are four entries for this in the phpstan baseline file:
The problem is for Functional tests using the
CreateTestContentEntitiesTrait. It's ok for the several Kernel tests that use the trait, since the method installEntitySchema method is defined on the KernelTestBase.In the interest of scope management I would say let's just add similar entries for to the phpstan baseline for
Drupal\Tests\migrate_drupal_ui\Functional\d6\IdConflictTestandDrupal\Tests\migrate_drupal_ui\Functional\d7\IdConflictTestand then fix all of these in a separate issue.If that's not allowed, I'd say let's postpone this issue and make a separate issue for fixing the existing problems logged in the phpstan baseline. Then come back to this one.
Comment #19
andregp commentedI tried the approach suggested on #18. Let's see if it will pass the tests.
Comment #20
andregp commentedEither it didn't work or I did something wrong =/
Comment #21
benjifisherI have attached a new patch for 10.0.x and an interdiff comparing it to #14 (skipping #19). I think the patch in #14 should still work for 9.4.x and 9.5.x.
@andregp, it looks as though you updated the class name in the
messagekey but not thepathkey. Also, the existing entries incore/phpstan-basline.neonseem to be ordered by path, and I have tried to be consistent with that. I am not sure how entries are ordered for a given path.@danflanagan8, thanks for pointing out the baseline file. I think the other references to
installEntitySchema()were added in #3260928: Move more PHPStan global ignore patterns to baseline, so I am adding that as a related issue. From the issue summary of that issue:According to that, we should figure out how to fix the problem first, and postpone this issue for now, as you suggested at the end of #18. But I agree with your first suggestion (implemented in the patch here). Since this issue was already RTBC when #3259355: Always do a full phpstan analysis on DrupalCI was committed, I think it makes sense to make an exception for this issue.
Comment #22
benjifisherIt looks as though I re-uploaded the patch from #14. The testbot did not like it any better the second time.
Luckily, I still have the patch that I meant to upload. I am not going to update the file name.
Comment #24
benjifisherOne of the failing tests is a FunctionalJavascript test, and the other is #3283795: ComposerHooksTest is broken on latest DrupalCI PHP container. Back to NR.
Comment #25
danflanagan8> Since this issue was already RTBC when #3259355: Always do a full phpstan analysis on DrupalCI was committed, I think it makes sense to make an exception for this issue.
Nice sleuthing, @benjifisher. I agree with this thinking.
The patch in #14 was already at RTBC. The patch at #22 is identical except for the additions to the phpstan baseline. The failures on #22 are unrelated to this issue. Therefore, I feel comfortable setting this back to RTBC.
Also I'm removing the Novice and Needs reroll tags, which are both outdated.
Comment #26
benjifisherThanks, @danflanagan8!
I am adding a little to the justification for adding some PHPStan baseline rules.
Comment #27
spokjePatch doesn't apply any more since 16 Jun 2022.
Comment #28
mrinalini9 commentedRerolled patch #22, please review it.
Comment #29
danflanagan8Thanks for the patch, @mrinalini9. Unfortunately, custom commands failed for #28. Back to NW.
Reviewing is easier when a re-roll diff is included as well. Please see the docs for instructions: https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa...
Thanks!
Comment #30
andregp commentedRe-doing the reroll of #22 with interdiff.
Comment #31
mikelutzReuploading both patches here for clarity. This is the 10.x patch from #30and the 9.4 patch from #8 Going to queue tests against 9.5 to see if it's still good.
Comment #32
mikelutzThis was already RTBC, and all it was was re-rolled, so back to RTBC.
Comment #33
benjifisherBoth patches (9.5.x and 10.0.x) need another reroll.
If we are lucky, then the testbot will automatically test against 10.0.x once we get this issue back to RTBC.
Comment #34
ravi.shankar commentedAdded reroll of patches #31 on Drupal 9.5.x. and Drupal 10.0.x.
Comment #36
benjifisher@ravi.shankar:
Thanks for the rerolls!.
It looks as though one of the tests for 9.5 needs to be adjusted. Back to NW for the failing test.
Comment #37
benjifisherThe 9.5 patch in #31 is the same as the patch from #8. I applied that to a commit on the 9.5.x branch from 2022-08-21 before #3293813: Move RDF-related tests to RDF module. Then I merged with the current HEAD of 9.5.x. The only difference from the patch in #34 was the entity counts for
menu_link_content, which caused the test for #34 to fail.Running the test locally, I see additional failures. I guess they are caused by recent changes (in the last week), perhaps moving additional tests. I adjusted the entity counts further to get the tests to pass, but maybe that deserves closer review.
I am attaching a new patch and an interdiff.
Edit: I think I selected 9.5.x when I uploaded the patch, but it looks like the testbot is using 10.0.x. If the patch does not apply, then I will try again.
Comment #38
quietone commentedSetting to NW for the test failure. Why didn't that happen automatically?
Comment #39
benjifisherIt turns out that the additional failures I mentioned in #37 were caused by some untracked files in my local copy of the repository. So I am hiding the patch from #37 and attaching an interdiff comparing my new one to the patch in #34.
The first paragraph of #37 still applies.
For 10.0.x, the patch from #34 should still work.
Comment #40
benjifisherMy fairy godmother gave me permission:
It looks as though I wrote the patch in #22, and @danflanagan8 reviewed it (RTBC) in #25. Since then, the only changes have been rerolls.
Both rerolls look right, so back to RTBC.
I am updating the target version to 10.1.x. I tested, and the patch still applies cleanly.
Comment #41
benjifisherComment #42
alexpottIf we're going to do this we should avoid changing the PHPStan baseline by making the following change:
This will allow the trait to be used in both kernel tests and functional tests without affecting the baseline. We will need to clear up the baseline though so the D10 and D9 patches will still need to be different.
Comment #43
vsujeetkumar commentedRe-roll patch created for 10.1.x, Please have a look.
Comment #44
vsujeetkumar commentedAddressed comment #42, Please have a look.
Comment #45
benjifisher@alexpott, thanks for the guidance.
@vsujeetkumar, the "Custom Commands Failed" status on the test means that static analysis (PHPStan, CSpell, or other) failed. Unfortunately, the testbot does not set the status to NW when this happens, so I am doing that now.
Looking at the testbot results, the problem may be that when you fixed the underlying problem, you did not remove the PHPStan baseline changes that we added in earlier patches.
Comment #46
quietone commentedI just applied the patch locally and the commit-code-checks pass. I will queue a retest.
Comment #47
shivam-kumar commentedTried to fix CCF #44, attaching the interdiff for reference.
Comment #49
quietone commentedRerolled and added the fix in #42. Because there was no interdiff in #43 I started from #39. There were only entity count changes in the Upgrade6 and Upgrade7 test.
Comment #50
smustgrave commentedCC failure.
Comment #51
smustgrave commentedComment #52
quietone commentedRemove lines from PHPStan baseline.
Comment #53
quietone commentedChanges to the entity counts in the forum tests.
Comment #54
smustgrave commentedSo many rerolls!
#53 looks to be passing though so hopefully last one.
Comment #55
quietone commentedA simple reroll. As is often the case it was the migrate Upgrade tests.
Comment #56
quietone commentedBecause the reroll was simple, I am restoring RTBC
Comment #59
quietone commentedConverted to an MR.
Comment #60
smustgrave commentedHopefully MR reroll will be the last
Comment #61
alexpottThis looks good but I think we need to sort out some cruftiness around \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeTestBase::assertEmailsSent()
Comment #62
quietone commentedThis removes the method and adds the email assertion to doUpgradeAndIncremental().
Comment #63
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 necessarily 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 #64
quietone commentedComment #65
smustgrave commentedFeedback appears to be addressed I believe. Unless we need to actually deprecate assertEmailsSent() but not sure with module specific test bases.
Hiding patches for clarity
Comment #66
alexpottThe recent changes look good - like where the asserting no emails have been sent has been added. One thing - I think we should deprecate the method before removing it because it is on a testbase class so part of the test API.
Comment #67
quietone commentedComment #68
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 necessarily 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 #69
quietone commentedComment #70
smustgrave commentedSo many rerolls sorry but can we open up 2 MRs now
1 for deprecation into 10.3.x
1 with those removals for 11.x
Comment #71
quietone commented@smustgrave, when asking for work on an issue it is best to explain why that work is needed so we all understand what you are thinking. I see no reason for 2 MRs given that alexpott has agreed to remove the deprecation on commit.
However, I thought it best to check while I am here and it turns out the MR no longer applies to both 11.x and 10.3.x or 10.4.x due to changed int he phpstan baseline. I rebased 11.x and pushed that. Unfortunately, I can't push to the branch I just created for 10.3. Yes, it is 10.3 not 10.4 like that name suggests.
Comment #73
quietone commentedThe 10.4 MR is now really on 10.4, not 10.3 like I said earlier.
Comment #74
smustgrave commentedDon't follow the MR is pointed to 10.4?
Isn't there suppose to be a deprecation?
Comment #75
benjifisherI added some comments to MR 7882 (targeting 10.4.x). Some or all may also apply to MR 7261.
@quietone, can you explain in the issue summary what should be done with the two PRs? In particular, how do we end up with the deprecation notice in the correct branch or branches?
Please also check the CR and the deprecation notice to make sure that they reference the correct branches.
Is it too late to deprecate this method and remove it in the 11.x branch? Is it even in scope for this issue? If so, then please explain in the issue description. Or maybe it is in scope, but too late to remove it in 11.x, in which case it might be simplest to defer it to a follow-up issue.
The issue summary says something about the changes to the PHPStan baseline. I think that needs to be updated, at least for the 10.4.x branch.
Comment #76
quietone commentedThe Migrate Drupal UI Module was approved for removal in #3371229: [Policy] Migrate Drupal and Migrate Drupal UI after Drupal 7 EOL.
This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
The deprecation work is in #3463321: Deprecate Migrate Drupal UI and the removal work in #3522601: [meta] Tasks to remove Migrate Drupal UI module.
Migrate Drupal UI will not be moved to a contributed project. It will be removed from core after the Drupal 12.x branch is open.
Comment #80
quietone commentedThis was a wee bit of cleanup that was never completed.
The Migrate Drupal and Migrate Drupal UI modules are deprecated and will be removed from Drupal 12. For these modules, effort is now focused on bug fixes and necessary tasks. Therefore, this task is closed as won't fix.
Thanks to all for working on this!