Page MenuHomePhabricator

phpunit failure: LuaStandalone: TitleLibraryTests: Failed asserting that two strings are identical
Closed, ResolvedPublic

Description

When runnning with a bunch other extensions (under php5), http://paste.debian.net/111811/

  1. LuaSandbox: TitleLibraryTests[46]: .fullUrl()

Failed asserting that two strings are identical.

  • Expected

+++ Actual
@@ @@
{

  • "//wiki.local/wiki/Main_Page",

+ "//wiki.local/wiki/Main_Page#Section_8",

"//wiki.local/wiki/Module:TestFramework",
"//test.wikipedia.org/wiki/Module:TestFramework",
"//wiki.local/wiki/Talk:Has/A/Subpage#frag",
"//wiki.local/wiki/Not/A/Subpage",
"//wiki.local/wiki/Module_talk:Test_Framework#_frag_frag",
"//wiki.local/wiki/Module_talk:Test_Framework#_frag_frag",

}

/srv/vagrant/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LuaEngineTestBase.php:252
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160

  1. LuaSandbox: TitleLibraryTests[47]: .fullUrl() 2

Failed asserting that two strings are identical.

  • Expected

+++ Actual
@@ @@
{

  • "//wiki.local/w/index.php?title=Main_Page&action=test",

+ "//wiki.local/w/index.php?title=Main_Page&action=test#Section_8",

"//wiki.local/w/index.php?title=Module:TestFramework&action=test",
"//test.wikipedia.org/wiki/Module:TestFramework?action=test",
"//wiki.local/w/index.php?title=Talk:Has/A/Subpage&action=test#frag",
"//wiki.local/w/index.php?title=Not/A/Subpage&action=test",
"//wiki.local/w/index.php?title=Module_talk:Test_Framework&action=test#_frag_frag",
"//wiki.local/w/index.php?title=Module_talk:Test_Framework&action=test#_frag_frag",

}

/srv/vagrant/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LuaEngineTestBase.php:252
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160

  1. LuaSandbox: TitleLibraryTests[48]: .fullUrl() 3

Failed asserting that two strings are identical.

  • Expected

+++ Actual
@@ @@
{

+ "http://wiki.local/wiki/Main_Page#Section_8",

"http://wiki.local/wiki/Module:TestFramework",
"http://test.wikipedia.org/wiki/Module:TestFramework",
"http://wiki.local/wiki/Talk:Has/A/Subpage#frag",
"http://wiki.local/wiki/Not/A/Subpage",
"http://wiki.local/wiki/Module_talk:Test_Framework#_frag_frag",
"http://wiki.local/wiki/Module_talk:Test_Framework#_frag_frag",

}

/srv/vagrant/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LuaEngineTestBase.php:252
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160

  1. LuaSandbox: TitleLibraryTests[50]: .canonicalUrl()

Failed asserting that two strings are identical.

  • Expected

+++ Actual
@@ @@
{

+ "http://wiki.local/wiki/Main_Page#Section_8",

"http://wiki.local/wiki/Module:TestFramework",
"http://test.wikipedia.org/wiki/Module:TestFramework",
"http://wiki.local/wiki/Talk:Has/A/Subpage#frag",
"http://wiki.local/wiki/Not/A/Subpage",
"http://wiki.local/wiki/Module_talk:Test_Framework#_frag_frag",
"http://wiki.local/wiki/Module_talk:Test_Framework#_frag_frag",

}

/srv/vagrant/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LuaEngineTestBase.php:252
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160

  1. LuaStandalone: TitleLibraryTests[46]: .fullUrl()

Failed asserting that two strings are identical.

  • Expected

+++ Actual
@@ @@
{

  • "//wiki.local/wiki/Main_Page",

+ "//wiki.local/wiki/Main_Page#Section_8",

"//wiki.local/wiki/Module:TestFramework",
"//test.wikipedia.org/wiki/Module:TestFramework",
"//wiki.local/wiki/Talk:Has/A/Subpage#frag",
"//wiki.local/wiki/Not/A/Subpage",
"//wiki.local/wiki/Module_talk:Test_Framework#_frag_frag",
"//wiki.local/wiki/Module_talk:Test_Framework#_frag_frag",

}

/srv/vagrant/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LuaEngineTestBase.php:252
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160

  1. LuaStandalone: TitleLibraryTests[47]: .fullUrl() 2

Failed asserting that two strings are identical.

  • Expected

+++ Actual
@@ @@
{

  • "//wiki.local/w/index.php?title=Main_Page&action=test",

+ "//wiki.local/w/index.php?title=Main_Page&action=test#Section_8",

"//wiki.local/w/index.php?title=Module:TestFramework&action=test",
"//test.wikipedia.org/wiki/Module:TestFramework?action=test",
"//wiki.local/w/index.php?title=Talk:Has/A/Subpage&action=test#frag",
"//wiki.local/w/index.php?title=Not/A/Subpage&action=test",
"//wiki.local/w/index.php?title=Module_talk:Test_Framework&action=test#_frag_frag",
"//wiki.local/w/index.php?title=Module_talk:Test_Framework&action=test#_frag_frag",

}

/srv/vagrant/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LuaEngineTestBase.php:252
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160

  1. LuaStandalone: TitleLibraryTests[48]: .fullUrl() 3

Failed asserting that two strings are identical.

  • Expected

+++ Actual
@@ @@
{

+ "http://wiki.local/wiki/Main_Page#Section_8",

"http://wiki.local/wiki/Module:TestFramework",
"http://test.wikipedia.org/wiki/Module:TestFramework",
"http://wiki.local/wiki/Talk:Has/A/Subpage#frag",
"http://wiki.local/wiki/Not/A/Subpage",
"http://wiki.local/wiki/Module_talk:Test_Framework#_frag_frag",
"http://wiki.local/wiki/Module_talk:Test_Framework#_frag_frag",

}

/srv/vagrant/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LuaEngineTestBase.php:252
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160

  1. LuaStandalone: TitleLibraryTests[50]: .canonicalUrl()

Failed asserting that two strings are identical.

  • Expected

+++ Actual
@@ @@
{

+ "http://wiki.local/wiki/Main_Page#Section_8",

"http://wiki.local/wiki/Module:TestFramework",
"http://test.wikipedia.org/wiki/Module:TestFramework",
"http://wiki.local/wiki/Talk:Has/A/Subpage#frag",
"http://wiki.local/wiki/Not/A/Subpage",
"http://wiki.local/wiki/Module_talk:Test_Framework#_frag_frag",
"http://wiki.local/wiki/Module_talk:Test_Framework#_frag_frag",

}

/srv/vagrant/mediawiki/extensions/Scribunto/tests/engines/LuaCommon/LuaEngineTestBase.php:252
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160


Version: unspecified
Severity: normal

Details

Reference
bz68646

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:38 AM
bzimport added a project: Notifications.
bzimport set Reference to bz68646.
bzimport added a subscriber: Unknown Object (MLST).

I'm inclined to close this as invalid. If some other extension is screwing around with the value of the main page, it's probably going to break a lot of stuff.

(In reply to Brad Jorsch from comment #1)

If some other extension is screwing
around with the value of the main page, it's probably going to break a lot
of stuff.

Do those tests assume that the main page is at [[Main Page]]?

I am moving this to the Echo extension.

In Echo tests/NotificationFormatterTest.php there is a test that ends up invoking the Linker to create full URL for Main_page and pass it a fragment.

Title::newMainPage() is really Title::newFromText('Main_Page') which is cached. Whenever the fragment is set, it stuck in the cache entry and later call to Title::newMainPage() yields a Title object which has the fragment.

The ugly workaround is to have the Echo test to reset the fragment.

Change 150191 had a related patch set uploaded by Hashar:
Clear up cached Main_page title in test

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

The patch seems to fix the interactions between Echo and Scribunto. The Jenkins test report page shows a lot of entry with 'Fixed' at https://integration.wikimedia.org/ci/job/mediawiki-core-extensions-integration/78/testReport/(root)/Scribunto_LuaTitleLibraryTests__testLua/

Change 150191 merged by jenkins-bot:
Clear up cached Main_page title in test

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

Nemo can you confirm the tests are fixed in Vagrant please?

(In reply to Antoine "hashar" Musso from comment #7)

Nemo can you confirm the tests are fixed in Vagrant please?

Yep, looks fixed. Thanks!