Skip to:
Content

BuddyPress.org

Opened 3 years ago

Closed 3 years ago

#7207 closed feature request (fixed)

track code coverage

Reported by: DJPaul Owned by:
Milestone: 2.7 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords:
Cc:

Description

For those who aren't familiar, code coverage is a measure used to describe the degree to which the source code of a program is tested by a particular test suite.

We have lots of legacy code not covered by tests, but any substantial new feature should have full test coverage. There are nice websites such as codecov.io and coveralls.io which track code coverage improvements over time, and will integrate into Travis-CI.

Change History (7)

#1 @djpaul
3 years ago

In 10997:

Travis-CI: adds code coverage with https://codecov.io

Adds a new Travis-CI task which runs PHPUnit with code coverage enabled.
The results are piped to codecov.io, which we're experimenting with to track
progress on our code's test coverage as the project grows.

Code coverage generation is very slow. To try to minimise the impact on the
rest of our Travis-CI configuration, the new travis:codecoverage task is
set in the allowed_failures section, which means Travis-CI should report
test pass/fail without waiting for the code coverage generation.

Another effort to speed this up has Travis-CI running the code coverage task
on PHP7 with phpdbg, as opposed to relying on xdebug, which is the default.

See #7207 and https://codecov.io/gh/buddypress/BuddyPress

#2 @djpaul
3 years ago

In 10998:

Travis-CI: tweak config to try to fix allowed_failures for travis:codecoverage.

See #7207 and r10997

#3 @djpaul
3 years ago

In 10999:

Travis-CI: travis:codecoverage requires an absolute path to PHPUnit on Travis-CI.

See #7207 and r10997

#4 @djpaul
3 years ago

In 11001:

Travis-CI: disable xdebug globally and switch travis:codecoverage to use xdebug instead of phpdbg.

In r10997, we set up a code coverage task which used phpdbg to speed up code coverage report generation.
Iteration and further testing has shown the Travis-CI environment will not support our particular project
layout with phpdbg. This commit simplifies the code coverage to use xdebug.

xdebug has also been globally disabled on Travis-CI (the code coverage task explicitly re-enables it)
because we are not relying on it for any parts of our existing tests, and doing so should speed up
running the unit tests.

See #7207

#5 @djpaul
3 years ago

In 11002:

Travis-CI: fix typo in config file.

See #7207

#6 @netweb
3 years ago

Is there anything else left to do here?

#7 @DJPaul
3 years ago

  • Resolution set to fixed
  • Status changed from new to closed

No, everything seems to be working!

Note: See TracTickets for help on using tickets.