Commit graph

5 commits

Author SHA1 Message Date
Reedy
5a324df8ae Stop supporting composer 1.x
Bug: T316558
Change-Id: Ie512b43a601502deb50de24e1f3efc45b0223ced
2024-01-24 22:19:38 +00:00
Reedy
6000befd1e composer: Namespace Composer classes
Change-Id: I0ae0041ff4929b6791e03cfb8c73f422076125c6
2024-01-13 19:15:16 +00:00
Moritz Schubotz (physikerwelt)
d7e38df11d
Make phpunit:coverage-edit script independent of phpunit
Remove unnecessary dependency to phpunits internal XML loader class

Bug: T320452
Change-Id: Id8bd5fd57663419749c2e8a90c146e05296fd175
2023-01-04 19:29:34 +01:00
Moritz Schubotz (physikerwelt)
3c5ad87808 Fix phpunit:coverage-edit script
* Xml::loadFile was moved to a new class in PHPUnit 9.5, cf.,
  c331d28ac3

* PHPUnit XML coverage element were renamed in
  7a494d1fa4

Bug: T320452
Change-Id: Iea9783005522f2851e86a4b56aa0771ed31442bb
2023-01-04 10:15:44 +00:00
Kosta Harlan
fd72f6c48e Provide command to adjust phpunit.xml for code coverage
Our current recommendation for adjusting PHPUnit configuration for
extension code coverage reports is to manually modify
tests/phpunit/suite.xml. This is cumbersome and annoying, since
suite.xml is version controlled.

This patch proposes a composer script to simplify editing
the (non-version controlled) phpunit.xml config in the root of the
MediaWiki repo. It is useful if you are interested in generating
code coverage reports based on unit tests only, not integration tests.

Usage: composer phpunit:coverage-edit -- extensions/GrowthExperiments

When you're done, you can run `rm phpunit.xml` to switch back to the
default phpunit.xml.dist.

The script will use the default includes/src/maintenance directories,
but a future improvement would be to identify the relevant directories
via the AutoloadClasses property of extension.json.

Another improvement would be to provide an option for passing
arbitrary paths in core, in case you are working on tests for a
specific class and want to generate coverage reports instantly.

We could probably also remove
dockerfiles/quibble-coverage/phpunit-suite-edit.py (which inspired
this patch) and use composer phpunit:coverage-edit instead.

Bug: T100294
Change-Id: Ia0ef41f67ca4a64b0d1ca0ddcee488c29630af0b
2019-09-09 14:32:02 +02:00