Replace usage of dblog module at tests with alternative

Created on 27 December 2024, 28 days ago

Problem/Motivation

This is follow-up issue from πŸ“Œ Research using dblog at tests Active .

Some tests use dblog module to check log messages, this requires database connection.
In order to simplify this and improve test speed, we can use some alternatives.

Steps to reproduce

Check the code base.

Proposed resolution

For kernel tests there are options:

  1. Using \Symfony\Component\ErrorHandler\BufferingLogger. Example: πŸ“Œ Use BufferingLogger at SmartDefaultSettingsTest Active
  2. Implement LoggerInterface and log() at test class. Example: 59ce5ede

For some Functional tests these 2 options should work as well.

Remaining tasks

Decide what approach is better for each, and implement changes.

  • Drupal\Tests\comment\Kernel\CommentIntegrationTest
  • Drupal\Tests\field_ui\Kernel\EntityDisplayTest
  • Drupal\Tests\image\Kernel\ImageItemTest
  • Drupal\Tests\jsonapi\Kernel\ResourceType\RelatedResourceTypesTest
  • Drupal\KernelTests\Core\Action\EmailActionTest

These functional tests maybe we can also make replacement, but this need to be discussed.

  • Drupal\Tests\big_pipe\Functional\BigPipeTest
  • Drupal\Tests\media\FunctionalJavascript\MediaSourceOEmbedVideoTest
  • Drupal\Tests\node\FunctionalNodeCreationTest
  • Drupal\Tests\system\Functional\Module\ModuleTestBase

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

phpunit

Created by

πŸ‡·πŸ‡ΊRussia zniki.ru

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024