Page MenuHomePhabricator

Test failures from MoveLeadParagraphTransformTest::testIdentifyInfoboxElement on PHP 8.4
Closed, ResolvedPublic3 Estimated Story Points

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.Jan 29 2026, 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?

Change #1240777 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/MobileFrontend@master] MoveLeadParagraphTransformTest.testIdentifyInfoboxElement: Skip for PHP 8.4+

https://gerrit.wikimedia.org/r/1240777

@Jdforrester-WMF Hey there! We are working toward an experiment launch on Tuesday, the 24th. Can we wait on this a little longer until we meet our deadline, or will that be too painful?

Change #1240777 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] MoveLeadParagraphTransformTest.testIdentifyInfoboxElement: Skip for PHP 8.4+

https://gerrit.wikimedia.org/r/1240777

@Jdforrester-WMF Hey there! We are working toward an experiment launch on Tuesday, the 24th. Can we wait on this a little longer until we meet our deadline, or will that be too painful?

That's fine, yes — the overall work this blocks needs to get done in the next month or so, but it's not urgent.

Change #1245293 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/MobileFrontend@master] Fix testIdentifyInfoboxElement

https://gerrit.wikimedia.org/r/1245293

Change #1245293 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Fix testIdentifyInfoboxElement

https://gerrit.wikimedia.org/r/1245293