There are some Rules test failures in D10 which are to be expected at this point in time. D10 was just started a week ago and D10 testing was just made available a few days ago.

See the initial D10 test results in https://www.drupal.org/pift-ci-job/2269679

So far what I see is due to the new version of Symfony used by D10, which adds type hinting. Parts of Rules which extend Symfony or override Symfony methods (directly or indirectly, by extending Drupal core) need to change to have matching signatures.

See the change record for details of these changes and how they were addressed in core.
Various type hints have been added for Symfony subclasses

Comments

TR created an issue. See original summary.

tr’s picture

StatusFileSize
new629 bytes

The one that shows up in the initial tests is:
Fatal error: Declaration of Drupal\rules\Routing\RulesUiRouteSubscriber::getSubscribedEvents() must be compatible with Drupal\Core\Routing\RouteSubscriberBase::getSubscribedEvents(): array in /var/www/html/modules/contrib/rules/src/Routing/RulesUiRouteSubscriber.php on line 47

There are 56 test fails because of this.

Here's a patch to fix that. But since the tests stop when they encounter an error, chances are that more errors like this will show up when this is fixed and more of the test code is able to run.

As mentioned in the change record, this change is backwards compatible with D9.

tr’s picture

Status: Active » Needs review
tr’s picture

StatusFileSize
new1.11 KB

Well that fixed a lot of the errors, but as expected now that the test get past the point they used to fail, they encounter new problems.

There are now 20 test fails. Most of these new problems look like:

Exception: Error: Class "Symfony\Cmf\Component\Routing\RouteObjectInterface" not found
Drupal\rules\Routing\RulesUiRouteEnhancer->enhance()() (Line: 44)

This error is mentioned in the Change record: Usage of symfony-cmf/routing dependency deprecated The fix for this is available starting in Drupal 9.1, so we are safe to add this to Rules as the lowest supported version of core is now D9.2.

New patch fixes this and the problem from #2.

  • TR committed 764ce5f on 8.x-3.x
    Issue #3255139 by TR: [D10] Usage of symfony-cmf/routing dependency...
  • TR committed abbf826 on 8.x-3.x
    Issue #3255139 by TR: [D10] Symfony 6 type hints - RouteSubscriberBase::...
tr’s picture

Status: Needs review » Fixed

I've committed the fixes separately because I want the commit messages to reflect the problem, and we have two distinct problems here.

D10 tests now run green, and I will turn on weekly D10 testing in DrupalCI.

Status: Fixed » Closed (fixed)

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