[GitLab CI] Improve failure reporting summary

Created on 1 October 2023, about 1 year ago
Updated 5 December 2023, 12 months ago

Problem/Motivation

If a pipeline fails, you have to click through to the failed job and ctrl-f to find the test failures.

DrupalCI's Drupal.org integration would (usually) show you which class failed and assertion errors or error messages at quite a high level.

For example:

https://git.drupalcode.org/project/drupal/-/pipelines/25459 shows a functional javascript failure.

If I click on 'failed jobs', I get:

      ./sites/simpletest/browser_output: found 2989 matching artifact files and directories 
Uploading artifacts as "archive" to coordinator... 201 Created  id=132615 responseStatus=201 Created token=64_dfbux
Uploading artifacts...
./sites/default/files/simpletest/phpunit-*.xml: found 204 matching artifact files and directories 
Uploading artifacts as "junit" to coordinator... 201 Created  id=132615 responseStatus=201 Created token=64_dfbux

Cleaning up project directory and file based variables

ERROR: Job failed: command terminated with exit code 1

If I click on Functional Javascript tests, I get the last lines of the console log:

https://git.drupalcode.org/project/drupal/-/jobs/132615

I ctrl-f for 'fail', I get to:

Drupal\Tests\media_library\FunctionalJavascript\FieldUiInteg   0 passes             1 exceptions             
FATAL Drupal\Tests\media_library\FunctionalJavascript\FieldUiIntegrationTest: test runner returned a non-zero error code (2).
Drupal\Tests\media_library\FunctionalJavascript\FieldUiInteg   0 passes   1 fails   

If ctrl-f again, I get the actual error:

 PHPUnit Test failed to complete; Error: PHPUnit 9.6.8 by Sebastian Bergmann
    and contributors.
    
    Testing
    Drupal\Tests\media_library\FunctionalJavascript\FieldUiIntegrationTest
    E                                                                   1 / 1
    (100%)
    
    Time: 00:31.405, Memory: 4.00 MB
    
    There was 1 error:
    
    1)
    Drupal\Tests\media_library\FunctionalJavascript\FieldUiIntegrationTest::testFieldUiIntegration
    Behat\Mink\Exception\ExpectationException: Checkbox "set_default_value" is
    not checked, but it should be.
    
    /builds/project/drupal/vendor/behat/mink/src/WebAssert.php:794
    /builds/project/drupal/vendor/behat/mink/src/WebAssert.php:736
    /builds/project/drupal/core/modules/media_library/tests/src/FunctionalJavascript/FieldUiIntegrationTest.php:100
    /builds/project/drupal/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    
    ERRORS!
    Tests: 1, Assertions: 23, Errors: 1.
    
    HTML output was generated

Where you actually need to go to is the 'tests' tab, then click into the type you want to check, like:

https://git.drupalcode.org/project/drupal/-/pipelines/25513/test_report

However, I wonder if we can make this easier.

Steps to reproduce

Proposed resolution

Get the class, assertion failure and backtrace into the 'failed jobs' tab.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component
PHPUnit 

Last updated about 15 hours ago

Created by

🇬🇧United Kingdom catch

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

Comments & Activities

Production build 0.71.5 2024