Page MenuHomePhabricator

Red-green in PHPUnit code coverage are hard to read
Open, LowPublic

Description

Inspired by T232893, this is something I've always wanted to report. Our coverage reports on doc.wikimedia.org (example) uses a red/green combination that's very hard to discern. As partly colorblind, I can guarantee that:

  • The page is hard to read on a decent monitor
  • The page is impossible to read on a monitor with not-so-good colors (I tried a cheap laptop, and there really was no difference between the colors)

The colors seem to be decided by a bootstrap CSS file included directly by PHPUnit; hence, I'm going to open an upstream bug report. Nevertheless, I wonder whether we can change the color for our reports, before we will eventually upgrade to a newer version of php-code-coverage.

Upstream task https://github.com/sebastianbergmann/php-code-coverage/issues/556

Event Timeline

Daimona created this task.Sep 14 2019, 8:55 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 14 2019, 8:55 AM

FTR: https://github.com/sebastianbergmann/php-code-coverage/issues/698. Note that we use an old version of php-code-coverage, and the current one (7.0.7) is slightly different. Red and green are the same, though.

Krinkle renamed this task from Red-green in code coverage are hard to read to Red-green in PHPUnit code coverage are hard to read.Sep 14 2019, 3:30 PM
hashar moved this task from Backlog to Reported Upstream on the Upstream board.Sep 14 2019, 9:08 PM
hashar updated the task description. (Show Details)
Volker_E moved this task from Unsorted to Colors on the Accessibility board.Sep 16 2019, 5:40 PM

I didn't find the upstream response of allowing for custom CSS super satisfying, but I guess it's what we got. If someone writes a stylesheet, we just need to have CI copy it into .css/custom.css before rsyncing it to the docs server.

I used to have a stylesheet loaded via stylish or one of those browser extensions, but I lost that a while back and didn't really back it up.

hashar triaged this task as Low priority.May 3 2020, 9:21 AM
hashar added a subscriber: hashar.

Revisiting this task. From the upstream issue #556, php-code-coverage 6.0.5 now has an empty custom.css that one can override after the report has completed.

https://github.com/sebastianbergmann/php-code-coverage/commit/5626697ba169fc6bd56d38d83b478682f279bf7b

That is not really configurable, one has to manually copy the stylesheet after the report has been generated:

cp ./tests/coverage-style.css ./report/_css/custom.css