Next minor pipeline currently fails for

34 tests triggered 1 deprecation:
1) /builds/project/textimage/web/core/tests/Drupal/Tests/DrupalTestCaseTrait.php:94
Using the SYMFONY_DEPRECATIONS_HELPER environment variable to configure test runs is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. See https://www.drupal.org/node/3594014

Need to fix it.

Issue fork textimage-3623519

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mondrake created an issue.

mondrake’s picture

jonathan1055 made their first commit to this issue’s fork.

jonathan1055’s picture

Thanks for pointing me to this issue from our conversation on Slack

I note that you are using _PHPUNIT_CONCURRENT=0 therefore running the phpunit binary directly, not using run-tests.sh. Your project has its own phpunit.xml but you also specify _PHPUNIT_EXTRA: '-c $CI_PROJECT_DIR/$_WEB_ROOT/core so I think this means that the CI pipeline jobs will use the core file and ignore the projects own one. Thus also ignoring the change you made to add the new Drupal\TestTools\Extension\DeprecationBridge\DeprecationHandler

I made a change to remove the -c so that the CI job uses the project's own phpunit.xml and it failed with a more fundamental error. Is the reason for your projects own phpunit.xml so that you can make other customisations? was it for use locally or on other testing platforms, because it is not being used in Gitlab CI so far.

mondrake’s picture

Hi, and thanks. Not much thinking behind, to be honest. In HEAD it's using PHPUnit, not run-tests.sh, but no particular reason for that.

Feel free to adjust the gitlab config to your liking/test needs, no need to be constrained by the current setup.

Then we'll decide if the endgame is the right thing to commit or not.

jonathan1055’s picture

I have switched to using run-tests.sh which makes it easier to customise the deprecation settings without any need to alter (or even have) the project's own phpunit.xml - and the pipeline is all green. I also opted in to the manual 'Drupal CMS' job, just to show that this module is compatible with Drupal CMS

Your existing .deprecation-ignore.txt is used exactly as is, but now it is using the new DRUPAL_DEPRECATION_FILTER_CONFIG instead of SYMFONY_DEPRECATIONS_HELPER. I also set this for the 'next minor' variant, not the current one, because this functionality only starts in 11.5 not 11.4.

To demonstrate that this file is active, and that its not just the case that all deprecation warnings are disabled, I remove a couple of messages from your file and they do get reported in 'PHPunit Next Minor'

It all depends on how you want to be alerted to deprecations. You can leave it disabled on 'current' so that it is focussed on just the projects own tests. Any problem here will be a real test failure. I have set _AUTORUN_NEXT_MINOR: 'push-and-mr' so that when ever you are working on a MR the 'next minor' variant will run automatically and not be manual.

There is some tidy-up to do, which I will finish off once you have had a chance to see what I've done so far.

mondrake’s picture

Looks absolutely great. The next major failure is a different tin, let's leave that to later, I was just checking.

One comment inline, wonder whether we can avoid entirely setting the env variable if we have proper pointing to the correct deprecation ignore file in phpunit.xml.

Thanks