These failures appear in our most recent weekly test results dated 6 Oct 21, found at https://www.drupal.org/pift-ci-job/2199994 The previous week's results (29 Sept 21) did not have these failures.

The failures look like this:
Role label is expected to be a string. in /var/www/html/core/modules/user/user.module:851

The core change that caused this failure was #3232673: \Drupal\Core\Entity\EntityInterface::label() can return a NULL, which was committed on 30 Sept 21. That issue added an assert() into the user module to ensure that all Roles had a label. This was not explicitly checked in prior versions of core.

When Entity API tests need to use Roles, the tests create them like this: $role = Role::create(['id' => 'test_role']); which creates the Role with just an id but no label. This was common practice, and many core tests did the same thing. But this will no longer be sufficient. Core changed that in #3232673: \Drupal\Core\Entity\EntityInterface::label() can return a NULL so now Entity API has to change its tests also to ensure that the created Roles always have labels.

CommentFileSizeAuthor
#2 3241699-2-role-label.patch2.13 KBtr

Comments

TR created an issue. See original summary.

tr’s picture

Status: Active » Needs review
StatusFileSize
new2.13 KB
tr’s picture

That fixed all the "Role label is expected to be a string." test failures.

tr’s picture

Status: Needs review » Fixed

Because it's impossible to maintain a module with test failures, I'm going to just commit this even though no-one has bothered to review it.

  • TR committed cd76418 on 8.x-1.x
    Issue #3241699 by TR: Fix D9.3 test failures - "Role label is expected...

Status: Fixed » Closed (fixed)

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