Instead of having two conflicting filerepo configurations, one at /tmp/test-repo and another at a randomized path, and populating the one that isn't used with files, let's just have a single upload directory, populate it with files, and then actually use those files. This fixes a set of confusing system-dependent parser test failures. In the failure scenario, the file upload would be recorded, but then invalid JPEG metadata would trigger LocalFile::loadFromFile(), which would look for the file in the wrong place and mark it missing. Then parser tests would fail due to image links being broken (red). This is probably not as nice as the fake in-memory repo used by NewParserTest, but this approach does provide a richer integration test. This is a conservative fix that just fixes the things that are terribly broken rather than making new things. Also: * Clear the RepoGroup singleton, for completeness, since it doesn't make sense to set $wgLocalRepo without clearing it. Since we now set up a similar repo at initialisation to the one set up with each test, it probably doesn't have any effect. * Warn if gd is not present since this causes 49 test failures. * Use glob patterns in teardownUploadDir() instead of requiring every file to be individually listed. This fixes an error due to failure to delete a 240px file. Change-Id: I56a0e0d1cb363b40cf19c735e00cbb8929c1401a |
||
|---|---|---|
| .. | ||
| preprocess | ||
| extraParserTests.txt | ||
| parserTest.inc | ||
| ParserTestResult.php | ||
| parserTests.txt | ||
| parserTestsParserHook.php | ||
| README | ||
Parser tests are run using our PHPUnit test suite in tests/phpunit: $ cd tests/phpunit ./phpunit.php --group Parser You can optionally filter by title using --regex. I.e. : ./phpunit.php --group Parser --regex="Bug 6200"