Address broken PHPUnit tests

Created on 25 August 2025, 17 days ago

Problem/Motivation

[0KRunning with gitlab-runner 18.1.3 (a2f2305f)[0;m
[0K  on gitlab-runner-67f584c56c-rv78g s8ex1X2yJ, system ID: r_jWDGKYCA92xq[0;m
[0K  feature flags: FF_NETWORK_PER_BUILD:true[0;m
[0K[36;1mResolving secrets[0;m[0;m
section_start:1756075216:prepare_executor
[0K[0K[36;1mPreparing the "kubernetes" executor[0;m[0;m
[0K"CPURequest" overwritten with "2"[0;m
[0KUsing Kubernetes namespace: gitlab-runner[0;m
[0KUsing Kubernetes executor with image drupalci/php-8.3-ubuntu-apache:production ...[0;m
[0KUsing attach strategy to execute scripts...[0;m
[0KUsing effective pull policy of [] for container chrome[0;m
[0KUsing effective pull policy of [] for container build[0;m
[0KUsing effective pull policy of [] for container helper[0;m
[0KUsing effective pull policy of [] for container init-permissions[0;m
[0KUsing effective pull policy of [] for container database[0;m
[0KUsing effective pull policy of [] for container selenium[0;m
section_end:1756075216:prepare_executor
[0Ksection_start:1756075216:prepare_script
[0K[0K[36;1mPreparing environment[0;m[0;m
[0KUsing FF_USE_POD_ACTIVE_DEADLINE_SECONDS, the Pod activeDeadlineSeconds will be set to the job timeout: 45m0s...[0;m
Waiting for pod gitlab-runner/runner-s8ex1x2yj-project-59632-concurrent-0-m25bip8s to be running, status is Pending
Waiting for pod gitlab-runner/runner-s8ex1x2yj-project-59632-concurrent-0-m25bip8s to be running, status is Pending
	ContainersNotReady: "containers with unready status: [build helper chrome database selenium]"
	ContainersNotReady: "containers with unready status: [build helper chrome database selenium]"
Waiting for pod gitlab-runner/runner-s8ex1x2yj-project-59632-concurrent-0-m25bip8s to be running, status is Pending
	ContainersNotReady: "containers with unready status: [build helper chrome database selenium]"
	ContainersNotReady: "containers with unready status: [build helper chrome database selenium]"
Running on runner-s8ex1x2yj-project-59632-concurrent-0-m25bip8s via gitlab-runner-67f584c56c-rv78g...

section_end:1756075307:prepare_script
[0Ksection_start:1756075307:get_sources
[0K[0K[36;1mGetting source from Git repository[0;m[0;m
[32;1mGitaly correlation ID: 2437915167[0;m
[32;1mFetching changes...[0;m
Initialized empty Git repository in /builds/project/date_ap_style/.git/
[32;1mCreated fresh repository.[0;m
[32;1mChecking out 5cda2f4f as detached HEAD (ref is 2.x)...[0;m

[32;1mSkipping Git submodules setup[0;m

section_end:1756075308:get_sources
[0Ksection_start:1756075308:download_artifacts
[0K[0K[36;1mDownloading artifacts[0;m[0;m
[32;1mDownloading artifacts for composer (3561920)...[0;m
Downloading artifacts from coordinator... ok      [0;m  correlation_id[0;m= host[0;m=drupal-gitlab-job-artifacts.s3.us-west-2.amazonaws.com id[0;m=3561920 responseStatus[0;m=200 OK token[0;m=64_kyZHxS

section_end:1756075316:download_artifacts
[0Ksection_start:1756075316:step_script
[0K[0K[36;1mExecuting "step_script" stage of the job script[0;m[0;m
[32;1m$ echo "COMPOSER_END_CODE=$COMPOSER_END_CODE" # collapsed multi-line command[0;m
COMPOSER_END_CODE=0
[32;1m$ if [ "$_SHOW_ENVIRONMENT_VARIABLES" == "1" ]; then # collapsed multi-line command[0;m
[32;1m$ mkdir -p $BROWSERTEST_OUTPUT_DIRECTORY[0;m
[32;1m$ mkdir -p $CI_PROJECT_DIR/$_WEB_ROOT/sites/default/files/simpletest[0;m
[32;1m$ chmod -R 755 $BROWSERTEST_OUTPUT_DIRECTORY[0;m
[32;1m$ chmod -R 755 $CI_PROJECT_DIR/$_WEB_ROOT/sites/default/files/simpletest[0;m
[32;1m$ ln -s $CI_PROJECT_DIR/$_WEB_ROOT /var/www/html[0;m
[32;1m$ chown -R www-data:www-data $CI_PROJECT_DIR[0;m
[32;1m$ service apache2 start[0;m
 * Starting Apache httpd web server apache2
 * 
[32;1m$ [[ $_TARGET_DB_TYPE == "sqlite" ]] && export SIMPLETEST_DB=sqlite://localhost/sites/default/files/db.sqlite # collapsed multi-line command[0;m
[32;1m$ php -r "include '$CI_PROJECT_DIR/vendor/autoload.php'; echo 'Drupal: ' . \Drupal::VERSION . PHP_EOL;" # collapsed multi-line command[0;m
Drupal: 11.0.8
PHP 8.3.24 (cli) (built: Aug 18 2025 00:13:55) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.24, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.24, Copyright (c), by Zend Technologies
[32;1m$ _PHPUNIT_TESTGROUPS=$(echo $_PHPUNIT_TESTGROUPS | sed -e 's/ //g')[0;m
[32;1m$ if [ "$_PHPUNIT_CONCURRENT" == "0" ]; then # collapsed multi-line command[0;m
Getting phpunit.xml.dist from web/core
Executing curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/scripts/prepare-phpunit-xml.php
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1727  100  1727    0     0  13199      0 --:--:-- --:--:-- --:--:-- 13284
 
*****************************************************************************************************************************
_PHPUNIT_CONCURRENT=0, _PHPUNIT_TESTGROUPS=--all, _PHPUNIT_EXTRA=
PHPUNIT_OPTIONS=, WHAT_TO_RUN=
executing: sudo -u www-data -E vendor/bin/phpunit  --bootstrap /builds/project/date_ap_style/web/core/tests/bootstrap.php /builds/project/date_ap_style/web/modules/custom/date_ap_style --log-junit /builds/project/date_ap_style/junit.xml  
PHPUnit 10.5.38 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.3.24
Configuration: /builds/project/date_ap_style/phpunit.xml

..........FF..............                                        26 / 26 (100%)

Time: 00:14.130, Memory: 4.00 MB

There were 2 failures:

1) Drupal\Tests\date_ap_style\Kernel\ApStyleDateFormatterTest::testMonthOnlySameMonthYear
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Sept.'
+'Sept. to  2024'

/builds/project/date_ap_style/tests/src/Kernel/ApStyleDateFormatterTest.php:245

2) Drupal\Tests\date_ap_style\Kernel\ApStyleDateFormatterTest::testMonthOnlyDifferentMonthsSameYear
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Sept. to Oct.'
+'Sept. to Oct. 2024'

/builds/project/date_ap_style/tests/src/Kernel/ApStyleDateFormatterTest.php:262

FAILURES!
Tests: 26, Assertions: 33, Failures: 2.
[32;1m$ cp /var/log/apache2/test.apache.access.log $CI_PROJECT_DIR/apache.access.log.txt[0;m
[32;1m$ cp /var/log/apache2/test.apache.error.log $CI_PROJECT_DIR/apache.error.log.txt[0;m
[32;1m$ exit $EXIT_CODE[0;m

section_end:1756075333:step_script
[0Ksection_start:1756075333:upload_artifacts_on_failure
[0K[0K[36;1mUploading artifacts for failed job[0;m[0;m
[32;1mUploading artifacts...[0;m
junit.xml: found 1 matching artifact files and directories[0;m 
/builds/project/date_ap_style/web/sites/default/files/simpletest: found 1 matching artifact files and directories[0;m 
/builds/project/date_ap_style/web/sites/simpletest/browser_output: found 1 matching artifact files and directories[0;m 
apache.access.log.txt: found 1 matching artifact files and directories[0;m 
apache.error.log.txt: found 1 matching artifact files and directories[0;m 
Uploading artifacts as "archive" to coordinator... 201 Created[0;m  correlation_id[0;m=2859776054 id[0;m=6300730 responseStatus[0;m=201 Created token[0;m=64_kyZHxS
[32;1mUploading artifacts...[0;m
junit.xml: found 1 matching artifact files and directories[0;m 
[0;33mWARNING: /builds/project/date_ap_style/web/sites/default/files/simpletest/phpunit-*.xml: no matching files. Ensure that the artifact path is relative to the working directory (/builds/project/date_ap_style)[0;m 
Uploading artifacts as "junit" to coordinator... 201 Created[0;m  correlation_id[0;m=4050661295 id[0;m=6300730 responseStatus[0;m=201 Created token[0;m=64_kyZHxS

section_end:1756075334:upload_artifacts_on_failure
[0Ksection_start:1756075334:cleanup_file_variables
[0K[0K[36;1mCleaning up project directory and file based variables[0;m[0;m

section_end:1756075335:cleanup_file_variables
[0K[31;1mERROR: Job failed: command terminated with exit code 1
[0;m

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States trackleft2 Tucson, AZ πŸ‡ΊπŸ‡Έ

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

Comments & Activities

Production build 0.71.5 2024