Problem/Motivation

We have some deprecation notices in our tests. See: https://dispatcher.drupalci.org/job/drupal8_contrib_patches/101683/testR...

Because of these deprecates we cannot test 8.x-5.x branch with Drupal 9.3.x, it just shows "Build Successful" instead of test results.

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

Matroskeen created an issue. See original summary.

matroskeen’s picture

Issue summary: View changes
matroskeen’s picture

Status: Active » Needs review
StatusFileSize
new1.39 KB

Let's see if this is enough at least for 9.3.x

matroskeen’s picture

StatusFileSize
new5.53 KB

Here is another patch that aims to fix also PHP 8.1 deprecations.

Unfortunately, it won't help because the "Build successful" message is present also when there are no deprecation messages at all!
See: https://www.drupal.org/pift-ci-job/2352908

The issue is somewhere else...

matroskeen’s picture

Title: Fix test deprecations » Fix deprecation warnings
StatusFileSize
new6.56 KB

  • Matroskeen committed 4ca6aa9 on 8.x-5.x
    Issue #3273003 by Matroskeen: Fix deprecation warnings.
    
matroskeen’s picture

StatusFileSize
new5.91 KB

I've changed return types in Iterator classes in 6.0.x branch to follow the same pattern as Drupal core.

  • Matroskeen committed 3c615f7 on 6.0.x
    Issue #3273003 by Matroskeen: Fix deprecation warnings.
    
matroskeen’s picture

StatusFileSize
new944 bytes

This is just an attempt to run tests without a custom drupalci.yml file.

matroskeen’s picture

Status: Needs review » Fixed

#9 was just a guess that custom drupalci.yml might cause "Build Successful" message, but it's not the case.

Deprecation messages for 9.3.x and PHP 8.1 are fixed in both branches. There is a deprecation message for 9.2.10, but that's not our problem: #3259744: PHPUnit 9.5.12 (released 2022-01-21) throws unhandled deprecation notice on "Drupal\Tests\Listeners\DrupalListener".

heddn’s picture

Are the return type changes really needed? They were passing at one point on 8.1. But then drush was falling over so tests couldn't run for a few weeks.

matroskeen’s picture

It wasn't needed for tests to pass, but I noticed that in core they added #[ReturnTypeWillChange] to existing classes for backward compatibility. I thought it was a more safe way to avoid the deprecations.
See: #3224523: [PHP 8.1] Add ReturnTypeWillChange attribute where necessary.

And speaking of "Build Successful" message (which triggered me to look into deprecations), it was fixed here: #3274227: Test results show "Build Successful" instead of fails/passes.

heddn’s picture

that is needed for BC if you support php 7.3 since return type isn't supported. See https://www.php.net/manual/en/language.types.declarations.php. Since we implicitly state php 7.4+ (see https://git.drupalcode.org/project/migrate_plus/-/blob/6.0.x/migrate_plu...), we don't really need to do that.

matroskeen’s picture

Oh, I see... Should we revert 6.0.x commit?

heddn’s picture

We could try and see if it still passes green on 7.4 and 8.1.

matroskeen’s picture

Status: Fixed » Closed (fixed)

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