Special:JavaScriptTest loads qunitjs from /resources/lib/qunitjs
which was upgraded in 99aad9397e to 1.23.1.
However, when running QUnit tests from the command-line, QUnit is
loaded by karma-qunit using the npm qunitjs dependency, which was
still at v1.22.0.
Change-Id: Ie24b2b061735fa03a8ed1527d09f65c103506c67
The progress reporter is quite nice to avoid spammy output to the
terminal, but it is not very human friendly when trying to find out what
is breaking.
Mocha has a very nice reporting organized as modules and list items for
each of the tests:
ext.cx.tools.template
✖ Equivalent template exists
✔ Adapting a template not existing in target language
✖ Adapting template having invalid title
✖ Template name and params adaptation using templatedata
✖ Template params adaptation using templateData - English to French
✖ Template params adaptation using templateData - English to Spanish
Add karma-mocha-reporter node module and make it the reporter.
Change-Id: Ic7d848b45e8e5ad3839d8a2bd822b63838319ad7
Introduce the WebdriverIO browser testing framework driven by Node.js.
The overall intents are:
* have MediaWiki core to provide a platform to run tests that is shared
between core and the extensions.
* phase out ruby driven browser tests eventually.
Code is namespaced in sub directory /tests/selenium
The 'pages' sub directory provides helper representing a MediaWiki page
such as Special:Login and human friendly helpers to interact with the
elements.
Add Grunt task webdriver:test.
Provide a npm script to easily spawn/dispose chromedriver and run above
grunt task.
wdio.conf.js provides all the configuration. It defaults to point to a
MediaWiki-Vagrant installation on http://127.0.0.1:8080. Can be
overriden with environment settings as needed.
glob patterns (specs) are made absolute paths from MediaWiki root path
that let us run the tests either from the root path (eg the npm
wrapper or from the tests/selenium directory when invoking wdio
directly. wdio assumes they are relative to the current working
directory, hence the normalization.
wdio.conf.jenkins.js extends the configuration and is used solely for
Jenkins. The switch is done from the Gruntfile.js whenever JENKINS_HOME
is set. Specially we want junit reports to be generated.
Provide a more specific eslint configuration.
References:
* MALU https://phabricator.wikimedia.org/source/malu/
* T151442 Research WebdriverIO
* T151443 Research Nightwatch.js
Bug: T139740
Signed-off-by: Antoine Musso <hashar@free.fr>
Change-Id: Ibe7a004a120e82af637ab3e31b725de743134c99
Before karma-chrome-launcher 2.0.0, Chromium was only detected on Linux
and as part of the "Chrome" setting. "Chromium" is now recognised as a
separate browser and is detected on Mac and Windows as well.
https://github.com/karma-runner/karma-chrome-launcher/issues/45
Add a grunt target for Chromium so users may run the following to use
Chromium instead of Chrome:
grunt karma:chromium
Since we keep the default of "Chrome", we'll need an override for CI
since we install Chromium there instead of Chrome.
Depends on Ie9f906f8 being merged and Nodepool images updated.
Bug: T153756
Change-Id: I6ba0d971e7e8c3022d2ab6268ae637688189d768
We don't want tests failing every time upstream publishing a new
version.
Instead we should bump this manually everytime they update to make sure
no failures happen.
Bug: T118941
Change-Id: I1c76dacd0950100825b85a3791f74c1f6d5477d9
Karma is suspected to have an issue disconnecting Chromium.
That causes the qunit job to idle even after all tests have
been completed.
This reverts commit 72b0d9da08.
Bug: T136188
Change-Id: Id818f5a0d1983d0bffa545f7731a780bf2b9bf25
Initially, with just a single rule to make this a smaller change that we can
incrementally extend up to the full Wikimedia coding conventions preset; namely,
forcing hex references to colours to be in lower-case.
Note the odd src definition to avoid referring to mediawiki.less the directory in
the glob.
Change-Id: I34f0c8e3c8280e3fce0aa22d7537100b850cbb8d
Reason because this update will include a fix for incompatibility with
grunt 1.0.0 when it is released.
Change-Id: I39f01e3a68b764a4638c3465a1d116aefd517ef5
Taking the opportunity to modernise our .jshintrc file, I have made the
following changes there and adjusted the repo to pass:
* Replaced the deprecated `"es3": true` with `"esversion": 3`; nil change.
* Adjusted `"latedef": true` to `"latedef": "nofunc"`, a new setting for this
option that lets us retain previous behaviour. One call needed to be adjusted
for the update with this change; without it, several dozen were needed.
* Added `"futurehostile": true`, to make bumping `esversion` easier in future.
I have reviewed the rest of the options and chosen not to apply them:
* No need to over-ride the runtime option `maxerr`.
* No need to add the additional 'enforcing' options: `forin`, `nocomma`,
`nonbsp`, `notypeof`, `predef`, `shadow`, `singleGroups`, `varstmt`.
* No need to add the additional 'relaxing' options, as ideally we should use
none: `asi`, `boss`, `debug`, `elision`, `eqnull`, `evil`, `expr`,
`lastsemic`, `loopfunc`, `moz`, `noyield`, `plusplus`, `proto`, `scripturl`,
`supernew`, `validthis`, `withstmt`
* Definitely no need to add any of the deprecated coding style-related items:
`camelcase`, `curly`, `immed`, `indent`, `laxcomma`, `maxlen`,
`maxcomplexity`, `maxdepth`, `maxparams`, `maxstatements`, `newcap`,
`noempty`, `quotmark`, `sub`
Note that we retain two deprecated options, `laxbreak` and `multistr` which are
set to be removed in the next major version of jshint but are as-yet required
for the repo so that it passes.
Change-Id: I2a780f655010f2231ab2ab93c40b34943828b4df
This update now tells you on which line in which file the error happends.
Changelog is
1.0.7 Include file name and JSON source line number in error messages
1.0.6 CJSON support thanks to @fredghosn, unit tests
Change-Id: I38dc4a51416cfde0bb0434921d15f1c119abc01b
2.5.0
Bump JSCS version to 2.7.0
2.4.0
Bump JSCS version to 2.6.0
2.3.0
Bump JSCS version to 2.5.0
2.2.0
* Update jscs dependency to 2.4.0
* Use new Checker#execute method, which allows to respect maxErrors
* option when fix option is enabled
* fix option is now directly passed to Checker class of jscs
* Use new "idiomatic" preset instead of "jquery"
* Test in latest version of node in travis CI
* Update dev dependencies
https://github.com/jscs-dev/grunt-jscs/releases
Change-Id: I472a3c63fff814357799a3889b09bbb6a977474b
This fixes the warning about missing package description and license.
This matches what we do elsewhere for dev-only npm pipelines.
Change-Id: I29ee43482b90ea8875a5376409d656648e3c4b27
Disable disallowBlankTranslations, disallowDuplicateTranslations and
disallowUnusedTranslations for now as they fail so much.
Change-Id: I52e1555335a6e64b1e9db541ba726cf6ce8c7dd0
A long time ago, npm did not support using command line programs
within 'npm test' (not unless harcoding a path to node_modules/bin/...
within packages.json/scripts/test). But this has been long supported.
Declaring a (dev)dependency will provide its binaries to the
PATH used by the subshell 'npm test' creates internally.
Add grunt-cli so that developers don't have to manually install it.
Change-Id: I6a7fafa3c6e40d2407f07c514167ab9fc7661685
* Move configuration to /jsduck.json per standard. This way
it can be run as plain '$ jsduck' without needing a maintenance
script or custom Jenkins job. Similar to JSHint, JSCS, Grunt,
and Gem etc.
* Move --processes=0 from maintenace script into config file.
This should've been in the config file all along and serves as
workaround for https://github.com/senchalabs/jsduck/issues/525.
* Use grunt-contrib-copy instead of a symlink for resources.
For local development a symlink works fine, but for publishing
from Jenkins to doc.wikimedia.org the /docs/js/ directory needs
to be standalone. This was previously done with a manual post-build
step that added an additional rsync, but this logic should be
in the repository so that the doc entry point can be simplified
and standardised to 'npm run-script doc' for all projects.
Change-Id: Iaaaac50ee78dd9ff8f24f1ef3a3685ad51cf33b2