Hi,
Did anybody succeed at running the MediaWiki PHPUnit Unit tests from Eclipse (with PDT)?
I have succeded in running them from the commandline, but in order to get quicker (and automatic) response on errors, I wanted to have the test run automatically on every file save.
For Eclipse (with PHP development tools) there is the MakeGood Eclipse plugin [1], which does this, but since the MediaWiki tests have to be run from the phpunit.php file shipped with MediaWiki, I haven't yet figured out a way to make MakeGood run them that way. Didn't even find anything about this by googling.
Anybody using Eclipse, and got this working?
Best Regards // Samuel
[1] http://marketplace.eclipse.org/content/makegood-1#.Ulb1Md9s8UQ
Hey,
I don't know about doing this with the MediaWiki tests, though I'm doing something very similar for the code I work on. All my repos have a phpunit.xml file in their root, so you can just run "phpunit" in there and have all the tests run. Which is the standard way of doing things, and recognized by lots of IDEs and plugins.
I'm currently using this handly little Node script to run my tests on file change: https://npmjs.org/package/phpunit-testrunner
Or "grunt watch" in the repos where I'm using the Grunt task runner. When running Linux you can write a 3 line bash script that already gets you most of the value. As long as there is a sane test runner that is...
What tests do you want to run anyway? Not all MW tests I imagine, as they take many minutes to run, which clearly is to long when you run this on every file change.
Cheers
-- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. ~=[,,_,,]:3 --
On 2013-10-10 21:18, Jeroen De Dauw wrote:
I don't know about doing this with the MediaWiki tests, though I'm doing something very similar for the code I work on. All my repos have a phpunit.xml file in their root, so you can just run "phpunit" in there and have all the tests run. Which is the standard way of doing things, and recognized by lots of IDEs and plugins.
Right, yea, I actually tried quite the similar thing, by copying the suite.xml file in <wikipath>/tests/phpunit into my RDFIO tests folder, and modified the paths to include the RDFIO tests only.
The problem remeined still though, that in order to subclass the MediaWikiTestCase in my tests (to get its functionality for accessing the database etc), I still had to run the tests through MediaWiki's phpunit.php file, otherwise it would not find all the required classes and stuff it uses.
I'm currently using this handly little Node script to run my tests on file change: https://npmjs.org/package/phpunit-testrunner
Or "grunt watch" in the repos where I'm using the Grunt task runner. When running Linux you can write a 3 line bash script that already gets you most of the value. As long as there is a sane test runner that is...
What tests do you want to run anyway? Not all MW tests I imagine, as they take many minutes to run,
Exactly ... only the RDFIO tests. But still would like to be happy to subclass the MediaWikiTestCase.
Also, indeed, I can (and have) set up a little bash script that runs the tests with "watch" every 5 seconds or so, and greps for the string "FAILURES" in the output. If I set this in a little tiny terminal window that is always on top on the desktop, it almost works OK ...
... it's just that it is always nicer to have everything integrated in the IDE :)
Anyway, many thanks for the pointers!
Cheers // Samuel
-- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. ~=[,,_,,]:3 -- _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org