Add GenericModuleTestBase and use it to test general module things

Created on 11 September 2023, over 1 year ago
Updated 10 January 2024, 11 months ago

Problem/Motivation

πŸ“Œ Get rid of InstallUninstallTest RTBC is a single test that installs every module, then runs some standard checks.

HelpTopicsSyntaxTest is another one.

While these catch issues in modules that otherwise might not add their own coverage, they're very inefficient in that a single test run can take several minutes to complete. They also inherently don't enable contrib to test the same things.

Steps to reproduce

Proposed resolution

Add GenericModuleTestBase, this should require only an empty subclass.

This test would then install and uninstall the module, check hook_help(), and possibly other things that we'll think of later.

Then all core modules (but not test modules) can implement the test.

If we still want to ensure coverage of all core modules, we could add a unit test that discovers whether all non-testing modules have a subclass of this test.


namespace Drupal\Tests\my_module\Functional;

use Drupal\Tests\system\Functional\Module\GenericModuleTestBase;

/**
 * Generic module test for my_module.
 *
 * @group my_module
 */
class GenericTest extends GenericModuleTestBase {}

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Fixed

Version

10.1 ✨

Component
BaseΒ  β†’

Last updated about 9 hours ago

Created by

πŸ‡¬πŸ‡§United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024