Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300001

Add GenericModuleTestBase and use it to test general module things

$
0
0

Problem/Motivation

#3386448: Get rid of InstallUninstallTest 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

Add tests per module, this should be scriptable since the only difference between the test files is the module name.

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 300001

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>