Last modified: 2014-11-14 01:01:30 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T75283, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 73283 - ImportTest::testHandlePageContainsRedirect causes MWException: Cannot create InputStreamSource
ImportTest::testHandlePageContainsRedirect causes MWException: Cannot create ...
Status: PATCH_TO_REVIEW
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
1.25-git
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-11 22:05 UTC by Marcin Cieślak
Modified: 2014-11-14 01:01 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Marcin Cieślak 2014-11-11 22:05:52 UTC
2) ImportTest::testHandlePageContainsRedirect with data set #1 ('<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.9/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.9/ http://www.mediawiki.org/xml/export-0.9.xsd" version="0.9" xml:lang="en">
        <page>
                <title>Test</title>
                <ns>0</ns>
                <id>42</id>
                <revision>
                        <id>421</id>
                        <timestamp>2014-05-27T11:00:00Z</timestamp>
                        <contributor>
                                <username>Admin</username>
                                <id>10</id>
                        </contributor>
                        <text xml:space="preserve" bytes="4">Abcd</text>
                        <sha1>n7uomjq96szt60fy5w3x7ahf7q8m8rh</sha1>
                        <model>wikitext</model>
                        <format>text/x-wiki</format>
                </revision>
        </page>
</mediawiki>', NULL)
MWException: Cannot create InputStreamSource.

/usr/home/saper/public_html/pg/w/tests/phpunit/includes/ImportTest.php:16
/usr/home/saper/public_html/pg/w/tests/phpunit/includes/ImportTest.php:28
phar:///usr/share/php/phpunit/phpunit.phar/PHPUnit/Framework/TestCase.php:976
phar:///usr/share/php/phpunit/phpunit.phar/PHPUnit/Framework/TestCase.php:831
phar:///usr/share/php/phpunit/phpunit.phar/PHPUnit/Framework/TestResult.php:648
phar:///usr/share/php/phpunit/phpunit.phar/PHPUnit/Framework/TestCase.php:776
/usr/home/saper/public_html/pg/w/tests/phpunit/MediaWikiTestCase.php:141
phar:///usr/share/php/phpunit/phpunit.phar/PHPUnit/Framework/TestSuite.php:775
phar:///usr/share/php/phpunit/phpunit.phar/PHPUnit/Framework/TestSuite.php:745
phar:///usr/share/php/phpunit/phpunit.phar/PHPUnit/Framework/TestSuite.php:705
phar:///usr/share/php/phpunit/phpunit.phar/PHPUnit/Framework/TestSuite.php:705
phar:///usr/share/php/phpunit/phpunit.phar/PHPUnit/Framework/TestSuite.php:705
phar:///usr/share/php/phpunit/phpunit.phar/PHPUnit/TextUI/TestRunner.php:349
phar:///usr/share/php/phpunit/phpunit.phar/PHPUnit/TextUI/Command.php:176
phar:///usr/share/php/phpunit/phpunit.phar/PHPUnit/TextUI/Command.php:129
/usr/share/php/phpunit/phpunit.phar:531

May be related to bug 72214, but that's a different message
Comment 1 Marcin Cieślak 2014-11-11 22:18:44 UTC
Simple smoke test is failing here (need to have Gerrit change #156446 installed to use print not print_r):

> print ImportStreamSource::newFromFile('data:application/xml,<xml><p>Hi</p></xml>');
<Error, collected 1 error(s) on the way, no value set>
+------+---------------------------+------------------------------------------+
|    1 | importcantopen            |                                          |
+------+---------------------------+------------------------------------------+
Comment 2 Marcin Cieślak 2014-11-11 22:39:06 UTC
So this was caused by Gerrit change #134079 which introduced "Import Testing".


This little thing now requires the use of fopen() with stream wrappers, data URL and .... "allow_url_open" set to "On"

Do we require allow_url_open to be enabled now?

It seems to be an overkill for some simple thing like providing a test string to an XML parser.


But here I think a monster thing called includes/Import.php is to blame
Comment 3 Gerrit Notification Bot 2014-11-11 22:54:50 UTC
Change 172657 had a related patch set uploaded by saper:
Skip ImportTest if allow_url_fopen disabled

https://gerrit.wikimedia.org/r/172657
Comment 4 Gerrit Notification Bot 2014-11-14 00:58:34 UTC
Change 173222 had a related patch set uploaded by saper:
Use ImportStringSource for simple import sources

https://gerrit.wikimedia.org/r/173222
Comment 5 Gerrit Notification Bot 2014-11-14 00:59:58 UTC
Change 173222 abandoned by saper:
Use ImportStringSource for simple import sources

Reason:
Wrongly submitted

https://gerrit.wikimedia.org/r/173222
Comment 6 Gerrit Notification Bot 2014-11-14 01:01:30 UTC
Change 173223 had a related patch set uploaded by saper:
Use ImportStringSource for simple import sources

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links