Last modified: 2014-02-07 13:23:28 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44529, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42529 - PHPUnit tests fail on clean cli install with SQLite
PHPUnit tests fail on clean cli install with SQLite
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
1.21.x
All All
: Normal major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-29 07:20 UTC by Niklas Laxström
Modified: 2014-02-07 13:23 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Niklas Laxström 2012-11-29 07:20:45 UTC
php phpunit.php --configuration /resources/nike/translatewiki/melange/mediawiki/tests/phpunit/suite.xml  --exclude-group Broken,ParserFuzz,Destructive,Stub
PHPUnit 3.7.8 by Sebastian Bergmann.

Configuration read from /resources/nike/translatewiki/melange/mediawiki/tests/phpunit/suite.xml

A database error has occurred.  Did you forget to run maintenance/update.php after upgrading?  See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: SELECT  user_id  FROM unittest_user  WHERE user_name = 'UTSysop'  LIMIT 1  
Function: User::idForName
Error: 1 no such table: unittest_user

make: *** [safe] Error 1
twn:/resources/nike/translatewiki/melange/mediawiki/tests/phpunit (master)$ make safe
php phpunit.php --configuration /resources/nike/translatewiki/melange/mediawiki/tests/phpunit/suite.xml  --exclude-group Broken,ParserFuzz,Destructive,Stub
PHPUnit 3.7.8 by Sebastian Bergmann.

Configuration read from /resources/nike/translatewiki/melange/mediawiki/tests/phpunit/suite.xml

A database error has occurred.  Did you forget to run maintenance/update.php after upgrading?  See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: CREATE VIRTUAL TABLE "unittest_melange_searchindex" USING FTS3(
 si_title,
 si_text
 )
Function: DatabaseSqlite::duplicateTableStructure
Error: 1 table "unittest_melange_searchindex" already exists

make: *** [safe] Error 1
Comment 1 Siebrand Mazeland 2013-04-03 23:35:34 UTC
Brian just reported on IRC: Tests: 5307, Assertions: 497129, Failures: 11, Errors: 332, Incomplete: 3, Skipped: 17. I had to edit files just to make them not give a php fatal error.

I suggested: Maybe you, Niklas and Antoine should discuss this and devise a plan? I do know that Niklas keeps being annoyed about the tests not running reliably and/or consistently in his development environment, and we can really address this issue, I think.
Comment 2 Bawolff (Brian Wolff) 2013-04-03 23:37:45 UTC
by changing the user to www-data instead of my normal user, I got the errors down to about 282.

The original issue was:

Fatal error: Cannot redeclare class ParserTests in /var/www/w/git/tests/phpunit/includes/parser/MediaWikiParserTest.php(27) : eval()'d code on line 3

Which prevents unit tests from running. I'm running PHP 5.3.3-7 
----

After getting it working by renaming MediaWikiParserTest.php to something without a php extension, I get _a lot_ of errors:

FAILURES!
Tests: 5307, Assertions: 446595, Failures: 18, Errors: 282, Incomplete: 3, Skipped: 17.

282 errors seems absurdly high...
Comment 3 Antoine "hashar" Musso (WMF) 2013-04-05 13:36:35 UTC
And the errors are? Please attach a full log of your PHPUnit output :-]

Also consider running the unit test with a default LocalSettings.php as created with the installer.
Comment 4 Bawolff (Brian Wolff) 2013-04-05 17:14:38 UTC
(In reply to comment #3)
> 
> Also consider running the unit test with a default LocalSettings.php as
> created
> with the installer.

Doesn't that defeat the point of tests - if they suddenly stop working due to configuration?
Comment 5 Antoine "hashar" Musso (WMF) 2013-04-05 20:37:07 UTC
Then that means the tests need to be improved :-]  They should at least work with the default settings.
Comment 6 Bawolff (Brian Wolff) 2013-06-05 16:19:42 UTC
(In reply to comment #2)
> by changing the user to www-data instead of my normal user, I got the errors
> down to about 282.
> 
> The original issue was:
> 
> Fatal error: Cannot redeclare class ParserTests in
> /var/www/w/git/tests/phpunit/includes/parser/MediaWikiParserTest.php(27) :
> eval()'d code on line 3
> 
> Which prevents unit tests from running. I'm running PHP 5.3.3-7 

This was due to bug 42174. I've submitted Gerrit change #67098
Comment 7 Tim Landscheidt 2014-02-03 07:13:50 UTC
Does this still happen with the current release/HEAD?
Comment 8 Antoine "hashar" Musso (WMF) 2014-02-07 13:23:28 UTC
Assuming it got fixed somehow.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links