Unit tests are failing - Your XML configuration validates against a deprecated schema.

Created on 27 November 2023, 12 months ago
Updated 6 September 2024, 3 months ago

Problem/Motivation

Unit tests are failing:

	✗	
Drupal\Tests\ohdear_integration\Functional\OhdearIntegrationEndpointTest

fail: [Other] Line 0 of sites/default/files/simpletest/phpunit-1.xml:
PHPUnit Test failed to complete; Error: PHPUnit 9.5.28 by Sebastian Bergmann and contributors.

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

Testing Drupal\Tests\ohdear_integration\Functional\OhdearIntegrationEndpointTest
F                                                                   1 / 1 (100%)

Time: 00:01.435, Memory: 6.00 MB

There was 1 failure:

1) Drupal\Tests\ohdear_integration\Functional\OhdearIntegrationEndpointTest::testApiResponseData
Unable to install modules: module 'ohdear_integration' is incompatible with this version of Drupal core.

/var/www/html/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:479
/var/www/html/core/tests/Drupal/Tests/BrowserTestBase.php:547
/var/www/html/core/tests/Drupal/Tests/BrowserTestBase.php:366
/var/www/html/modules/contrib/ohdear_integration/tests/src/Functional/OhdearIntegrationEndpointTest.php:51
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

FAILURES!
Tests: 1, Assertions: 1, Failures: 1.

Steps to reproduce

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇸🇮Slovenia useernamee Ljubljana

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

Merge Requests

Comments & Activities

  • Issue created by @useernamee
  • 🇳🇱Netherlands roderik Amsterdam,NL / Budapest,HU

    FWIW: tried this in a ddev container where I have just installed this module:

    roderik@lupus-decoupled-web:/var/www/html$ vendor/bin/phpunit  web/modules/contrib/ohdear_integration/tests/src/Functional/OhdearIntegrationEndpointTest.php
    
    PHPUnit 9.6.15 by Sebastian Bergmann and contributors.
    
    Testing Drupal\Tests\ohdear_integration\Functional\OhdearIntegrationEndpointTest
    .                                                                   1 / 1 (100%)
    
    Time: 00:03.885, Memory: 4.00 MB
    
    OK (1 test, 15 assertions)
    
    Remaining self deprecation notices (3)
    
      2x: watchdog_exception() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Utility\Error::logException() instead. See https://www.drupal.org/node/2932520
        2x in OhdearIntegrationEndpointTest::testApiResponseData from Drupal\Tests\ohdear_integration\Functional
    
      1x: format_size() is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use \Drupal\Core\StringTranslation\ByteSizeMarkup::create($size, $langcode) instead. See https://www.drupal.org/node/2999981
        1x in OhdearIntegrationEndpointTest::testApiResponseData from Drupal\Tests\ohdear_integration\Functional
    

    The deprecation notices are not failures.

    Guessing: is it maybe your local(ly copied some time ago) phpunit.xml that is older and needs updating?

  • 🇸🇮Slovenia useernamee Ljubljana
  • 🇮🇳India ankitv18

    No more deprecations are reported as per phpstan pipeline: https://git.drupalcode.org/project/ohdear_integration/-/jobs/2519000 for both 1.x and 2.x branch
    I guess we can close this one.

  • Merge request !27#3404331: Fix unit tests. → (Merged) created by useernamee
  • Pipeline finished with Skipped
    3 months ago
    #262886
  • Status changed to Fixed 3 months ago
  • 🇸🇮Slovenia useernamee Ljubljana

    Tests are now green but they will need to be revised and take caching into account more.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024