Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
While working on #2505283: Handle import of private files a number of faults were discovered in Drupal\Tests\file\Kernel\Migrate\d7\MigrateFileTest. These faults are being corrected for MigratePrivateFileTest in that ticket, but the same corrections should be applied to MigrateFileTest. These faults include (but not limited to):
- Use of
\Drupal::service()
rather than$this->container->get()
. - Redundant register of public stream wrapper.
Proposed resolution
Wait for #2505283: Handle import of private files to be fixed and then copy any improvements into MigrateFileTest.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#24 | 2860760-24.patch | 11.15 KB | jofitz |
#24 | interdiff-21-24.txt | 2.14 KB | jofitz |
#21 | 2860760-21.patch | 10.75 KB | jofitz |
#21 | interdiff-19-21.txt | 1.64 KB | jofitz |
#19 | 2860760-19.patch | 11.5 KB | jofitz |
Comments
Comment #2
jofitz CreditAttribution: jofitz at ComputerMinds commentedHere's a start point, but we'll wait until #2505283: Handle import of private files is in before doing any more.
Comment #3
jofitz CreditAttribution: jofitz at ComputerMinds commentedPostponing until #2505283: Handle import of private files is in.
Comment #6
heddnNo longer blocked.
Comment #7
jofitz CreditAttribution: jofitz at ComputerMinds commentedAdapted the trait to apply to both file migration tests.
Comment #9
jofitz CreditAttribution: jofitz at ComputerMinds commentedUpdate other use of FileMigrationTrait.
Comment #11
jofitz CreditAttribution: jofitz at ComputerMinds commentedPatch passed retest, setting back to Needs Review
Comment #12
heddnContrib uses this trait. Moving it will break them. We need to add a BC layer, or don't rename.
Comment #13
jofitz CreditAttribution: jofitz at ComputerMinds commentedReverted trait renaming.
Comment #14
heddnAll feedback addressed.
Comment #15
alexpottI've stared at this for a while and what confuses me is why these default settings for the public are on the common trait. It doesn't really make sense. The trait could have abstract methods to get these things so that tests know they need to set them in order to use it.
Comment #16
jofitz CreditAttribution: jofitz at ComputerMinds commentedAddressed @alexpott's comment in #15.
Comment #17
heddnI thought about it for a second, but we could easily do something else during implementation to make the file paths, etc different if we have more than a single file in a test. That's an implementation detail. So, back to RTBC.
Comment #18
alexpottLooking at how this has worked out. I think we need to add File to these names. I'm also tempted to suggest coalescing these methods into a getFileMigrationInfo() method that returns a keyed array of 'path', 'size', 'base_path', and 'plugin_id'. That way the trait is a little bit less "add-all-the-methods" and it is easier to grok that this is all related.
Comment #19
jofitz CreditAttribution: jofitz at ComputerMinds commentedI agree. Made changes according to #18.
Comment #20
alexpottI think the old assertions are better. Being explicit makes it more readable and obvious what is being tested.
Comment #21
jofitz CreditAttribution: jofitz at ComputerMinds commentedFair enough, I can understand the readability argument.
Put back the original assertions.
Comment #22
heddnLooking good again.
Comment #24
jofitz CreditAttribution: jofitz at ComputerMinds commentedCorrect test failures.
Comment #25
quietone CreditAttribution: quietone at Acro Commerce commentedAssigning to self for review
Comment #26
quietone CreditAttribution: quietone as a volunteer commentedRead through the issue, everything has been addressed. The most recent change was to correct a test failure that happened after the latest RTBC. So, retesting now to be sure it still passes tests.
Comment #27
quietone CreditAttribution: quietone as a volunteer commentedAll good to go back to RTBC.
Comment #28
quietone CreditAttribution: quietone as a volunteer commentedComment #30
jofitz CreditAttribution: jofitz at ComputerMinds commentedKicked off retest.
Comment #31
jofitz CreditAttribution: jofitz at ComputerMinds commentedAppears to have been a testbot error, back to RTBC.
Comment #32
alexpottCommitted and pushed 4784ac3d0f to 8.6.x and 19100d948a to 8.5.x. Thanks!