On Wed, Jul 9, 2014 at 7:54 AM, Antoine Musso hashar+wmf@free.fr wrote:
The parser tests expectations can not be meet when one mix extensions together. For example the Cite tests have some images/thumbnails, when one installs the MultimediaViewer extension, the test file because the generated output adds data-file-width="1941" data-file-height="220" to the <img> elements.
That is due to MultimediaViewer registering the parser hook ThumbnailBeforeProduceHTML . And that is legit.
I am looking for ideas to properly fix extensions altering output and thus breaking other extensions parser tests.
A lame idea would be to have the Cite parser tests to unregister any hook altering HTML which are not registered by Cite. We could maybe come up with another repositories that has a different set of parsertests suitable for multiple extensions
What is the goal of running a test with a bunch of unrelated hooks installed? Speed/ops convenience? Reusing unit tests as integration tests to check for inter-extension conflicts?
If it's speed, just don't do it, IMO. Repeating the PHP bootstrap process once per extension can't be that much of an overhead.
If the goal is to test whether extensions interfere with each other, then having the test artificially unregister other extensions makes utterly no sense to me. Instead, the tests should be changed so that they don't make assumptions about parts of the output which is not under their control.