Page MenuHomePhabricator

Scribunto fetchLanguageName tests fail if CLDR is not installed
Closed, ResolvedPublic

Description

6 Scribunto PHPUnit tests fail if CLDR is not installed. These tests should be skipped instead.

On the Lua side, testframework.getTestProvider() gives name, func, args and expect parameters. A "skip" parameter could be added which skips tests in Scribunto_LuaEngineTestBase::testLua() if a given "skip tag" string is registered by the PHP layer.

builder@hhvm-syd:/mnt/build/src/mediawiki/core$ hhvm -c ~/etc/server.hdf tests/phpunit/phpunit.php ../extensions/Scribunto/tests/engines/LuaCommon/LanguageLibraryTest.php
PHPUnit 4.1.3 by Sebastian Bergmann.

Configuration read from /mnt/build/src/mediawiki/core/tests/phpunit/suite.xml

S..FF...F........................................S..FF...F....... 65 / 98 ( 66%)
.................................

Time: 15.13 seconds, Memory: 52.67Mb

There were 6 failures:

  1. LuaSandbox: LanguageLibraryTests[3]: fetchLanguageName (en,ru)

Failed asserting that two strings are identical.

  • Expected

+++ Actual
@@ @@
{

  • "английский",

+ "English",
}

/mnt/build/src/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LuaEngineTestBase.php:235
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:133
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:42

  1. LuaSandbox: LanguageLibraryTests[4]: fetchLanguageName (ru,en)

Failed asserting that two strings are identical.

  • Expected

+++ Actual
@@ @@
{

  • "Russian",

+ "русский",
}

/mnt/build/src/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LuaEngineTestBase.php:235
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:133
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:42

  1. LuaSandbox: LanguageLibraryTests[8]: fetchLanguageNames (de)

Failed asserting that two strings are identical.

  • Expected

+++ Actual
@@ @@
{

{
  • ["en"] = "Englisch",
  • ["ru"] = "Russisch",

+ ["en"] = "English",
+ ["ru"] = "русский",

},

}

/mnt/build/src/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LuaEngineTestBase.php:235
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:133
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:42

  1. LuaStandalone: LanguageLibraryTests[3]: fetchLanguageName (en,ru)

Failed asserting that two strings are identical.

  • Expected

+++ Actual
@@ @@
{

  • "английский",

+ "English",
}

/mnt/build/src/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LuaEngineTestBase.php:235
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:133
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:42

  1. LuaStandalone: LanguageLibraryTests[4]: fetchLanguageName (ru,en)

Failed asserting that two strings are identical.

  • Expected

+++ Actual
@@ @@
{

  • "Russian",

+ "русский",
}

/mnt/build/src/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LuaEngineTestBase.php:235
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:133
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:42

  1. LuaStandalone: LanguageLibraryTests[8]: fetchLanguageNames (de)

Failed asserting that two strings are identical.

  • Expected

+++ Actual
@@ @@
{

{
  • ["en"] = "Englisch",
  • ["ru"] = "Russisch",

+ ["en"] = "English",
+ ["ru"] = "русский",

},

}

/mnt/build/src/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LuaEngineTestBase.php:235
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:133
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:42

There were 2 skipped tests:

  1. LuaSandbox: Scribunto_LuaLanguageLibraryTests::testFormatDateTTLs

Language::sprintfDate does not set a TTL

/mnt/build/src/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LanguageLibraryTest.php:25
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:133
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:42

  1. LuaStandalone: Scribunto_LuaLanguageLibraryTests::testFormatDateTTLs

Language::sprintfDate does not set a TTL

/mnt/build/src/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LanguageLibraryTest.php:25
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:133
/mnt/build/src/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:42

FAILURES!
Tests: 98, Assertions: 96, Failures: 6, Skipped: 2.


Version: unspecified
Severity: normal

Details

Reference
bz67343

Event Timeline

bzimport raised the priority of this task from to Needs Triage.
bzimport set Reference to bz67343.
bzimport added a subscriber: Unknown Object (MLST).

Change 143325 had a related patch set uploaded by Anomie:
Allow for skipping Lua tests

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

Change 143325 merged by jenkins-bot:
Allow for skipping Lua tests

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