Page MenuHomePhabricator

Measure test coverage for all client libraries
Closed, ResolvedPublic

Description

To ensure that our code meets a high standard of quality, we should begin measuring test coverage for each of the metrics platform client libraries.

As an initial goal, we'll aim for 80% test coverage for all libraries.

Event Timeline

Mholloway created this task.

Change 712479 had a related patch set uploaded (by Mholloway; author: Michael Holloway):

[mediawiki/libs/metrics-platform@master] [PHP] Add coverage reporting

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

Change 712523 had a related patch set uploaded (by Mholloway; author: Michael Holloway):

[mediawiki/libs/metrics-platform@master] [JS] Add code coverage reporting

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

Change 712574 had a related patch set uploaded (by Mholloway; author: Michael Holloway):

[mediawiki/libs/metrics-platform@master] [Java] Add jacoco plugin

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

Change 713645 had a related patch set uploaded (by Mholloway; author: Michael Holloway):

[mediawiki/libs/metrics-platform@master] [Swift] Add make recipe for generating code coverage

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

Coverage reporting is in place for all libraries. Now we just need a target ;)

Mholloway renamed this task from Define a test coverage target and measure test coverage for all client libraries to Measure test coverage for all client libraries.Aug 30 2021, 2:33 PM
Mholloway updated the task description. (Show Details)

A note on the Swift library: my testing strategy for the core MetricsClient object in PHP, JS, and Java has been based on mocking. This is more difficult for the Swift library because AFAIK there is no mocking library currently in existence that's compatible with a pure Swift project. I've looked at https://github.com/birdrides/mockingbird and https://github.com/Brightify/Cuckoo and I don't believe either will work without substantial modifications.

Change 712574 merged by jenkins-bot:

[mediawiki/libs/metrics-platform@master] [Java] Add jacoco Gradle plugin for code coverage reporting

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

Change 713645 merged by jenkins-bot:

[mediawiki/libs/metrics-platform@master] [Swift] Add make recipe for generating code coverage

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

Change 712523 merged by jenkins-bot:

[mediawiki/libs/metrics-platform@master] [JS] Add code coverage reporting

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

Change 712479 merged by jenkins-bot:

[mediawiki/libs/metrics-platform@master] [PHP] Add coverage reporting

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