Page MenuHomePhabricator

Generate JavaScript code coverage reports for extensions
Closed, DeclinedPublic

Event Timeline

@Krinkle implemented this in 0e552715e52c4e757712edb201f05ef5e5eafff9 in the examples extension. It will most likely require re-writing some code to fit in the nodejs only qunit model as well as some CI improvements so it gets displayed in a nice form on doc.wm.o.

Legoktm renamed this task from Generate JS code coverage reports for extensions to Generate JavaScript code coverage reports for extensions.Feb 7 2019, 6:16 PM
Jrbranaa raised the priority of this task from Medium to High.Feb 26 2019, 10:59 PM
Jrbranaa added a project: Code-Health.

We did it for PHPUnit tests as reflected on https://doc.wikimedia.org/cover-extensions/ .

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/examples/+/482488 has an example of generate a coverage report based on QUnit ran through NodeJS. I don't think we ever pushed for that. Instead unit tests are run from Special:JavaScriptTest using Karma, it might be possible to generate a coverage report this way, then with the Resource Loader it is unclear how it can be achieved.

This task was part of a program we had ten years ago (T100294) to enhance testing practices at the Wikimedia Foundation. It has been actives for some years and eventually we have reached a good enough state.

I am closing this one to reflect that even if good to have, it is not a priority of anyone. That can always be revisited one day.