On Mar 5, 2013, at 3:49 PM, Dan Andreescu dandreescu@wikimedia.org wrote:
From console[1]:
02:50:21 Testing
http://localhost:9412/mediawiki-core-28a705a9f648da310ff2a4fca9d013bf147f3d1...
by test.module1: expected 02:50:21 Error: expected 02:50:24 ....................................................OK 02:50:24 >> 832 assertions passed (5350ms) 02:50:24 02:50:24 Done, without errors.
This is strange. The console says there was a problem: "Exception thrown
by
test.module1: expected" and "Error: expected" But then it says everything is fine: "Done, without errors."
Ċ½eljko
[1]
https://integration.mediawiki.org/ci/job/mediawiki-core-qunit/3/console
I'm not sure how to navigate to the source that defines that test but I suspect it's just using an expected exception test: http://docs.jquery.com/QUnit/raises
No, it is neither.
Remember you're looking at the "console" log. Which, in this case is being written two from lots of sources:
* jenkins - stdout * grunt/qunit - stdout * phantomjs - console.log()
The part cited here is mostly qunit's output (the "dotted" progress line), but when calling "console.log" from within the javascript it is forwarded to the jenkins console.
A console log is harmless and no reason for alarm. If it were an actual exception, it wouldn't be tolerated.
In this case it is coming from the unit tests that asserts that mw.loader sets a module's state to "error" if it's javascript bundle throws an exception. mw.loader executes the bundle in a try/catch and logs any exceptions to the console after which it sets state=error and triggers the error callbacks.
Right now grunt/qunit forwards the phantomjs console straight to the main output. It would be prettier if it would display it in a way that more clearly says "phantomjs console". I requested this 3 months ago: https://github.com/gruntjs/grunt-contrib-qunit/pull/6
Execute the tests in your own browser and you'll see the same data in your browser's console (e.g. Chrome Dev Tools).
-- Krinkle