Automated testing: Fix PHPUnit Tests errors

Created on 7 May 2024, 6 months ago
Updated 21 May 2024, 6 months ago

Problem/Motivation

Automated tests on Gitlab CI seem to be failing with the following errors:

See job: https://git.drupalcode.org/project/image_link_formatter/-/jobs/1536986#L75
Build: https://git.drupalcode.org/project/image_link_formatter/-/pipelines/166694

Time: 01:06.749, Memory: 4.00 MB
There were 2 errors:
1) Drupal\Tests\responsive_image_link_formatter\Functional\ResponsiveImageLinkFormatterTest::testResponsiveImageLinkFormatterWrappedImage
Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for field.field.node.article.msl10tgf with the following errors: field.field.node.article.msl10tgf:description non-scalar value but not defined as an array (such as mapping or sequence)
/builds/project/image_link_formatter/web/core/lib/Drupal/Core/Config/Development/ConfigSchemaChecker.php:98
/builds/project/image_link_formatter/vendor/symfony/event-dispatcher/EventDispatcher.php:220
/builds/project/image_link_formatter/vendor/symfony/event-dispatcher/EventDispatcher.php:56
/builds/project/image_link_formatter/web/core/lib/Drupal/Core/Config/Config.php:230
/builds/project/image_link_formatter/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php:278
/builds/project/image_link_formatter/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php:486
/builds/project/image_link_formatter/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php:257
/builds/project/image_link_formatter/web/core/lib/Drupal/Core/Entity/EntityBase.php:354
/builds/project/image_link_formatter/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:613
/builds/project/image_link_formatter/web/core/modules/image/tests/src/Kernel/ImageFieldCreationTrait.php:72
/builds/project/image_link_formatter/web/core/modules/image/tests/src/Kernel/ImageFieldCreationTrait.php:52
/builds/project/image_link_formatter/tests/src/Traits/Functional/ImageLinkFormatterTestTrait.php:142
/builds/project/image_link_formatter/responsive_image_link_formatter/tests/src/Functional/ResponsiveImageLinkFormatterTest.php:74
/builds/project/image_link_formatter/vendor/phpunit/phpunit/src/Framework/TestResult.php:729
2) Drupal\Tests\image_link_formatter\Functional\ImageLinkFormatterTest::testImageLinkFormatterWrappedImage
Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for field.field.node.article.nwpptft8 with the following errors: field.field.node.article.nwpptft8:description non-scalar value but not defined as an array (such as mapping or sequence)
/builds/project/image_link_formatter/web/core/lib/Drupal/Core/Config/Development/ConfigSchemaChecker.php:98
/builds/project/image_link_formatter/vendor/symfony/event-dispatcher/EventDispatcher.php:220
/builds/project/image_link_formatter/vendor/symfony/event-dispatcher/EventDispatcher.php:56
/builds/project/image_link_formatter/web/core/lib/Drupal/Core/Config/Config.php:230
/builds/project/image_link_formatter/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php:278
/builds/project/image_link_formatter/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php:486
/builds/project/image_link_formatter/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php:257
/builds/project/image_link_formatter/web/core/lib/Drupal/Core/Entity/EntityBase.php:354
/builds/project/image_link_formatter/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:613
/builds/project/image_link_formatter/web/core/modules/image/tests/src/Kernel/ImageFieldCreationTrait.php:72
/builds/project/image_link_formatter/web/core/modules/image/tests/src/Kernel/ImageFieldCreationTrait.php:52
/builds/project/image_link_formatter/tests/src/Traits/Functional/ImageLinkFormatterTestTrait.php:142
/builds/project/image_link_formatter/tests/src/Functional/ImageLinkFormatterTest.php:72
/builds/project/image_link_formatter/vendor/phpunit/phpunit/src/Framework/TestResult.php:729
ERRORS!
Tests: 17, Assertions: 316, Errors: 2.

Steps to reproduce

Seems to be affecting only the 2.2.x branch, which drops supports for 10.2 (supports 10.3 and above).
So affecting tests running with 10.3.x and 10.4.x.

Proposed resolution

Fix the errors and get the tests back to green.

📌 Task
Status

Fixed

Version

2.2

Component

Automated testing

Created by

🇫🇷France dydave

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