Page MenuHomePhabricator

UploadStashTest::testBug29408 gives error (directorycreateerror) in spanish, and no parameter substituted
Closed, ResolvedPublic

Description

  1. UploadStashTest::testBug29408

UploadStashFileException: Error storing file in '/var/www/wiki/w/tests/phpunit/includes/upload/bug29408.': No se pudo crear el directorio «$1».

/var/www/wiki/w/includes/upload/UploadStash.php:218
/var/www/wiki/w/tests/phpunit/includes/upload/UploadStashTest.php:42
/var/www/wiki/w/tests/phpunit/MediaWikiTestCase.php:75
/var/www/wiki/w/tests/phpunit/MediaWikiPHPUnitCommand.php:45
/var/www/wiki/w/tests/phpunit/phpunit.php:103

Test I guess failing due to file permissions, but the error message is not in English, and $1 isn't substituted

Might want pushing to core itself...

Noticed when running ALL tests


Version: 1.19
Severity: normal

Details

Reference
bz36353

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:21 AM
bzimport set Reference to bz36353.
bzimport added a subscriber: Unknown Object (MLST).

Run alone:

reedy@ubuntu64-web-esxi:/var/www/wiki/w$ php tests/phpunit/phpunit.php tests/phpunit/includes/upload/UploadStashTest.php
PHPUnit 3.6.10 by Sebastian Bergmann.

Configuration read from /var/www/wiki/w/tests/phpunit/suite.xml

E.

Time: 6 seconds, Memory: 47.25Mb

There was 1 error:

  1. UploadStashTest::testBug29408

UploadStashFileException: Error storing file in '/var/www/wiki/w/tests/phpunit/includes/upload/bug29408.': Could not create directory "$1".

/var/www/wiki/w/includes/upload/UploadStash.php:218
/var/www/wiki/w/tests/phpunit/includes/upload/UploadStashTest.php:42
/var/www/wiki/w/tests/phpunit/MediaWikiTestCase.php:75
/var/www/wiki/w/tests/phpunit/MediaWikiPHPUnitCommand.php:45
/var/www/wiki/w/tests/phpunit/phpunit.php:103

I'm guessing ArticleTablesTest::testbug14404() is at fault:

		$wgLanguageCode = 'es';
		$wgContLang = Language::factory( 'es' );

tearDown() does do

public function tearDown() {

		global $wgContLang, $wgLang, $wgLanguageCode;
		$wgLang = self::$oldLang;

		$wgContLang = self::$oldContLang;
		$wgLanguageCode = $wgContLang->getCode();
		self::$oldContLang = self::$oldLang = null;

}

Krinkle claimed this task.

We now have the MediaWikiLangTestCase base class that provides methods like setContentLang() and setUserLang() which avoid this kind of leakage. I can no longer reproduce the error with UploadStashTest either.