Last modified: 2014-11-18 18:07:30 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 T50365, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48365 - Jenkins: Set up JavaScript code coverage analysis
Jenkins: Set up JavaScript code coverage analysis
Status: RESOLVED WORKSFORME
Product: Wikimedia
Classification: Unclassified
Continuous integration (Other open bugs)
wmf-deployment
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Krinkle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-11 22:19 UTC by MWJames
Modified: 2014-11-18 18:07 UTC (History)
6 users (show)

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


Attachments

Description MWJames 2013-05-11 22:19:43 UTC
Any plans of having JSCover (JavaScript code coverage analysis) being integrated and run by Jenkins (in away that is usable for core and extensions as well)?

[1] http://tntim96.github.io/JSCover/

[2] http://tntim96.github.io/JSCover/example-qunit/out/jscoverage.html?test/index.html

[3] http://tntim96.github.io/JSCover/manual/manual.xml#automatingPhantomJS

[4] http://tntim96.github.io/JSCover/manual/manual.xml#automatingAnt
Comment 1 Antoine "hashar" Musso (WMF) 2013-06-20 19:47:52 UTC
I think we want QUnit tests on a few more extensions before adding code coverage. Thus lowering priority.
Comment 2 Krinkle 2013-07-16 19:11:17 UTC
Both jscoverage and the new fork JSCover seem to have quite a nasty (though from a quick look, hard to avoid) implementation that involves instrumenting files. 

Though that in and of itself isn't a problem, it does this by running a static file server and proxying javascript files through its instrumentor and using some kind of HTML parser (another Java class dependency) to catch inline scripts even (not sure).

This isn't going to work straight up with MediaWiki since we generate HTML dynamically (e.g mediawiki-core/index.php) and load things through ResourceLoader.
Comment 3 tntim96 2013-09-03 03:47:00 UTC
The JSCover JAR (JSCover-all.jar) is all custom code and only includes the Rhino library (i.e. no Jetty, Log4J, Apache-commons or other library dependencies).

Also, there is no HTML parser. When a JavaScript file is requested via JSCover's web or proxy server, JSCover instruments the specified JavaScript only. 

Whether the HTML is generated dynamically or not doesn't affect JSCover in proxy-mode. 

For proxy documentation, take a look at:
http://tntim96.github.io/JSCover/manual/manual.xml#gettingStartedProxy

...and a working proxy example at:
https://github.com/tntim96/JSCover-samples/blob/master/src/test/java/jscover/webdriver/jasmine/WebDriverUnderscoreProxyTest.java

Let me know if there are any changes required to JSCover that would assist you.
Comment 4 MWJames 2013-11-02 03:38:59 UTC
I'm not sure this will get any attention in a foreseeable future therefore closing this one.
Comment 5 Antoine "hashar" Musso (WMF) 2013-11-04 16:57:53 UTC
Javascript coverage is still something we need. Nobody looked at integrating it in Jenkins yet though.
Comment 6 Krinkle 2014-09-26 20:06:35 UTC
JSCover didn't work out very well.

I've standardised on istanbul[1] for the moment. There are qunit[2] and karma[3] integrations. Both of which we've been using for OOjs and VisualEditor these past few months.

They have command-line and HTML reporters.

[1]
http://gotwarlost.github.io/istanbul/
https://github.com/gotwarlost/istanbul

[2]
https://github.com/asciidisco/grunt-qunit-istanbul

[3]
https://github.com/karma-runner/karma-qunit
https://github.com/karma-runner/karma-coverage

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


Navigation
Links