Core schema tests (DefaultConfigTest and TestViewsTest) can't reliably check contrib.

Created on 9 December 2016, over 7 years ago
Updated 27 July 2023, 11 months ago

Problem/Motivation

Two core configuration schema tests (DefaultConfigTest and TestViewsTest) validate all modules' config/install/ and test_views/ entities, including contributed modules outside core. This happens without installing these modules or even checking their dependencies. Two problems with that:

  1. If a module's dependencies are not available (which is a reasonable outcome of installing a package A that contains an optional submodule depending on B, but not installing B), then it might contain configuration objects whose schemas aren't available.
  2. A module (or one of its dependencies) can implement hook_config_schema_info_alter() to modify schemas. Since the modules aren't installed while testing schemas, this hook isn't invoked, and the configuration is checked against the unaltered schema.

Symptoms

We're getting test failures on a site that has paragraphs β†’ , but not search_api β†’ .

The problem appears to be that paragraphs (whose main module does not depend on search_api) includes a "paragraphs_demo" submodule which depends on search_api. Even though the module should be ignored for its unfulfilled dependencies, its configuration files are still tested for schema errors. Without the search_api module, this causes its search_api-dependent configuration to fail testing.

We also get a test failure of Drupal\Tests\views\Kernel\TestViewsTest on ctools β†’ , because its submodule ctools_views installs views that use its own altered schema (adding a few extra display options). By checking these views against the unaltered schema, we get a false positive test failure.

Steps to reproduce

Proposed resolution

#10 suggests limiting the tests to just core modules
#16 suggests making the majority of this test could be some kind of base class, then contrib could just extend it and get a free checkup.

Remaining tasks

Decide on direction
Patch
Review
Commit

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
ConfigΒ  β†’

Last updated about 2 months ago

Created by

πŸ‡¨πŸ‡­Switzerland cburschka

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

Comments & Activities

Not all content is available!

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

Production build 0.69.0 2024