[CI] Run Unit tests on PHP 8.5 nightly

Created on 12 March 2025, 25 days ago

Problem/Motivation

After 📌 [CI] Introduce a separate stage for unit tests Active and Add a PHP 8.5 image for early testing Active we can now get Unit tests run under PHP 8.5, allowing failures.

This way we can spot deprecations and/or behavior changes well in advance of PHP 8.5 release.

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

phpunit

Created by

🇮🇹Italy mondrake 🇮🇹

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

Merge Requests

Comments & Activities

  • Issue created by @mondrake
  • Merge request !11453Closes #3512558 → (Closed) created by mondrake
  • Pipeline finished with Failed
    25 days ago
    Total: 474s
    #446828
  • First commit to issue fork.
  • 🇫🇷France andypost

    Fixed image tag to `dev`

  • Pipeline finished with Canceled
    25 days ago
    Total: 458s
    #446840
  • 🇫🇷France andypost

    I think we can reuse the issue to add daily test with 8.5

  • 🇫🇷France andypost

    Build tests fail for reason as Prophecy is strict in composer for supported versions

  • Pipeline finished with Failed
    25 days ago
    Total: 599s
    #446848
  • 🇫🇷France andypost

    but kernel test repeatedly fail

    ---- Drupal\KernelTests\Core\Image\ToolkitGdTest ----
    Status    Group      Filename          Line Function                            
    --------------------------------------------------------------------------------
    Fail      Other      phpunit-9.xml        0 Drupal\KernelTests\Core\Image\Toolk
        PHPUnit Test failed to complete; Error: PHPUnit 10.5.38 by Sebastian Bergmann and contributors.
        
        Runtime:       PHP 8.5.0-dev
        Configuration: /builds/issue/drupal-3512558/core/phpunit.xml.dist
        
        ............FF...............FF...............FF...............  63 / 120 ( 52%)
        FF...............FF...............FF.....................       120 / 120 (100%)
        
        Time: 01:44.995, Memory: 10.00 MB
        
        Toolkit Gd (Drupal\KernelTests\Core\Image\ToolkitGd)
         ✔ Manipulations with 0
         ✔ Manipulations with 1
         ✔ Manipulations with 2
         ✔ Manipulations with 3
         ✔ Manipulations with 4
         ✔ Manipulations with 5
         ✔ Manipulations with 6
         ✔ Manipulations with 7
         ✔ Manipulations with 8
         ✔ Manipulations with 9
         ✔ Manipulations with 10
         ✔ Manipulations with 11
         ✘ Manipulations with 12
           ┐
           ├ Image 'image-test.png' object after 'rotate_5' action has the correct color placement at corner '0' - Actual: {255,0,93,0}, Expected: {255,0,255,0}, Distance: 26244, Tolerance: 0
           ├ Failed asserting that 26244 is equal to 0 or is less than 0.                                                                                                                      
           │
           │ /builds/issue/drupal-3512558/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php:90
           │ /builds/issue/drupal-3512558/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php:357
           ┴
         ✘ Manipulations with 13
           ┐
           ├ Image 'image-test.png' object after 'rotate_transparent_5' action has the correct color placement at corner '0' - Actual: {255,93,93,46}, Expected: {255,255,255,127}, Distance: 59049, Tolerance: 0
           ├ Failed asserting that 59049 is equal to 0 or is less than 0.                                                                                                                                        
           │
           │ /builds/issue/drupal-3512558/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php:90
           │ /builds/issue/drupal-3512558/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php:357
           ┴
         ✔ Manipulations with 14
         ✔ Manipulations with 15
  • 🇮🇹Italy mondrake 🇮🇹

    IMHO we should not change the PHP default in this issue. Only use PHP 8.5 to run unit tests (no kernel, no build, no functional)

  • Pipeline finished with Failed
    24 days ago
    Total: 1023s
    #446872
  • Pipeline finished with Success
    24 days ago
    Total: 2146s
    #447143
  • 🇮🇹Italy mondrake 🇮🇹

    I suggest to address GD failures of the GDToolkit elsewhere.

  • 🇮🇹Italy mondrake 🇮🇹

    ftr, 📌 Deprecate TestDiscovery test file scanning, use PHPUnit API instead Active would add printout by run-tests.sh of the PHP version in use, which now is missing. ATM we would only be able to see it if a test fails and the full PHPUnit test class report is output.

  • 🇺🇸United States smustgrave

    Seems pretty straight forward lets do it.

    personal question how would contrib opt into 8.5?

    Also as someone mentioned in slack thank you for keeping up with these.

  • 🇮🇹Italy mondrake 🇮🇹

    #11 well that's a new image thanks to @andypost, following the scheme of the Docker images in use by Drupal - so theoretically it should be available to contrib too. But not my piece of cake, maybe some fine guys from the infra team can comment.

  • 🇫🇷France andypost

    I bet contrib testing needs some changes in templates but surely doable

  • 🇫🇷France andypost

    Filed for contrib 📌 Allow opt-in PHP 8.5 testing Active

    • catch committed 79888f7d on 11.x
      Issue #3512558 by andypost, mondrake: [CI] Run Unit tests on PHP 8.5...
  • 🇬🇧United Kingdom catch

    Committed/pushed to 11.x, thanks!

    We should add PHP 8.5 testing to Drupal 10.5.x too, but I think we can do that with a full pipeline once 11.x is green on a beta or similar. A lot of changes in the pipeline yaml between 10.x and 11.x these days so backporting this will be tricky.

  • 🇫🇷France andypost

    as of core 11.2 expected in June but first alpha of PHP 8.5 in July the only thing to change is CORE_PHP_NEXT after it #3513062-2: Allow opt-in PHP 8.5 testing

    PS: usually in PHP lots of deprecations are commited in late beta cycle(

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

Production build 0.71.5 2024