Commit graph

102 commits

Author SHA1 Message Date
Timo Tijhof
8d4b218ee7 build: Remove unused 'deepmerge' package
Was added for wdio-related code, but not used in the end.
The only reference to this module anywhere in Wikimedia Git is
mediawiki/extensions/CirrusSearch, which doesn't use it for
its regular or daily tests, but rather the integration test,
which already has its own copy of this module in package.json.

Change-Id: Ifdf4362077f4684a2866363e35d0aca2f89f48b5
2019-01-21 15:13:42 -08:00
Volker E
0a2ac54ba3 build: Remove 'stylelint' package as it gets pulled-in by 'stylelint-config-wikimedia'
Change-Id: I734ebf6c18a3266bec2d9c9e38e827c3ec412586
2019-01-10 13:23:33 -08:00
jenkins-bot
41a744cba7 Merge "build: Update qunitjs to 2.9.1" 2019-01-08 19:00:37 +00:00
Ed Sanders
b3e490bba6 build: Update eslint-config-wikimedia to 0.10.0
Change-Id: I2930bcabeeb7b7b2eb36063e77b26e664a691b43
2019-01-08 17:40:11 +00:00
Timo Tijhof
9cd3b52723 build: Update qunitjs to 2.9.1
Code and integrity from <https://code.jquery.com/qunit/>.
Release notes at <https://github.com/qunitjs/qunit/releases>.

Highlights for the browser version:

- [2.7.0] Reporter: Remove cost of DOM size when
  using "hidepassed=true".
- [2.7.0] Reporter: Use perf.now() for improved accurracy
  of unit test durations.
- [2.7.0] Reporter: Make debugging tests in a browser
  easier by adding timeline markers for DevTools.

Highlights for the npm package / CLI version:

- [2.9.0] CLI: Reduce dependency tree size
               from 143 packages to 9 packages.

Change-Id: I38408d90765cd18d5dd6952b8b6b30cbfa0c7ed5
2019-01-07 21:05:36 -08:00
Volker E
d939ca58a4 build: Upgrade stylelint-config-wikimedia to 0.5.0 and make pass
Change-Id: I648375927bace5fc21bd842268c645570759ce85
2018-11-28 16:30:32 -08:00
Ed Sanders
3e4e0a5774 build: Use eslint-config-wikimedia v0.9.0 and make pass
Change-Id: I7b5d228a3de4b3006751a427dec907a5bebf2f51
2018-11-23 14:20:24 +00:00
Ed Sanders
d4a2191957 build: Update eslint-config-wikimedia
Change-Id: I5a8768e1a7e3960d2c822c5f842c0ffa29e2f08b
2018-09-11 23:25:26 +01:00
James D. Forrester
a6242eff16 Bump qunit from 2.6.0 to 2.6.2
Change-Id: Id7f47eee423c2fc1289f468c6622b952814d8912
2018-09-10 13:37:48 -07:00
James D. Forrester
b0df641d31 build: Update grunt-karma from 2.0.0 to 3.0.0
Bug: T194280
Change-Id: Iba043c036c06bebd961896f390063ca9a0129eb2
2018-09-10 09:46:17 -07:00
jenkins-bot
0cbccb51b4 Merge "build: Bump most devDependencies to latest" 2018-09-07 21:54:47 +00:00
James D. Forrester
3f767b2468 build: Bump most devDependencies to latest
grunt-stylelint         0.10.0  →  0.10.1
 karma                    2.0.2  →   3.0.0
 karma-firefox-launcher   1.0.1  →   1.1.0
 karma-qunit              2.0.1  →   2.1.0
 postcss-less             1.1.5  →   2.0.0

This reduces our `npm audit` alerts down to just those from grunt-karma.

Bug: T194280
Change-Id: I7d321dd715db9d214e65ed7197e917cb7c6b14f3
2018-09-06 17:01:45 +00:00
Željko Filipin
e552e95f71 Selenium: Daily Jenkins job targeting beta cluster should run only tests that pass
Selenium tests run fine when targeting MediaWiki installation in
MediaWiki-Vagrant and in Jenkins, but fail when targeting beta cluster.
Until tests are refactored to run without failure for beta cluster, let's disable
failing tests.

Bug: T185011
Change-Id: I12da893e7d624d4ebe478bccf0706aa07c965796
2018-09-04 12:47:07 +02:00
Željko Filipin
0a56fd356d Selenium: selenium-daily NPM script
selenium-daily just calls selenium-test. It's needed for daily Jenkins job targeting
beta cluster. The script might seem redundant, but it provides flexibility. In case
a repository does not want to run all tests daily, that's easily fixed by updating
the the script.

Bug: T188742
Change-Id: Idf86f94cc31abda4bfcdc1ac4eba29206d9c91f9
2018-08-29 13:00:16 +00:00
Ed Sanders
606f2783c1 build: Update eslint-config-wikimedia to 0.7.2
Change-Id: Ibdf9cc013e1265ef461169ec2227652eaf917900
2018-08-14 19:24:51 +01:00
James D. Forrester
6450fc980b build: Upgrade eslint to 5.x
Add two exceptions for max-len and no-prototype-builtins.

Change-Id: I5d3f7a3e282a237fb5de9f0eb29b579a08c32652
2018-07-05 16:58:14 -07:00
Željko Filipin
9029425a8a Update grunt and grunt-contrib-watch to resolve vulnerabilities
`npm audit` found 27 vulnerabilities (11 low, 12 moderate, 4 high).
`npm audit fix` fixed most of them.
There are 8 vulnerabilities remaining (2 low, 6 moderate).

Bug: T194280
Change-Id: I05d80bc38d16be8249a27d94dad8e13c65139545
2018-06-15 13:46:46 +02:00
addshore
0f472c4bc1 npm selenium command, use bash
On Windows this seems to complain unless bash is specified

Change-Id: I4515c851ffea143d4c1c6d111ffdd64b62f9f304
2018-06-11 07:31:02 +00:00
Ed Sanders
5e18d925e7 build: Introduce eslint-plugin-qunit and enforce
Change-Id: Iefe06cc865c458000ca5350c2d9205f5b768bac8
2018-06-05 21:58:25 +01:00
Željko Filipin
dba1de4627 build: update to grunt-contrib-watch@1.0.1 to resolve a vulnerability
Recommended by `npm audit`.

Moves us from

21 vulnerabilities ... 12 Low | 5 Moderate | 4 High

to

20 vulnerabilities ... 11 Low | 5 Moderate | 4 High

Bug: T194280
Change-Id: I9d6d2fed4ca3d4c43d9b5085873210493081f7e0
2018-05-11 16:30:32 +02:00
Željko Filipin
5dce51470d build: Update Karma to v2.0.2
The current version has a couple of dependencies with high severity
vulnerabilities.

Bug: T194280
Change-Id: I3f9f36a6a5c2ba1716b91d14e59bc60f9e0ff513
2018-05-10 15:58:32 +00:00
jenkins-bot
45258656ab Merge "build: Update Karma's qunit from 2.5.0 to 2.6.0" 2018-05-10 14:36:33 +00:00
Timo Tijhof
3166ab5f00 build: Update Karma's qunit from 2.5.0 to 2.6.0
Follows-up 065b21b4bd which updated the copy of QUnit used
on Special:JavaScriptTest.

Change-Id: I24b17c9c266f58d48caa9c3392496c469b3ddba0
2018-05-10 14:12:17 +01:00
Željko Filipin
d888d84e60 Fix a critical NPM package vulnerability
NPM v6 audits packages during installation. This is the only critical vulnerability.

Bug: T194280
Change-Id: I5fe35067919ad67b9781701136e290eda17c3afa
2018-05-10 14:13:45 +02:00
Timo Tijhof
16a4d9da7b selenium: Initial version of wdio-mediawiki package
This is new package will be reusable by other repositories for
their browser tests, without having to reference the internal
selenium/pageobjects/ directory from MediaWiki core.

In addition to not requiring direct imports, it will also avoid
problems in the future by allowing the package to be versioned
and iterated upon without forcing an atomic global upgrade
(or broken master builds), everytime we change something.

See wdio-mediawiki/README for details.

Within MediaWiki core itself, the package is used using the
'file' specifier in its package.json, so that we always test
and develop using its working copy, which makes drafting and
testing changes easier.

Also misc changes to make wdio.conf easier to understand.

Bug: T193088
Change-Id: I547a7899e7a97693a93567dd763784e637433d55
2018-05-09 14:43:30 +00:00
Timo Tijhof
2729bf4653 selenium: Minor clean-up in preparation for packaging
This is functionally a no-op, purely refactoring (mostly style).

* Consistently require packages at the top of a file.
  (e.g. MWBot in edit.page.js).

* Remove unused .call(this) from mwbot interaction closures,
  which didn't use 'this'.

* Use Node.js regular Promise chaining with then(), instead of
  complex bluebird.coroutine generator function yields, which
  are intended to emulate async-await, but the syntax is quite
  error-prone for inexperienced developers and hard to debug.
  Once we require Node 7+ for the selenium tests, we can use
  async-await here natively, but until then, might as well use
  regular then() syntax, which we already use elsewhere in the
  tests, and is also what MWBot documentation uses.

* Also applied some minor whitespace changes for consistency
  among these files and other MediaWiki JS. E.g. no empty line
  before the first statement of a function. Add a new line between
  different methods, and between the end of a class and the
  export statement.

* Remove 'use strict' from test files. The patterns that would expose
  the bad non-strict behaviour are mostly already forbidden by ESLint,
  and the run-time optimisation to disable non-strict can't be noticed
  in tests (more useful in prod where e.g. the same process would run
  a function 1 million times). Main reason here is to keep things
  simple for new-comers and reduce boilerplate, given that these tests
  will mainly be worked on by browser-JS developers, not Node.js devs,
  and we don't currently use strict mode in our front-end code, either.

* Remove unused bluebird dependency.

Bug: T193088
Change-Id: I59f9211299e8e884c28c7733bcee3b7b28542610
2018-05-08 14:42:59 +00:00
Timo Tijhof
810afd33e0 selenium: Run wdio directly without grunt
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
2018-04-30 21:54:15 +00:00
jenkins-bot
b824f88a95 Merge "selenium: Abstract test command behind 'npm run'" 2018-04-23 16:53:11 +00:00
Timo Tijhof
83425bd0a8 build: Switch QUnit package from deprecated 'qunitjs' to 'qunit'
This should fix the deprecation warning from npm in CI logs.

Change-Id: I5d02dd8d6a86123d7935db51b8d0b5d88218869f
2018-04-23 16:32:50 +01:00
Timo Tijhof
c0600fd29c selenium: Abstract test command behind 'npm run'
This makes it possible to use in Quibble. Right now, Quibble
cannot use 'npm run selenium' yet because it sets up its own
chromedriver, which would conflict with selenium.sh.

But, in preparation for Id95f18927b5, we can at least abstract
the test command so that it can easily be changed without having
to update Quibble and without having to worry about it being the
same in all MediaWiki branches.

Bug: T179190
Change-Id: I622ec3bf36746502cae891cc6bec23982b21f876
2018-04-23 15:56:54 +01:00
Željko Filipin
d972780d8b Selenium: move logic for running tests from package.json to selenium.sh
Just running `npm run selenium` in CI does not work. If WebdriverIO fails, the
job still passes since the last command to run is  `killall chromedriver`.
Reusing the script from CI that starts and stops Chromedriver should fix the
problem.

Bug: T179190
Change-Id: If29227263d23a3e4f26e2329dfa13c49f976cf8e
2018-04-13 14:21:29 +00:00
James D. Forrester
69b1210838 build: Bump postcss-less up to 1.1.5 from 1.1.3
Problem over, we think.

Bug: T190269
Change-Id: I0a94c99fb75613b03f15954512744dec63fd779e
2018-04-04 17:43:15 -07:00
James D. Forrester
9adae152b2 build: Bump devDependencies to latest
grunt-stylelint             0.9.0  →  0.10.0
 stylelint                   8.2.0  →   9.2.0
 stylelint-config-wikimedia  0.4.2  →   0.4.3

Change-Id: I612cf96d99e2af67b3f7ef3284657f66f3e18d2e
2018-04-04 17:40:46 -07:00
Željko Filipin
c2792982c5 Selenium: install bluebird, mwbot dependency
Bluebird is implicitly installed on my machine, probably because I have a recent npm version. It needs to be explicitly installed in MediaWiki-Vagrant, probably because of an older npm version.

Bug: T190914
Change-Id: I9c704502fb5e20abf9b21d483723eb55b6fb3875
2018-03-28 13:15:57 +02:00
jenkins-bot
33fa8c095c Merge "Selenium: Replace nodemw with mwbot" 2018-03-21 15:17:06 +00:00
jenkins-bot
edf7224639 Merge "Selenium: Upgrade WebdriverIO to 4.12.0" 2018-03-21 14:37:30 +00:00
Željko Filipin
9c5fa5567b Selenium: Replace nodemw with mwbot
Bug: T181284
Change-Id: I012a5cc6a7f30a8652cbad87293eb119fa2e405f
Depends-On: Ic69be92c2b0b7a08a9b8cc417a40ebb38f249ea3
2018-03-21 13:34:37 +01:00
Željko Filipin
771c5a7814 Selenium: Upgrade WebdriverIO to 4.12.0
Bug: T180144
Change-Id: I8d34e2240fe76798c99315a54ea5bab63b2409e9
Depends-On: Ic69be92c2b0b7a08a9b8cc417a40ebb38f249ea3
2018-03-21 12:20:42 +00:00
Željko Filipin
15624aaeb9 Lock postcss-less to v1.1.3 because v 1.1.4 breaks CI
mediawiki-core-npm-node-6-docker Jenkins job is failing with
`Warning: Task "stylelint:src" failed.`

Bug: T190269
Change-Id: Ic69be92c2b0b7a08a9b8cc417a40ebb38f249ea3
2018-03-21 13:15:01 +01:00
Timo Tijhof
b043cec2d7 build: Add 'npm run qunit' command
The running of 'grunt qunit' is unconvenient due to it only working
if the user has grunt-cli installed globally, which should not be
needed because it is already installed in the local directory.

It could be worked around by instructing users to use
`./node_modules/.bin/grunt qunit`, but it would be much simpler
to instruct them to use `npm run qunit` instead.

Unlike 'composer', 'npm' does not come by default with a command
like 'composer exec' that one could pass a command directly
without needing to register it. This is fixed in more recent
versions through 'npx -c', but that's a bit too new to require
in the manual, so adding it as a run-script instead.

Change-Id: I2812b13dbed50612b1626a617ba65f92e212f01a
2017-11-22 10:48:27 -08:00
Ed Sanders
0c84c04a9b build: Upgrade grunt-stylelint
Change-Id: I4c47f1d290802705d061167fe369c130405512e0
2017-10-30 21:49:12 +00:00
James D. Forrester
67a3e5ea7f build: Bump karma devDependencies to latest
karma                   1.5.0  →   1.7.1
 karma-chrome-launcher   2.0.0  →   2.2.0
 karma-mocha-reporter    2.2.3  →   2.2.5
 nodemw                 0.10.1  →  0.11.0
 qunitjs                 2.4.0  →   2.4.1

Change-Id: I1e06189a12fbbc1d62781a4636f192c5b7078c1a
2017-10-30 21:46:42 +00:00
jenkins-bot
be2621ebe6 Merge "build: Bump eslint devDependencies to latest" 2017-10-30 21:43:51 +00:00
Ed Sanders
1064426327 build: Update stylelint
Change-Id: I5a0ccb26a54109e641fd121c6427a71e82e05c74
2017-10-27 13:31:41 +01:00
James D. Forrester
ce869f0bb4 build: Bump eslint devDependencies to latest
eslint                 3.12.2  →   4.9.0
 grunt-eslint           20.0.0  →  20.1.0

Change-Id: I7eb9964fb5d163c5bbcef850f62383cbceb59287
2017-10-26 14:16:23 -07:00
James D. Forrester
6096be63d5 Follow-up 2454f51b27: Upgrade qunit from 1.x to 2.x too
karma-qunit             1.0.0  →   1.2.1
 qunitjs                1.23.1  →   2.4.0

Bug: T170515
Change-Id: Ibc0909ed5fbde715814b0ddb1a1d1c9668d10a85
2017-10-11 16:29:02 +00:00
James D. Forrester
b96e76aeca build: Bump eslint-config-wikimedia from 0.4.0 to 0.5.0
Change-Id: I06010cd6367c1884b5536e7929d3345feba7f305
2017-08-21 17:12:17 -07:00
jenkins-bot
18bf8815c1 Merge "build: Upgrade grunt-eslint from 19.0.0 to 20.0.0" 2017-07-18 18:10:48 +00:00
Ed Sanders
2c03d167fa build: Upgrade grunt-eslint from 19.0.0 to 20.0.0
Most indent and escaping fixes.

Change-Id: I210e2fc3c0ce3148327ef81f824e1ce9f1e269b6
2017-07-18 16:57:03 +01:00
Ed Sanders
098a93b2ed build: Update grunt-stylelint
Change-Id: I05e48d3eb749d192ccd4b837e4b8dc6307d761af
2017-07-18 14:16:24 +01:00