Page MenuHomePhabricator

I get error message "No MWMultiVersion instance initialized!" when run phpunit tests
Closed, ResolvedPublic

Description

When I run command:

vagrant run-tests

I get error message:
No MWMultiVersion instance initialized! MWScript.php wrapper not used?

I tried to run phpunit test inside vagrant:

vagrant ssh

$ cd /vagrant/mediawiki
$ php tests/phpunit/phpunit.php
No MWMultiVersion instance initialized! MWScript.php wrapper not used?

How can I run the phpunit tests?


Version: unspecified
Severity: normal

Details

Reference
bz69520

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:28 AM
bzimport set Reference to bz69520.

I broke this with the changes I introduced in I26b3705 ("Rethink multiwiki support"). Using mwscript tests/phpunit/phpunit.php will initialize MWMultiVersion correctly, but this leads to another error:

Class 'tests/phpunit/phpunit' could not be found in '/vagrant/mediawiki/tests/phpunit/phpunit.php'.

This seems to be an issue with the way that mwscript interacts with the tests/phpunit/phpunit.php script.

The more I look at this the more I think that the LocalSettings.php bootstrapping system should default to configuring for the default wiki in the event that mwscript or a similar mechanism hasn't been used to change the wiki.

gerritadmin wrote:

Change 154472 had a related patch set uploaded by BryanDavis:
Bootstrap MWMultiVersion for default wiki if unset

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

gerritadmin wrote:

Change 154472 merged by jenkins-bot:
Bootstrap MWMultiVersion for default wiki if unset

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

Both vagrant run-tests and direct use of php tests/phpunit/phpunit.php work for me now with the latest version of MediaWiki-Vagrant checked out and vagrant provision run to update the state of the virtual machine.