Last modified: 2014-10-19 17:44:26 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 T71519, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 69519 - Run PhantomJS across set of Wikimedia wiki pages to ensure sane JavaScript
Run PhantomJS across set of Wikimedia wiki pages to ensure sane JavaScript
Status: NEW
Product: Wikimedia
Classification: Unclassified
Quality Assurance (Other open bugs)
wmf-deployment
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-14 02:31 UTC by MZMcBride
Modified: 2014-10-19 17:44 UTC (History)
9 users (show)

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


Attachments

Description MZMcBride 2014-08-14 02:31:43 UTC
From bug 69445 comment 13:

---
However it would be great to have automated tests running after changes in common.js and gadgets. Such general tests can at least validate no external resource is loaded, or no invalid syntax is added.
The simplest option is to run it outside MW (such as a script in labs that runs X times a day), but an extension to do it while editing would be even better...

BTW
I just runned a simple phantomjs script on all wikipedia languages to catch simple errors:

testing als
ERROR: ReferenceError: Can't find variable: ta
TRACE:
 -> https://als.wikipedia.org/w/index.php?title=MediaWiki:If-pt-login.js&action=raw&ctype=text/javascript&dontcountme=s: 9

testing kk
ERROR: TypeError: 'null' is not an object (evaluating 'document.getElementById('mw-vector-current-variant').innerHTML=wgULS("Кирил","Latın","توتە")')
TRACE:
 -> https://bits.wikimedia.org/kk.wikipedia.org/load.php?debug=false&lang=kk&modules=site&only=scripts&skin=vector&*: 9


anyone wants to fix them? :)
---



From bug 69445 comment 14:

---
Created attachment 16185 [details]
Example for errors across wikis

Maybe it is a bit off-topic but here are some cases of errors across wikis in simple read/edit transaction using phantomJS
---
Comment 1 MZMcBride 2014-08-14 02:35:29 UTC
The idea here is to use a tool such as PhantomJS (a headless WebKit browser) to hit a bunch of pre-defined URLs and report JavaScript errors.

In addition to strictly checking errors, checking fetches of content on domains outside of Wikimedia's control (e.g., Google Analytics) would also be nice.
Comment 2 Kunal Mehta (Legoktm) 2014-08-14 02:37:33 UTC
<http://tools.wmflabs.org/legobot/wmf_js_scanner.js> checks for any JS errors being thrown on the main page (as an anonymous user) as well as the inclusion of any external resources.

Ideally such a tool would be able to login, visit a few pages (including ?action=edit), enable and disable individual gadgets and change skins.
Comment 3 Helder 2014-08-14 02:43:19 UTC
(In reply to MZMcBride from comment #0)
> ...
> testing als
> ERROR: ReferenceError: Can't find variable: ta
> TRACE:
>  ->
> https://als.wikipedia.org/w/index.php?title=MediaWiki:If-pt-login.
> js&action=raw&ctype=text/javascript&dontcountme=s: 9
> ...
FIXED:
https://als.wikipedia.org/wiki/MediaWiki:If-pt-login.js?diff=584752
Comment 4 Eran Roz 2014-08-14 03:58:04 UTC
here is my version used for error checking:
https://github.com/eranroz/wiki-js-error-log/blob/master/testwiki.js
Comment 5 Antoine "hashar" Musso (WMF) 2014-08-14 12:17:20 UTC
Seems we have two versions :-]  If you guys could unify the effort and have the resulting code hosted in Gerrit, I would be more than happy to write a Jenkins job that runs the script  once per hour and spam some place (mail/IRC...).
Comment 6 James Forrester 2014-08-15 09:53:29 UTC
There's also the VE production browser test that ensures that all wikis with VisualEditor installed actually let you get to VE successfully:

https://integration.wikimedia.org/ci/view/BrowserTests/job/browsertests-VisualEditor-production-linux-firefox-sauce/

(The fy.wikipedia.org one is just a regular test suite failure; the kk.wikipedia.org one looks like a local sysop has broken JS there.)

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


Navigation
Links