Page MenuHomePhabricator

PHP notice from MMLGenerationTexUtilTest in Math extension
Closed, ResolvedPublic

Description

https://integration.wikimedia.org/ci/job/wmf-quibble-vendor-mysql-php74-docker/46788/consoleFull

INFO:quibble.commands:>>> Start: PHPUnit unit tests
INFO:quibble.commands:PHPUnit unit tests
INFO:quibble.commands:composer phpunit:unit -- --exclude-group Broken,ParserFuzz,Stub
> phpunit '--colors=always' '--testsuite=core:unit,extensions:unit,skins:unit' '--exclude-group' 'Broken,ParserFuzz,Stub'
Using PHP 7.4.33
Running without MediaWiki settings because there are no integration tests
PHP Notice:  Undefined index: \overarc{a} in /workspace/src/extensions/Math/tests/phpunit/unit/WikiTexVC/MMLGenerationTexUtilTest.php on line 249
PHP Notice:  Undefined index: \intent{a}{b} in /workspace/src/extensions/Math/tests/phpunit/unit/WikiTexVC/MMLGenerationTexUtilTest.php on line 249
PHPUnit 9.5.28 by Sebastian Bergmann and contributors.

...........................................................    59 / 23569 (  0%)
...........................................................   118 / 23569 (  0%)
...........................................................   177 / 23569 (  0%)

Event Timeline

Unfortunately, the provided link to the full console output seems not to work.
Could you or someone else provide information on how to reproduce those PHP notices locally or what could be a likely solution?

The path into the test is in the ticket description tests/phpunit/unit/WikiTexVC/MMLGenerationTexUtilTest.php the warning is prevalent in any execution of this test. However, CI runs disapear after some time. Here is a link to a later run. https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php74-noselenium-docker/146143/console im

Change 991318 had a related patch set uploaded (by Ni1313; author: Ni1313):

[mediawiki/extensions/Math@master] Manually added test for \overarc to TexUtil-Ref.json

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

Change 991318 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Add test for \overarc

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

I'm not sure if I understand: is the notice emitted because the code expects a test for \intent but the test doesn't exist yet? Can't it check if the test exists before trying to access it? Having this PHP notice before the PHPUnit output is a source of confusion, and the fact that it doesn't cause the build to fail is really just a bug (T214552).

Change #1017508 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):

[mediawiki/extensions/Math@master] Update test references

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

Change #1017508 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Update test references

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