Improve the failure message from Drupal\KernelTests\Core\DependencyInjection\AutowireTest

Created on 16 October 2023, 8 months ago
Updated 17 October 2023, 8 months ago

Problem/Motivation

Drupal\KernelTests\Core\DependencyInjection\AutowireTest fails if new services added to core aren't setup to use autowiring but from the failure message it is not obvious what needs to change.

Steps to reproduce

See https://www.drupal.org/pift-ci-job/2783034 β†’ for example

Proposed resolution

Improve the failure message

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Fixed

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated about 3 hours ago

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

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

Comments & Activities

  • Issue created by @larowlan
  • last update 8 months ago
    30,413 pass
  • @larowlan opened merge request.
  • Status changed to Needs review 8 months ago
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Sample output

    phpunit -c app/core app/core/tests/Drupal/KernelTests/Core/DependencyInjection/AutowireTest.php --filter=CoreSer
    ⏳️ Bootstrapped tests in 0 seconds.
    🐘 PHP Version 8.1.23.
    πŸ’§ Drupal Version 11.0-dev.
    πŸ—„οΈ  Database engine mysql.
    PHPUnit 9.6.13 by Sebastian Bergmann and contributors.
    
    Testing Drupal\KernelTests\Core\DependencyInjection\AutowireTest
    F                                                                   1 / 1 (100%)
    
    Time: 00:00.943, Memory: 12.00 MB
    
    There was 1 failure:
    
    1) Drupal\KernelTests\Core\DependencyInjection\AutowireTest::testCoreServiceAliases
    The following core services do not have map the class name to an alias. Add the following to core.services.yml in the appropriate place: 
    
    Drupal\Core\Foo: '@foo.class'
    
    Failed asserting that two arrays are identical.
    --- Expected
    +++ Actual
    @@ @@
         'Drupal\Core\TempStore\SharedTempStoreFactory' => 'tempstore.shared'
         'Drupal\Core\Pager\PagerManagerInterface' => 'pager.manager'
         'Drupal\Core\Pager\PagerParametersInterface' => 'pager.parameters'
    -    'Drupal\Core\Foo' => 'foo.class'
     )
    
    /data/app/core/tests/Drupal/KernelTests/Core/DependencyInjection/AutowireTest.php:115
    
    
    
  • Status changed to RTBC 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Output message seems clear and obviously way more helpful!

  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    Committed and pushed 2402f97b33 to 11.x and 09d7cff72b to 10.2.x and c354872a25 to 10.1.x. Thanks!

    • longwave β†’ committed c354872a on 10.1.x
      Issue #3394450 by larowlan: Improve the failure message from Drupal\...
    • longwave β†’ committed 09d7cff7 on 10.2.x
      Issue #3394450 by larowlan: Improve the failure message from Drupal\...
  • Status changed to Fixed 8 months ago
    • longwave β†’ committed 2402f97b on 11.x
      Issue #3394450 by larowlan: Improve the failure message from Drupal\...
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024