Page MenuHomePhabricator

Test failures from MoveLeadParagraphTransformTest::testIdentifyInfoboxElement on PHP 8.4
Open, MediumPublic

Description

When running composer phpunit -- extensions/MobileFrontend --filter MoveLeadParagraphTransformTest locally on PHP 8.4, MoveLeadParagraphTransformTest::testIdentifyInfoboxElement has 5 test failures:

1) MoveLeadParagraphTransformTest::testIdentifyInfoboxElement with data set #1 ('<p></p><div class="infobox"></div>', '/html/body/div', 'Simple infobox')
Simple infobox
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/html/body/div'
+'/*/*[2]/*[2]'

/[...]/extensions/MobileFrontend/tests/phpunit/unit/transforms/MoveLeadParagraphTransformTest.php:39

2) MoveLeadParagraphTransformTest::testIdentifyInfoboxElement with data set #2 ('<p></p><div class="mw-stack">...</div>', '/html/body/div', 'Infobox wrapped in an known container')
Infobox wrapped in an known container
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/html/body/div'
+'/*/*[2]/*[2]'

/[...]/extensions/MobileFrontend/tests/phpunit/unit/transforms/MoveLeadParagraphTransformTest.php:39

3) MoveLeadParagraphTransformTest::testIdentifyInfoboxElement with data set #3 ('<p></p><div><table class="inf...</div>', '/html/body/div/table', 'Infobox wrapped in an unknown...tainer')
Infobox wrapped in an unknown container
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/html/body/div/table'
+'/*/*[2]/*[2]/*'

/[...]/extensions/MobileFrontend/tests/phpunit/unit/transforms/MoveLeadParagraphTransformTest.php:39

4) MoveLeadParagraphTransformTest::testIdentifyInfoboxElement with data set #4 ('<p></p><div class="thumb trig...</div>', '/html/body/div', 'Thumbnail')
Thumbnail
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/html/body/div'
+'/*/*[2]/*[2]'

/[...]/extensions/MobileFrontend/tests/phpunit/unit/transforms/MoveLeadParagraphTransformTest.php:39

5) MoveLeadParagraphTransformTest::testIdentifyInfoboxElement with data set #5 ('<p></p><figure></figure>', '/html/body/figure', 'Thumbnail (Parsoid)')
Thumbnail (Parsoid)
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/html/body/figure'
+'/*/*[2]/*[2]'

/[...]/extensions/MobileFrontend/tests/phpunit/unit/transforms/MoveLeadParagraphTransformTest.php:39

This is also seen on CI's PHP 8.4 check experimental tests -- e.g. https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php84/53/console.

Software versions:

Event Timeline

Jdlrobson-WMF subscribed.

Does this test fail consistently when Parsoid/legacy parser is enabled?

To confirm, do you mean when ext:ParserMigration is installed & $wgParserMigrationEnableParsoidArticlePages is set to true/false? If so -- yep, the tests fail every time I run them locally, whether that config variable is set to true or false.

HSwan-WMF triaged this task as Medium priority.Thu, Jan 29, 5:59 PM

Hi Readers team, this is the last blocker to enabling PHP 8.4 in CI. Do you have an estimate for when this will get fixed?