Review all tests where system module is the only dependency

Created on 9 February 2018, over 7 years ago
Updated 30 August 2025, 7 days ago

Problem/Motivation

Follow-up to #2926068-25: Deprecate system_rebuild_module_data() and remove usages in core β†’ , @alexpott's comment:

There is likely to be a few other KernelTests where this is the case. Let's file a followup to review all tests where system is the only dependency. There are 52 tests where this is the case. For example the same code can be removed from \Drupal\Tests\field\Kernel\FieldDefinitionIntegrityTest but not from \Drupal\KernelTests\Core\Theme\ThemeInstallerTest - so working through that in a follow-up makes sense to me.

This issue is to remove system module dependencies that were created in Kernel and Browser tests just to call system_rebuild_module_data() or some other deprecated method.

Steps to reproduce

N/A

Proposed resolution

Create an issue fork by clicking the button.
Follow the instructions to pull down the fork.
Search core for public static $modules = ['system'];
If it is in a Kernel test delete the line.
Run the test locally
If it passes commit the change
If it fails undo the deletion
Note the test in the remaining tasks section for further investigation
Push up changes
Create MR
Set issue status to needs review

Remaining tasks

User interface changes

N/A

Introduced terminology

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

extension system

Created by

πŸ‡³πŸ‡¬Nigeria almaudoh

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    This should be a pretty good novice task.

  • First commit to issue fork.
  • πŸ‡³πŸ‡ΏNew Zealand quietone
  • πŸ‡ͺπŸ‡ΈSpain luismagr

    Hi,

    I'm going to go through the tests and add all the failed ones on the remaining task section when I finish so I only have to update the section once if that's ok.

    Thanks

  • πŸ‡ͺπŸ‡ΈSpain luismagr

    Hi all,

    I've pushed to the Issue fork individual commits per test and updated the list of remaining tests to remove the dependency. From here, I'm not sure if we want to fix them under this issue or if we want to create individual issues for each one.

    Thanks

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    @luismagr, Can you make an MR so the tests run?

  • Merge request !13161Resolve #2943436 "Review all tests" β†’ (Open) created by nicxvan
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Whoops forgot this was novice and created the MR.

    @luismagr great work so far! I created the MR in the future you can do that after pushing by clicking compare next to the branch on the issue then clicking create Merge request on the next page.

  • Pipeline finished with Success
    1 day ago
    Total: 3309s
    #590552
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    This is green, I think a good final step world be to remove it from FileTestBase and see if any tests fail.

  • πŸ‡ͺπŸ‡ΈSpain luismagr

    Thanks @quietone and @nicxvan

    Understanding the workflow was the idea behind working on this issue. Will create it next time for sure. Thanks for creating it this time.

    What about the abstract class FileTestBase? Do we need to commit it as part of the changes? Happy to commit it as part of the work.

    Thanks

  • Pipeline finished with Failed
    1 day ago
    Total: 6796s
    #590648
  • πŸ‡ͺπŸ‡ΈSpain luismagr

    It doesn't like the removal from FileTestBase. Shall we revert the commit or do we need to look at that change? Before the commit pipeline was green.

  • πŸ‡ͺπŸ‡ΈSpain luismagr

    An example of running the test locally. I got this

    1) Drupal\KernelTests\Core\File\FileMoveTest::testNormal
    Drupal\Core\Config\Schema\SchemaIncompleteException: No schema for system.file
    
    /var/www/html/core/lib/Drupal/Core/Config/Development/ConfigSchemaChecker.php:91
    /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php:246
    /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php:206
    /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php:56
    /var/www/html/core/lib/Drupal/Core/Config/Config.php:232
    /var/www/html/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php:43
    

    I guess the dependency needs to be injected at some other point

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Yes let's revert that thank you.

  • Pipeline finished with Success
    about 20 hours ago
    Total: 5276s
    #590949
  • πŸ‡ͺπŸ‡ΈSpain luismagr

    Reverted the one failing and added it to the remaining tasks section. Now is green again

  • πŸ‡ͺπŸ‡ΈSpain luismagr

    Btw @nicxvan, is this issue now in "needs review" or is it panned to fix the remaining tests in this one?

Production build 0.71.5 2024