Page MenuHomePhabricator

Tidy up @covers/@uses annotations in WikibaseQualityConstraints tests
Closed, ResolvedPublic

Description

I haven’t really been paying much attention to the @covers/@uses annotations when changing the tests, and by now I suspect a lot of them are out of date: there are probably @uses annotations for classes that aren’t actually used anymore, as well as plenty of missing @uses annotations.

I’m not sure how to systematically fix this, because it seems adding --strict-coverage has no effect, at least not for the way I usually run the tests.

Details

Related Gerrit Patches:
mediawiki/extensions/WikibaseQualityConstraints : masterRemove the starting slash from @covers tags
mediawiki/extensions/WikibaseQualityConstraints : masterRemove @uses from README.md
mediawiki/extensions/WikibaseQualityConstraints : masterRemove @uses tags

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 16 2017, 10:55 AM

it seems adding --strict-coverage has no effect

I guess that flag only has effect when generating coverage reports (which makes sense, I suppose). When using the phpunit.xml.dist file in the repository (see the instructions in the README), strict coverage seems to work fine, and reports loads of tests as risky.

thiemowmde triaged this task as Low priority.Nov 20 2017, 4:09 PM
thiemowmde moved this task from incoming to ready to go on the Wikidata board.
thiemowmde added a subscriber: thiemowmde.

If you as me, you should simply remove all @uses tags. From my experience they are of limited use, add awful clutter to the tests headers, nobody tracks and updates them properly, and they become outdated way to fast. Just make sure a test @covers exactly the one (maybe two or three) classes it should cover, and verify this via a coverage report.

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptNov 20 2017, 4:09 PM

Change 400694 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/WikibaseQualityConstraints@master] Remove @uses tags

https://gerrit.wikimedia.org/r/400694

Change 400694 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Remove @uses tags

https://gerrit.wikimedia.org/r/400694

Change 401563 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/WikibaseQualityConstraints@master] Remove the starting slash from @covers tags

https://gerrit.wikimedia.org/r/401563

Change 401568 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Remove @uses from README.md

https://gerrit.wikimedia.org/r/401568

Change 401568 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Remove @uses from README.md

https://gerrit.wikimedia.org/r/401568

Change 401563 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Remove the starting slash from @covers tags

https://gerrit.wikimedia.org/r/401563

WMDE-leszek closed this task as Resolved.Jan 3 2018, 11:09 AM
WMDE-leszek claimed this task.
WMDE-leszek moved this task from Review to Done on the Wikidata-Sprint-2017-12-20 board.