aboutsummaryrefslogtreecommitdiffstats
path: root/Gruntfile.js
Commit message (Collapse)AuthorAgeFilesLines
...
* selenium: Run wdio directly without gruntTimo Tijhof2018-04-301-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doesn't seem to add anything, except complexity. This has the benefit of matching more closely the way the README recommends running individual tests. Also add a check for 'chromedriver' before running it. Normally the -e and pipefail would suffice, but because it runs in the background, the error can be buried, hard to find, or even not cause exit code to be set properly. Thus, do a simple 'hash' check that will print a useful command and exit cleanly. Before: > $ something & > [1] 57922 > -bash: something: command not found > [1]+ Exit 127 something > $ echo $? > 0 After: > $ hash something > -bash: hash: something: not found > (exit: 1) $ echo $? > 1 Change-Id: Id95f18927b5443defe679a77a82c5cbdd127c716
* selenium: Remove Jenkins configuration fileŽeljko Filipin2018-04-131-8/+1
| | | | | | | | | | | Both Mocha and Cucumber tests should run. Since WebdriverIO supports only running one test framework, the only way to do it is to have a generic configuration file and two framework-specific files (Mocha, Cucumber). Having Jenkins configuration file complicates things, and there is no need for it. Bug: T179190 Change-Id: I710066f7b5479dcad27aa57cd61007c1c2d88931
* build: Add grunt target for 'karma:firefox'Timo Tijhof2018-02-121-2/+2
| | | | | | | | The 'karma:more' doesn't seem particularly useful, but the ability to run Firefox from a preset seems more useful. Especially from CI in Travis where one might want to use only one or the other. Change-Id: I522295298888e8566781d81fa14dd08368bf0ce4
* build: Update stylelintEd Sanders2017-10-271-3/+0
| | | | Change-Id: I5a0ccb26a54109e641fd121c6427a71e82e05c74
* Gruntfile.js: Remove obsolete eslint omissionsArlo Breault2017-08-031-2/+0
| | | | | | | | * Should have been part of, I4488402686c8b9fefa0af5fed3c9a4b83cbff798 I95400637d1b85d2c607cd91bcb39ce21733295c8 Change-Id: I0546ba007d0a328504e359ade6a1e660387a0645
* build: Update karma to 1.5.0, karma-firefox-launcher to 1.0.1Paladox2017-04-151-1/+4
| | | | | | | | | | | | | | | | | | | | karma: Changelog at https://github.com/karma-runner/karma/releases https://github.com/karma-runner/karma/compare/v1.1.0...v1.5.0 karma-firefox-launcher: Changelog at https://github.com/karma-runner/karma-firefox-launcher/blob/master/CHANGELOG.md#101-2017-03-04 https://github.com/karma-runner/karma-firefox-launcher/compare/v1.0.0...v1.0.1 Karma v1.1.1 added use of `<script crossorigin="anonymous">` for the urls it initially loads. While most requests will be done by MW itself directly (and served locally via the proxy at /w/) the initial request cannot come from the proxy and is loaded from wgServer directly. Therefore we need to set crossOriginAttribute=false to override the new default that v1.1.1 introduced. Change-Id: I9f5067b949c0a77e46f47c2a110a7b5df5953fda
* build: karma now reports with mocha formatterAntoine Musso2017-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | 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
* Selenium tests in Node.js using WebdriverIOŽeljko Filipin2017-03-141-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* qunit: Make eslint config pass on qunit test filesTimo Tijhof2017-02-221-1/+2
| | | | | | | | | | | | Follows-up c0fb8a8836, I890e6e49b. * Disable 'qunit' env in general source code. And re-declare locally in the few src files that use it properly. * Create separate eslint config for tests/qunit with various rules disabled (e.g. valid-jsdoc and es3-keywords). Change-Id: I37ccec2019de55edfee92697eb80478df7cb6220
* build: Enable use of stylelint-config-wikimedia and make passVolker E2017-02-201-1/+1
| | | | | | | | | | Enabling stylelint-config-wikimedia for Grunt stylelint, which was already introduced in 3bf6f429295e, but has not yet been actively used to enforce Wikimedia CSS Coding Standards. For this first patch nullifying several options, which will be enabled in follow-up patches in order to be easier reviewable. Change-Id: I3859e04797203a64d82206a379dbb320e5e113d5
* build: Fix stylelint glob patternEd Sanders2017-02-201-1/+1
| | | | Change-Id: I2f37668d32d70d72ed493e81af6b521a3bfaedba
* build: Upgrade karma-chrome-launcher to support Chromium on Mac/WindowsAntoine Musso2017-01-121-0/+3
| | | | | | | | | | | | | | | | | | | | | 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
* build: Karma proxy should convert Host headerAntoine Musso2016-12-231-1/+4
| | | | | | | | | | | | | | | | | | | By default the Karma proxy does requests against 'localhost', however if the target wiki server has strict host validation (e.g. multiple virtual hosts or otherwise strictly verified) then requests may fail since load.php is not found. An example is with MW_SERVER=devwiki.local. MediaWiki-Vagrant and Wikimedia CI are not affected since they use 'localhost' as the virtual host. Set Karma proxy to change the hostname accordingly. Reference: https://github.com/karma-runner/karma/issues/1729 https://github.com/karma-runner/karma/commit/ae05ea4 Bug: T153757 Change-Id: I317d5686aecd1fb6cf6921cdca77670cded85607
* Merge "Remove JSON polyfill, deprecate 'json' module"jenkins-bot2016-11-231-1/+0
|\
| * Remove JSON polyfill, deprecate 'json' modulePeter Hedenskog2016-11-221-1/+0
| | | | | | | | | | | | | | | | | | | | All A-graded browsers now supports JSON so skip the JSON polyfill. Krinkle investigated the current status for 3 months on Wikimedia traffic (T141344#2784065) with support being nearly 100%. Bug: T141344 Change-Id: I8280faf1cbcd876ead2dafae4347b7d46e3e2acb
* | Fix globbing for eslintBrad Jorsch2016-11-221-2/+3
|/ | | | | | | | Grunt's `**` matches symlinks but doesn't follow them, so `**/*.js` matches files that `!extensions/**` doesn't see to exclude. Bug: T151381 Change-Id: I5d8ae6e24f2fa09efc97db871b0c08d4fbc68efd
* build: Replace jscs+jshint with eslintEd Sanders2016-11-151-20/+31
| | | | Change-Id: Id0a23c03aabadfaf2ec705528ae4b3bd0908fa3e
* build: Enforce the rest of the colour-related stylelintsJames D. Forrester2016-05-191-1/+1
| | | | | | | | * Hex colours must be in short form where possible ('fff' not 'ffffff') * Hex colours must be used over named colours ('fff' not 'white') * Hex colours must be valid ('fff' not 'ffq') Change-Id: I2ba04cc3ad9898c17fee3c65bb3bead834c3a1fd
* build: Introduce stylelintJames D. Forrester2016-05-191-2/+9
| | | | | | | | | | | 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
* build: Enable karma debug log and use progress reporterAntoine Musso2016-01-151-1/+2
| | | | | | | | Should help diagnostic of QUnit failures such as: Error: Pending AJAX requests: 0 (active: 1) Change-Id: I0ed1c8f0c26d49fa13dab2d9de20181d48ee2932
* build: Upgrade grunt-banana-checker from v0.3.0 to v0.4.0James D. Forrester2015-10-121-3/+1
| | | | | | Take opportunity to drop no-longer-needed options. Change-Id: I11250c12d2123d4729e12cd0dce07b24fc5008e5
* build: Upgrade grunt-banana-checker to v0.3.0James D. Forrester2015-09-071-0/+5
| | | | | | | Disable disallowBlankTranslations, disallowDuplicateTranslations and disallowUnusedTranslations for now as they fail so much. Change-Id: I52e1555335a6e64b1e9db541ba726cf6ce8c7dd0
* build: Enable jscs rules 'requireSpacesInside*Brackets' and make passJames D. Forrester2015-09-051-3/+3
| | | | Change-Id: I1cd5b9b92b6e9419d99d9a15ad88a996253ca4cf
* build: Enable jscs rule 'requireSpacesInsideParentheses' and make passJames D. Forrester2015-09-031-1/+1
| | | | Change-Id: Ie88c89344e54657f007e5101472e667be5408319
* build: Use blacklist instead of whitelist for jshint/jscs/jsonlintKunal Mehta2015-07-231-26/+7
| | | | | | | | | | | | | | | | | | | | * jsonlint now includes docs/, includes/ (api and installer i18n), maintenance/, and tests/. 539 files -> 864 files. - Continue to exclude JSDuck artefacts in docs/js/. - Continue to exclude vendor/. * jshint now includes mw-config/ and maintenance/. 177 files -> 179 files. * jscs now includes everything jshint includes. 172 files -> 179 files. - The -skip.js files no longer need excluding. Use the native exclude syntax for jshint and jscs so that other software and services with JSHint support use these as well. Change-Id: Idebf30275f9c93483069367f923ed290c38e0b26
* Gruntfile.js: Remove unused 'pkg'Kunal Mehta2015-07-101-1/+0
| | | | | | It's unused and ends up being copied into a bunch of repositories that also don't need it. Change-Id: Icf81b3ae13e510670bde38c1c8d7ef42917b7c2a
* build: Increase qunit browserNoActivityTimeout from 10s to 60sTimo Tijhof2015-03-201-1/+3
| | | | | Bug: T89075 Change-Id: I3ef601a38052e38247cebfb19475a31ac2448eac
* build: Add assert-mw-env task when running grunt-qunitTimo Tijhof2015-03-201-1/+14
| | | | | | | | | Previously it gave cryptic error messages like: > Running "karma" task > > Warning: Parameter 'url' must be a string, not number Change-Id: I0adb0f2f501dd5db2d6738a40efbce349f0175d2
* Rename JSDuck config to standard 'jsduck'Timo Tijhof2015-03-091-0/+11
| | | | | | | | | | | | | | | | | | | | * 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
* test: Don't run the npm pipeline for the now-empty skins directoryJames D. Forrester2015-02-141-1/+1
| | | | Change-Id: I426835c83c0dd73fa7247ed2ec299cdec1e43fcb
* Gruntfile: Clean up Karma configTimo Tijhof2015-01-311-22/+5
| | | | Change-Id: I8197c2b0169983c32a44397faec95ad7eb47ab86
* tests: Move npm-test to repo rootTimo Tijhof2015-01-141-0/+111
This is way overdue as it isn't experimental anymore. Keeping it in a non-standard subdirectory makes it harder to discover for people. And makes it harder to run from Jenkins since this is already being ran on every commit. Related to 70f3919. Change-Id: Iaf5cf65616f82640145fbb6395c36129428602ca