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
SimpleTest was deprecated in Drupal 8 and moved to contrib in Drupal 9. There has been no activity in the contrib issue queue and it seems everyone has migrated to PHPUnit, which was the desired outcome.
According to @catch in #3254725-2: [meta] Remove SimpleTest support:
We need an issue to remove the core/modules/simpletest folder. We should have removed it in #3261486: Remove core updates added prior to 9.3.0 and adjust test coverage.
Well, here it is.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3293288
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:
- 3293288-remove-the-coremodulessimpletest changes, plain diff MR !2450
Comments
Comment #2
SpokjeComment #4
longwaveThere is a reference in a migrate test for some reason:
This should probably be updated, but not sure what to!
Comment #5
SpokjeWeirdly, all kernel tests pass without removing it. I'll have a closer look at it, but I'm _very_ much not at home in the Migration World.
We might have to call in the Cavalry of Migration Subsystem Maintainers.
Comment #6
alexpott@longwave nice catch.
I'm pretty sure that this is due to the fact that simpletest used to have all the of the test files in it. Yep that's why.
The files all moved to 'core/test/fixtures/files' so the current setting should be 'core/test/fixtures' - and we can change this to that. FWIW this is not necessary because this is only used here:
And the file_directory_path is set to 'core/test/fixtures' but there is no harm in changing it in the test to something that makes sense.
Comment #7
alexpottWe missed #4 when we did #3080163: Decouple TestFileCreationTrait::getTestFiles() from simpletest module
Comment #8
longwaveNW for #6.
Comment #9
alexpottNote that #3080163: Decouple TestFileCreationTrait::getTestFiles() from simpletest module did update the drupal6 db fixture and change the file directory path... which is why everything works. So if something in contrib was depending on the trait setting it correctly it has been long since broken... so maybe it is better to remove it. The other option would be to update the Drupal6 db in one of that test and set the D6 variable to an empty string so we can have test coverage of the fallback...
We'd need to do something like
in one of the tests that use the trait.
Comment #10
SpokjeFWIW: I always get a blood red mist before my eyes when I see the wordremove
, so I kicked of a test on9.5.x
and10.0.x
as-is, with a straight up removal of\Drupal\Tests\file\Kernel\Migrate\d6\FileMigrationTestTrait::prepareMigration
here #3292008-16: [Ignore] In space (and/or this issue), no one can hear patches scream III just to see what happens.That was a bit much, now trying only removing
$source['site_path'] = 'core/modules/simpletest';
here #3292008-17: [Ignore] In space (and/or this issue), no one can hear patches scream IIIComment #11
SpokjeUnwanted Status change.
Comment #12
alexpott@Spokje removing
$source['site_path'] = 'core/modules/simpletest';
will work. But as per #9 this means we are lacking test coverage.What we need to do is set it to
core/test/fixtures
and then in\Drupal\Tests\file\Kernel\Migrate\d6\MigrateFileTest::setUp
addafter the call to the parent set up.
And then later in the test you will need to change the update of file_directory_path to an insert...ie...
Comment #13
SpokjeFine by me. Un-assigning myself since I've got way too many issues ATM.
Comment #14
alexpottI've fixed #12. What's really interesting is that \Drupal\Tests\file\Kernel\Migrate\d6\MigrateFileTest::testFiles already has this comment:
So it seems there was an intention to test without a file_directory_path variable set - so we are now reinstating that test coverage.
Comment #15
quietone CreditAttribution: quietone at PreviousNext commentedTook a moment to remember that the d6 source plugin uses site_path, but got there in the end. To be sure I was reading the test correctly (still recovery from flu) I walked through the test with the debugger and found it is working as expected and no test coverage has been lost.
Off we go!
Comment #17
catchCommitted/pushed to 10.1.x and cherry-picked to 10.0.x, thanks!