Page MenuHomePhabricator

Mocking abstract objects fails on HHVM
Closed, DuplicatePublic

Description

This is unacceptable on a fresh install:

1vagrant@mediawiki-vagrant:/vagrant/mediawiki/tests/phpunit$ php phpunit.php
2[Tue Apr 7 06:06:27 2015] [hphp] [21543:7f6484941bc0:0:000001] [834dc6:835050:9ca744:9caa13:9cf12a:9d070f:a6e441:856a5d:7f647c5d4ec5:909e04]
3Fatal error: Class SomeJob contains abstract method (run) and must therefore be declared abstract or implement the remaining methods in /vagrant/mediawiki/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Generator.php(301) : eval()'d code on line 1
4
5
6vagrant@mediawiki-vagrant:/vagrant/mediawiki/tests/phpunit$ php5 phpunit.php
7PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/20-xhprof.ini on line 2 in Unknown on line 0
8PHPUnit 4.6.1 by Sebastian Bergmann and contributors.
9
10Configuration read from /vagrant/mediawiki/tests/phpunit/suite.xml
11
12Deprecated configuration setting "strict" used
13
14A database query error has occurred.
15Query: SELECT user_id FROM `unittest_user` WHERE user_name = 'UTSysop' LIMIT 1
16Function: User::idForName
17Error: 1146 Table 'wiki.unittest_user' doesn't exist ()
18
19Backtrace:
20#0 /vagrant/mediawiki/includes/db/Database.php(1205): DatabaseBase->reportQueryError('Table 'wiki.uni...', 1146, 'SELECT user_id...', 'User::idForName', false)
21#1 /vagrant/mediawiki/includes/db/Database.php(1729): DatabaseBase->query('SELECT user_id...', 'User::idForName')
22#2 /vagrant/mediawiki/includes/db/Database.php(1397): DatabaseBase->select('user', 'user_id', Array, 'User::idForName', Array)
23#3 /vagrant/mediawiki/includes/User.php(3653): DatabaseBase->selectField('user', 'user_id', Array, 'User::idForName')
24#4 /vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php(486): User->idForName()
25#5 /vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php(126): MediaWikiTestCase->addCoreDBData()
26#6 /vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php(722): MediaWikiTestCase->run(Object(PHPUnit_Framework_TestResult))
27#7 /vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php(722): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
28#8 /vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php(722): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
29#9 /vagrant/mediawiki/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(406): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
30#10 /vagrant/mediawiki/vendor/phpunit/phpunit/src/TextUI/Command.php(153): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
31#11 /vagrant/mediawiki/vendor/phpunit/phpunit/src/TextUI/Command.php(105): PHPUnit_TextUI_Command->run(Array, true)
32#12 /vagrant/mediawiki/tests/phpunit/phpunit.php(239): PHPUnit_TextUI_Command::main()
33#13 {main}

Event Timeline

demon raised the priority of this task from to Unbreak Now!.
demon updated the task description. (Show Details)
demon subscribed.

Granted we have 2 bugs here, but neither should be happening and it shows that nobody's running unit tests on their local machine like they should.

Change 202440 had a related patch set uploaded (by Legoktm):
Revert "Set $wgDBservers to reveal some slag lag issues in testing"

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

Change 202440 merged by jenkins-bot:
Revert "Set $wgDBservers to reveal some slag lag issues in testing"

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

Legoktm claimed this task.
Legoktm set Security to None.

Change 202454 had a related patch set uploaded (by JanZerebecki):
Revert "Set $wgDBservers to reveal some slag lag issues in testing (attempt #2)"

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

Change 202454 merged by jenkins-bot:
Revert "Set $wgDBservers to reveal some slag lag issues in testing (attempt #2)"

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

demon lowered the priority of this task from Unbreak Now! to Medium.Apr 7 2015, 6:20 PM
demon renamed this task from Unit tests do not run on vagrant to Mocking abstract objects fails on HHVM.Apr 28 2015, 9:29 PM
demon added a project: HHVM.

Retitled since the vagrant-specific issue was fixed. This bit still needs fixing:

vagrant@mediawiki-vagrant:/vagrant/mediawiki/tests/phpunit$ php phpunit.php 
[Tue Apr  7 06:06:27 2015] [hphp] [21543:7f6484941bc0:0:000001] [834dc6:835050:9ca744:9caa13:9cf12a:9d070f:a6e441:856a5d:7f647c5d4ec5:909e04] 
Fatal error: Class SomeJob contains abstract method (run) and must therefore be declared abstract or implement the remaining methods in /vagrant/mediawiki/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Generator.php(301) : eval()'d code on line 1